💬 Building a wired RS485 sensor network
-
@Reza No. You need to have your gateway inbetween. Your controller can't "talk" directly with you MySensors network. Wee the picture from kimot.
-
@Reza No. You need to have your gateway inbetween. Your controller can't "talk" directly with you MySensors network. Wee the picture from kimot.
@wimd we can build a gateway with raspberrypi without arduino . @gohan saying true . but i have to use gpio for serial gateway because when i use a usb serial port after turn on/off or reboot raspberry can not detect my gateway... but with gpio i test and this is true, so i have to use gpio for gateway
-
@wimd we can build a gateway with raspberrypi without arduino . @gohan saying true . but i have to use gpio for serial gateway because when i use a usb serial port after turn on/off or reboot raspberry can not detect my gateway... but with gpio i test and this is true, so i have to use gpio for gateway
-
@Reza
Maybe your problem and its solution with "serial-through USB" connection on Raspberry is described here:https://g0kao.wordpress.com/2013/08/08/usb-port-assignment-on-a-raspberry-pi/
-
@wimd we can build a gateway with raspberrypi without arduino . @gohan saying true . but i have to use gpio for serial gateway because when i use a usb serial port after turn on/off or reboot raspberry can not detect my gateway... but with gpio i test and this is true, so i have to use gpio for gateway
-
@kimot @gohan do you use a wired network with rs485 ? i have problem with rf24 and i want change my wireless network to a wiring network , but i want know with a rs485 all command are send? without error and NACK ? now for wireless network i have for example every 5 true commands 1 fail command(NACK)
-
@kimot @gohan do you use a wired network with rs485 ? i have problem with rf24 and i want change my wireless network to a wiring network , but i want know with a rs485 all command are send? without error and NACK ? now for wireless network i have for example every 5 true commands 1 fail command(NACK)
-
@Reza
not yet, but I am getting the parts to make a wired rs485 network of 4 nodes + gateway. About the NACK error it should be handled by the library and retransmit the lost packet. -
i am tired for test and trying to configure wiring network with RS485. this is strange :angry:
i build a gateway and a relay with rs485 . for test i now use 2raspberry pi and 1orangepi and a laptop ! every time disconnect gateway from one and connect to other one ( with out other change for example sketch and wiring and etc. just change controller) some time this is very good work on laptop. some time good work on orange and some time good on raspbrrey pis !! some time same first command has sent(LED on gateway and on node just one blink. some time LEDs 2 blink and turn on later)
i am using 15cm wire between 2nodes! when change to some meter so dont work never...
so there is not any one that understand what is reason this issue !!!i am ready and i have devices and madules. so any body that think can solve this , told me so i test on my devices and feedback.
-
-
@Reza have you tried to use terminating resistors?
And perhaps it could be good to try 1k pull-up and pull-downs at the gateway end. The left diagram:

With these two tricks I got my setup stable.
And a little tweak to transport class could help also..
-
@Reza have you tried to use terminating resistors?
And perhaps it could be good to try 1k pull-up and pull-downs at the gateway end. The left diagram:

With these two tricks I got my setup stable.
And a little tweak to transport class could help also..
@pjr thank you for help , i read that topic hardly :) because i am weak in english.
What I understand , this problem is about collision , command and ack ! and related to transport rs485 and other friends trying to solve this ! is this true ?now , a rs485 network is not complete and Ideal and stable in mysensors.
i think all problem is related to collision in short wire and long wire. in many short wire i have not problem(between two nodes). in short wire gateway detect node and connect but many command are failed . in long wire gateway can not detect node and can not connect never. -
@pjr thank you for help , i read that topic hardly :) because i am weak in english.
What I understand , this problem is about collision , command and ack ! and related to transport rs485 and other friends trying to solve this ! is this true ?now , a rs485 network is not complete and Ideal and stable in mysensors.
i think all problem is related to collision in short wire and long wire. in many short wire i have not problem(between two nodes). in short wire gateway detect node and connect but many command are failed . in long wire gateway can not detect node and can not connect never.@Reza
Original RS485 library was written so, that multiple SOH characters is sended on start of package.
In Mysensors library it is only one times and it can be problem for synchronization and arbitration.Try in MyTransportRS485.cpp in function "transportSend" change line 274 from
for(byte w=0; w<1; w++) {
to
for(byte w=0; w<3; w++) {
-
@Reza
Original RS485 library was written so, that multiple SOH characters is sended on start of package.
In Mysensors library it is only one times and it can be problem for synchronization and arbitration.Try in MyTransportRS485.cpp in function "transportSend" change line 274 from
for(byte w=0; w<1; w++) {
to
for(byte w=0; w<3; w++) {
-
@Reza
Original RS485 library was written so, that multiple SOH characters is sended on start of package.
In Mysensors library it is only one times and it can be problem for synchronization and arbitration.Try in MyTransportRS485.cpp in function "transportSend" change line 274 from
for(byte w=0; w<1; w++) {
to
for(byte w=0; w<3; w++) {
@kimot this is good. i am testing . in the first test ((just for 2 node: gateway and one relay)) i see this is work well with 15cm wire. other test with 1meter and 5 meter work well.for 30 meter (CAT6) with 120 ohm resistor (first and end bus) dont work :) without resistor work with 15-20% error ( dont receive or send command and ack)
but i think this is good for 2 nodes and short distance and for more nodes and distance increase % errors. is this true ? -
@Reza
Original RS485 library was written so, that multiple SOH characters is sended on start of package.
In Mysensors library it is only one times and it can be problem for synchronization and arbitration.Try in MyTransportRS485.cpp in function "transportSend" change line 274 from
for(byte w=0; w<1; w++) {
to
for(byte w=0; w<3; w++) {