MySensors 1.6 availability?
-
I am interested about the 1.6 version of MySensors, mainly for the MQTT Gateway using W5100, while this is not available today even in the development version. Do you have an estimation about this release availability or at least about the Gateway using W5100?
Until now, I succeed to implement the 1.5 version of MQTT Gateway with 5100 to work with Home Assistant, while the Serial Gateway doesn't work for me.
Thank you
-
-
The link is about the Ethernet Gateway, not MQTT Gateway. However, none of them seems to be ready, the setup and loop are empty. I am using now MQTT Gateway from 1.5 version together with HomeAssistant, I have posted my code (now is under testing), but I cannot add other MQTT devices.
-
@Mihai In 1.6 @hek refactored the code, so loop() and setup() are supposed to be empty. The MQTT stuff runs outside these functions.
-
I'm not sure I follow your question.
The 1.6 dev environment has GatewayW5100MQTTClient here: https://github.com/mysensors/Arduino/tree/development/libraries/MySensors/examples/GatewayW5100MQTTClient
You can see the actual protocol in actions here: https://github.com/mysensors/Arduino/blob/development/libraries/MySensors/core/MyGatewayTransportMQTTClient.cpp
Cheers
-
Thank you for explanation, I was expected a regular sketch with setup and loop doing their jobs, I didn't know they could be empty.
-
@Mihai, I see.
As @Yveaux said, this is a refactor / change in architecture from 1.5 to 1.6
For example:
The serial gateway from 1.5 (setup and loop):
void setup() { gw.begin(incomingMessage, 0, true, 0); setupGateway(INCLUSION_MODE_PIN, INCLUSION_MODE_TIME, output); // Add interrupt for inclusion button to pin PCintPort::attachInterrupt(pinInclusion, startInclusionInterrupt, RISING); // Send startup log message on serial serial(PSTR("0;0;%d;0;%d;Gateway startup complete.\n"), C_INTERNAL, I_GATEWAY_READY); } void loop() { gw.process(); checkButtonTriggeredInclusion(); checkInclusionFinished(); if (commandComplete) { // A command wass issued from serial interface // We will now try to send it to the actuator parseAndSend(gw, inputString); commandComplete = false; inputPos = 0; } }
Serial gateway from 1.6 (set up loop and new presentation section):
void setup() { // Setup locally attached sensors } void presentation() { // Present locally attached sensors } void loop() { // Send locally attached sensor data here }
Cheers
-
Thanks, I already succeed to test the MQTT Gateway 1.6 and it seems to work (subscribe ok to mosquitto, send and receive some commands), but still looking for the Serial API related to 1.6 for better understanding how to program HomeAssistant to work together.
-
I cannot control relay from HomeAssistant to MySensors 1.6. I was built my own node sketch wit 4 relays and other sensors. The command for relays are "ON" and "OFF".
I have added the following line into the receive procedure for testing purposes:Serial.print("Message data: ");Serial.println(message.data);
And find out the messages reach the node as following:
read: 0-0-10 s=1,c=1,t=2,pt=0,l=3,sg=0:OFF Message data: OFFIRTempa
and it is the same for sensors:
read: 0-0-10 s=6,c=1,t=0,pt=0,l=3,sg=0:NAN Message data: NANIRTempa
(NAN is because the temperature sensor is not connected, never mind)
So the message contains the data plusoffset "IRTTempa". When I compare the data string with my expected value they didn't match: OFF is not the same with OFFIRTempa.
For 1.5 version I get them work fine over MQTT with exactly the right string.
Do you have any advice? Thank you.
-
I guess there was a topic regarding the same issue and how to fix but i cant find it.
I found another one. Check whether this is related or not http://forum.mysensors.org/topic/2688/isue-bug-in-message-getint-or-getfloat-payload-dos-not-reinitialized-completely
-
Thank you for hint, inside the provided link page I found another one: https://github.com/mysensors/Arduino/pull/317 and there I understand the issue was solved in the available development version, so I download it, install and it works now!
-
Ah, so it was a regression! I made my Neopixel node with this bug in mind. I just grabbed the newest 1.6 a few hours ago, so I'll assume it's fixed.
Cool beans!
-
This wasn't clear to me either, I was expecting to see setup() & loop(). Perhaps a note or some documentation why this is empty would be useful.