Arduinon startup complete request strange behaviour (python)
-
@hek is it in any way possible that messages get scrambled on the gateway when they cross each other?
-
This happened with and without debug printing.
The funny thing is that it appeared 'out of the blue', showed up a couple of restarts and it looks like it disappeared again with the last restart.
I will keep an eye on it since I will need a lot of restarts before I am ready with the plugin ")
-
OK, this time it is completely clear to me but I don't know why yet.
Receiving command 1;2;2;2;0;0;4;11;Arduino startup complete.
Two sensor/gateway messages were concatenated.
The first a relay device 'reporting for duty', asking for the registered state of itself 1;2;2;2;
And following the gateway reporting for duty: 0;0;4;11;Adruino startup completeStrange though that the gateway presentation comes after the sensor presentation...
-
OK, this time it is completely clear to me but I don't know why yet.
Receiving command 1;2;2;2;0;0;4;11;Arduino startup complete.
Two sensor/gateway messages were concatenated.
The first a relay device 'reporting for duty', asking for the registered state of itself 1;2;2;2;
And following the gateway reporting for duty: 0;0;4;11;Adruino startup completeStrange though that the gateway presentation comes after the sensor presentation...
-
See below, the answer is yes. I do a readline() and it breaks on '\n' by default and MySensors does the same.
BTW I added the flush() after sending my previous post as well as removing all sleeping code from the sensor.
I will start playing with this because I suspect one of these two (or both) solved the issue.
I now see Receiving command 0;0;4;11;Arduino startup complete. before anything else :)EDIT: false alarm. A new upload of the sketch and a restart made the issue appear again :(
try: request = self.connection.readline() except: self.debugLog("Unexpected error:", sys.exc_info()[0]) request = None finally: self.connection.flush() if request: request = request.strip("\n\r") self.debugLog("Receiving command %s" % request) -
See below, the answer is yes. I do a readline() and it breaks on '\n' by default and MySensors does the same.
BTW I added the flush() after sending my previous post as well as removing all sleeping code from the sensor.
I will start playing with this because I suspect one of these two (or both) solved the issue.
I now see Receiving command 0;0;4;11;Arduino startup complete. before anything else :)EDIT: false alarm. A new upload of the sketch and a restart made the issue appear again :(
try: request = self.connection.readline() except: self.debugLog("Unexpected error:", sys.exc_info()[0]) request = None finally: self.connection.flush() if request: request = request.strip("\n\r") self.debugLog("Receiving command %s" % request) -
Nope, this was a 'if it does not help it will not hurt'.
I am going to remove it.
-
Yes, all variables are cleared before I re-use them which is completely obsolete even because they are defined in the method and the method is called from within a/the loop.
I will ask the Indigo gurus about this...