I've been able to get MySensors working with HomeGenie using the MQTT gateway. It doesn't have two-way communication or software-based pairing yet, but I'll work on those in the future.
I think that:
It does overlap with MySensors for the wireless network. MQTT-SN assumes a network that provides a bi-directional data transfer service between any node and a particular one (a gateway). MySensors wireless network could provide data transfer but the message are really tailored to transport sensor and actuator values.
MQTT-SN for the gateway - controller interface is not needed MQTT is for that more than fine
That said I like the idea of MQTT-SN but for it a "transparent network" makes more sense.
wdt.h is included on Arduino IDE.
This example show how it's work:
#include <avr/wdt.h>
int counter=0;
void setup(){
wdt_disable();
Serial.begin(9600);
Serial.println("Starting...");
delay(1000);
wdt_enable(WDTO_8S);
}
void loop(){
wdt_reset();
Serial.println(counter);
counter++;
if(counter==5){
while(true){}
}
delay(500);
}```
After more investigations I believe the problem is caused by a mqtt server connection timeout.
By default the gateway tries to send the radio message 5 times. If I lower the number of retries , 2 for example, no more loop. Probably now much more then 25 messages cause a loop.
For testing I added _MQTT_client.loop() in transportSendWrite() (MyTransport.cpp) and, no more loop with default 5 retries.
@ericvdb
Yes, I know about the 5V. But the adapter brings it down to 3.3V for the radio, that is the reason for using it and the adapter is equipped with the AMS 1117 3.3V chip. Seems to work OK but I really do not have any hard facts to prove it.
One thing I may test is to wire the 5V also directly to this adapter instead of taking it out from the Arduino 5V pin. This is to find out if this Arduino Nano clone might have too small capacity for feeding the radio at certain occasions.
Might be helpful for somebody... Things configuration for OpenHab2:
Bridge mysensors:bridge-eth:gateway_2 [ ipAddress="192.168.178.50", tcpPort=5003, sendDelay=200, enableNetworkSanCheck=true ] {
/** define things connected to that bridge here */
light sonoff01 [ nodeId="0", childId="0", requestAck=true ]
}
@celonunes generally raspberry pi with serial usb but also you can see some mqtt logs. Same problem with mac os with serial usb.
I also tried rpi uart pins for serial bu there is no logs for it.
Maybe someone gives his Openhab dir i can understand better problem isnt related with hardware