💬 Building a wired RS485 sensor network
-
I am trying to build up a Mysensors with Wired ethernet to the gateway with W5100 and RS485 bewteen nodes, is there something that can help me with this configuration?
Everything looks weel from the monitor serial but domoticz is not able to connect to the gateway! -
I see there is a possibility the combine Ethernet with RS485.
Maybe you can check the setup as they did here:https://www.openhardware.io/view/649/RS485-Ethernet-Gateway#tabs-comments
https://github.com/feanor-anglin/GetWired-Project/blob/master/GetWired Ethernet Gateway/Gateway.ino
-
You can also try using PJON - it has solved all the issues that I was facing with RS485 and other wired solutions (like all sensors on the Gateway). It will be released officially in MySensors 2.4.0, but you can test is already now (alpha):
https://github.com/tekka007/MySensorsYou can read more here:
https://github.com/mysensors/MySensors/pull/1278 -
You can also try using PJON - it has solved all the issues that I was facing with RS485 and other wired solutions (like all sensors on the Gateway). It will be released officially in MySensors 2.4.0, but you can test is already now (alpha):
https://github.com/tekka007/MySensorsYou can read more here:
https://github.com/mysensors/MySensors/pull/1278@gryzli133 I have a number of MySensors devices using RS485, it would be interesting to try to run PJON protocol over RS485, it seems like there is such an opportunity, but I could not figure out how to use it in the MySensors library.
-
@hypnosiss you may be interested in this https://forum.mysensors.org/topic/11814/rs485-transport-ack-support/6
-
@hypnosiss you may be interested in this https://forum.mysensors.org/topic/11814/rs485-transport-ack-support/6
@cabat thank you. I have losts when number of messages are sent from HA to nodes(throught mqtt ethernet gateway) and in the same time nodes are sending messages to controller as well. I described issue on Home Assistant forum but without any response - https://community.home-assistant.io/t/lost-messages-sent-simultaneously/363904
-
yes it's not easy, the loss of package is a difficult thing to
to counter, but not entirely.
and the multiple layers of a computer system do not help :)some philosophy on collision avoidance
https://arduino.stackexchange.com/questions/24523/rs485-multimaster-communication-with-collision-avoidancedon't mix the Protocol (data encapsulation)
and the physical support (voltage frequency impendance / star or serial bus)the ModBus protocol on a RS485 support
https://www.electroniclinic.com/arduino-modbus-rs485-arduino-rs485-master-and-slave/a different explanation https://www.codrey.com/learn/rs-485-arduino-quick-primer/
for information
https://github.com/sonyarouje/Arduino_HardwareSerial_RS485But the best solution (reliability and especially lightness of the sketch) is the CAN bus :)
I may have said some stupid things ;)
Translated with www.DeepL.com/Translator (free version)
-
a line of the examples given in the sketches for the use of RS485 can be a source of problem
(it's my case, I use Pin2 or3 for a long time :( )...
// Define this to enables DE-pin management on defined pin
#define MY_RS485_DE_PIN 2
(2 or 3 is an interrupt pin for a Uno)
...avoided interrupt pins.
the pin 10 is a good thing :)
-
Thank you @JeeLet !
I've been struggling with missing msgs for years with my Arduino Mega
I changed pin and no issues! :D
In the pjon code I've reached to list of tested pins that communication works properly
https://github.com/gioblu/PJON/blob/38e36bb1228c1690143cfbf693a0bcb809514d6c/src/strategies/OverSampling/README.md?plain=1#L12