plugin upgrade for Indigo > v2022.2?

Posted on
Mon Jun 26, 2023 2:15 pm
kw123 offline
User avatar
Posts: 8275
Joined: May 12, 2013
Location: Dallas, TX

Re: plugin upgrade for Indigo > v2022.2?

Great. And thanks for testing.


Sent from my iPhone using Tapatalk

Posted on
Sat Jul 01, 2023 4:03 am
slackman1 offline
Posts: 49
Joined: Jun 20, 2011

Re: plugin upgrade for Indigo > v2022.2?

Hi Karl,

Just to confirm (a few 'tomorrows' later...), in my situation the plugin seems totally stable.

Thanks again!

Gerrit Jan

Posted on
Mon Jul 31, 2023 3:24 pm
dawson1331 offline
Posts: 32
Joined: Oct 22, 2012

Re: plugin upgrade for Indigo > v2022.2?

I am having a problem with the new Arduino plugin. I do a few things differently with my python code. So it could be my fault but I thought I would mention here just in case it is a real problem.

The symptom is that the value of the last variable in my list of string variables is always set to the empty string (“”) even though the Arduino is sending down real values. In my case I have 7 string variables - S1, S2, …, S7. The last variable in my list, S7, is always empty. If I increase the number of string variables to 8, then S7 is returned with the expected results but S8 is empty. The first two variables, S0 and S1 are type “OUTPUT”. The remaining are type “read from STRING variable”. Everything else is “Off, do not use”.

I believe the problem is in the Arduino plugin code: plugin.py in procedure
def parseFromArduino(self, inp, output):

This procedure parses the command that comes from the Arduino - something like:
b’>>rd:S1=xxx&rd:S2=xxx& … &S7=xxx’

The variable p1 will be something like this as it goes through the for loop
b’>>rd:S2=none
rd:S3=xxx
rd:S4=xxx

rd:S7=xxx


After the last for loop iteration, p1 is a ‘. The variable pK does not find the the “:” and fails the if test which then overwrites the out[S7] variable with the empty string. So S7 was for a short time “xxx” but it ends up as the empty string.

As a side note, sometimes the variable “pin” is undefined causing an exception. This happens in my code 3 times but is not critical for me. In general, it will just use the last value that it had which, in this test case, was “S7”.

For the time being, I commented out the line in the else clause:
out[pin]={“cmd”:cmd, “values”:values}
so that S7 is not overwritten and it seems to work ok, but I don’t know what the side effects are.

I am not able to explain it very well and I don’t really know python that well so I may be way off base. If you are interested and can direct me, I can do more work and send you a better log file showing actual values in the loop. Feel free to ignore this post if I am off base.

I appreciate the Arduino plugin. I currently have 8 Arduino’s running in my house. Thanks for all of your work on that and the other plugins you have done.

Thanks again,

Bill Dawson
dawson1331@aol.com

Posted on
Mon Jul 31, 2023 3:44 pm
kw123 offline
User avatar
Posts: 8275
Joined: May 12, 2013
Location: Dallas, TX

Re: plugin upgrade for Indigo > v2022.2?

Will check tomorrow


Sent from my iPhone using Tapatalk

Posted on
Tue Aug 01, 2023 2:34 am
kw123 offline
User avatar
Posts: 8275
Joined: May 12, 2013
Location: Dallas, TX

Re: plugin upgrade for Indigo > v2022.2?

please try version .15 just posted.

added an "if" to catch empty strings and added debug in parsing.

you can switch that on in config ( debug http )

Karl

Posted on
Wed Aug 02, 2023 6:19 pm
dawson1331 offline
Posts: 32
Joined: Oct 22, 2012

Re: plugin upgrade for Indigo > v2022.2?

This fixed my immediate problems but may have caused more. Previously the LAST variable was set to the empty string. That has been fixed. Now the FIRST variable is set to the empty string.

For some reason p2[0] contains the b'>> as well as the command. So cmd = mapFromArduino[p2[0]] fails and causes an exception. This happens only the first time through the loop. I have tried to upload a log showing the loop and the value of variables in the loop and also the code to print the messages. I don't know the best way to do that...

Thanks,

Bill
Attachments
arduinoTest.txt
(6.72 KiB) Downloaded 29 times

Posted on
Wed Aug 02, 2023 9:15 pm
kw123 offline
User avatar
Posts: 8275
Joined: May 12, 2013
Location: Dallas, TX

Re: plugin upgrade for Indigo > v2022.2?

Copy the log and then send me an email
Karlwachs at me com


Sent from my iPhone using Tapatalk

Posted on
Thu Aug 03, 2023 2:42 am
kw123 offline
User avatar
Posts: 8275
Joined: May 12, 2013
Location: Dallas, TX

Re: plugin upgrade for Indigo > v2022.2?

please try v 2022.9.16

added some character removal due to py3 unicode / byte type data

karl

Posted on
Thu Aug 03, 2023 4:51 pm
dawson1331 offline
Posts: 32
Joined: Oct 22, 2012

Re: plugin upgrade for Indigo > v2022.2?

I can not find a v 2022.9.16 to download. The current one, v15 seems to be the same.

Thanks,

Bill

Posted on
Fri Aug 04, 2023 12:07 am
kw123 offline
User avatar
Posts: 8275
Joined: May 12, 2013
Location: Dallas, TX

Re: plugin upgrade for Indigo > v2022.2?

sorry forgot to replicate to the indigo site. it was on GitHub only, now it is also on the indigo site.

I will be out of town until Wednesday evening (vienna time)

Karl

Posted on
Tue Aug 08, 2023 4:29 pm
dawson1331 offline
Posts: 32
Joined: Oct 22, 2012

Re: plugin upgrade for Indigo > v2022.2?

Thanks Karl. This fixed all of my issues. I appreciate that you ported to python3 and are keeping the plugin alive.

Who is online

Users browsing this forum: No registered users and 1 guest