Disable restarting arduino after connect to serial gateway.
Arduino is restarting after connect to controler (Serial Gateway - OpenHab). But this is not gateway issue. I think it is quite natural, because arduino had to run presentation, but I wondering is it possible to not restarting arduino? It is very important because i have to controll critical relays by it. And i wont turn it off after gateway restart by any reason.
@dawidi do you mean that OpenHab sends a command to the Nodes to restart? Idon't have experience with OpenHab, but that sounds like a strange behavior. I use Domoticz and it does not send restart commands.
@dawidi arduino hardware resets a board through the DTR signal on the serial port. You could disconnect the DTR line to prevent the reset.
@mfalkvidd I do not find any information sending by gateway to restart arduino. It looks like that:
[log] system start [log] some relays state changed from null to ON (restored states) [log] some relays state changed from null to OFF [log] MySensors bridge is changed from OFFLINE (COMMUNICATION_ERROR) to OFFLINE [log] MySensors bridge is changed from OFFLINE (COMMUNICATION_ERROR) to OFFLINE [log] MySensors bridge is changed from OFFLINE to ONLINE (finnaly) [log] all relays changed from OFFLINE to ONLINE
And then arduino restarting. So if i restart OH, arduino keep states until it connect again.
@Yveaux How can i do that?
@dawidi to bypass it depends a lot on the actual Arduino hardware used. See here for some background info on the topic: https://rheingoldheavy.com/arduino-from-scratch-part-11-atmega328p-dtr-and-reset/
The link describes for an Arduino Uno: "If for some reason, you wanted to disable the autoreset function, you would run a very sharp knife down between the two halves of the solder jumper at “RESET EN”, to cut the trace. "
From software you can prevent auto reset by disabling DTR when talking to the serial port; google for it: https://www.google.com/search?q=prevent+dtr+reset+from+software
@yveaux Thank you man so much. I wrote topics on gateway's github, here in cotroller section, OH forum and no one knows how to fix that. I cut jumper on RESET EN and it works. TY!
@dawidi great to hear you solved it! Glad I could help.