Arduinon startup complete request strange behaviour (python)
-
Hi,
When the gateway is started up it sends a message 'Arduino startup complete' (at least that is what I see).
But instead of using the 'normal' 5 field format I receive the below with 8 fields.
Obviously this is wrong and it looks like one or two request are mixed up (possibly a request for a radioId together with the startup message)...
Any idea how this can happen (using python and serial connection)...2014-04-29 01:16:36 MySensors Debug Receiving command 255;255;4;0;0;4;11;Arduino startup complete.
-
@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...
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login