💬 Building a wired RS485 sensor network
-
@kimot said:
Imagine, if you "switch on" entire your network with 10 nodes. Each node send request for NODE_ID to the gateway and gateway send broadcast with assigned NODE_ID. How RS485 nodes recognizes, that this NODE_ID is exactly for specific node?
This will not work (and the same applies for a radio network). All nodes will then pick the broadcasted id.
This is known limitation and has its technical background in how the radios work and that the new have problem generating a good unique random number when it starts blank.
I know we had some ideas of adding a payload (random number) on the id-request payload identifying the requesting node. The node then also check that this number is the same in the id-response. But would break backward compatibility with the serial protocol so it would only happen in a bigger (3.0?) release.
Edit: Added issue so we won't forget it.
https://github.com/mysensors/MySensors/issues/732@hek
Thanks for your explanation.
Last question for you. I cannot find information about internal message strukture.
Only this discussion:
https://forum.mysensors.org/topic/305/mysensors-protocol-format
or
"hacking" librariesWitch version is actual?
I need myself write translation between my network message format and MySensors message format to use
something like MyTransportRS485.cpp. But I have limited number of bytes for payload, so I need modify and test "data" array too.
Thanks. -
@wimd
i have problem with usb port in raspberry. everytime after power off/on , usb port lost for me. so now i use a raspberry gateway . rs485 can run on gpio ? with a virtual usb port -
@Reza Check https://www.mysensors.org/build/raspberry. There is a comment for a serialgateway.
-
@wimd
i have problem with nrf24. and this is work bad for me in distance 10 or 20 meter. i have problem in wireless connection. this protocol have not this problem ? connection is good ? with out any disconnect ?@Reza Struggling also with the radio network if the distance is more then 5m (and I'm using the ones with the antenna) I have troubles
Add #define MY_RF24_PA_LEVEL RF24_PA_HIGH to send on maximum power.
Added the capacitor give a bit extra power on the 3,3V?I do not have a RS485 network installed yet but trails on a 10m ethernet cable did not give any issues. Still in program phase.
-
@wimd
i see this, but this is not for a arduino wiring. this is for a nrf24 . perhaps @marceloaqno can setup a rs485 gateway on raspberry. thank you -
@Reza Struggling also with the radio network if the distance is more then 5m (and I'm using the ones with the antenna) I have troubles
Add #define MY_RF24_PA_LEVEL RF24_PA_HIGH to send on maximum power.
Added the capacitor give a bit extra power on the 3,3V?I do not have a RS485 network installed yet but trails on a 10m ethernet cable did not give any issues. Still in program phase.
@wimd
i use capacitor 4.7 , 100 , 470 uf.
i use 3 type of radio. (usual + 2chip + 2chip+pa+lna)
i use radio adapter. i use regolator 5 to 3.3 module.
but i have problem yet.
i dont test #define MY_RF24_PA_LEVEL RF24_PA_HIGH !
what is code ? and where i can add this ? for gateway or nodes?
this code can solve my problem ? in other means this code can increase power of radio ? -
@wimd
i use capacitor 4.7 , 100 , 470 uf.
i use 3 type of radio. (usual + 2chip + 2chip+pa+lna)
i use radio adapter. i use regolator 5 to 3.3 module.
but i have problem yet.
i dont test #define MY_RF24_PA_LEVEL RF24_PA_HIGH !
what is code ? and where i can add this ? for gateway or nodes?
this code can solve my problem ? in other means this code can increase power of radio ? -
@Reza yes adding this code increases the power of the radio.
you add this code at the begin of your sketch (both gateway and nodes)#define MY_RADIO_NRF24 #define MY_RF24_PA_LEVEL RF24_PA_HIGH -
@Reza yes adding this code increases the power of the radio.
you add this code at the begin of your sketch (both gateway and nodes)#define MY_RADIO_NRF24 #define MY_RF24_PA_LEVEL RF24_PA_HIGH@wimd
i test with "PA_HIGH" and "PA_MAX" (for nodes and gateway) but this is more bad.
(for example for 10-15 meter with 2 wall)
in default PA for 10 command i have 2 error
in PA_HIGH for 10 command i have 8 error
in PA_MAX my connection is disconnect completly
can you understand where is problem? i think this is related to power supply of radio (because when i want more power for more distance so radio can not have a good connection) but i providing enough power for radio. i use a adapter 5v 2A and connect this to a radio adapter(reglator 5 to 3.3) even use a 4.7u capacitor for radio. similar to photo:

-
@wimd
i test with "PA_HIGH" and "PA_MAX" (for nodes and gateway) but this is more bad.
(for example for 10-15 meter with 2 wall)
in default PA for 10 command i have 2 error
in PA_HIGH for 10 command i have 8 error
in PA_MAX my connection is disconnect completly
can you understand where is problem? i think this is related to power supply of radio (because when i want more power for more distance so radio can not have a good connection) but i providing enough power for radio. i use a adapter 5v 2A and connect this to a radio adapter(reglator 5 to 3.3) even use a 4.7u capacitor for radio. similar to photo:

@Reza You have exactly the same problem as I had when I first found MySensors in march last year.
I got a couple of radio and started to play with them. All worked fine as long as they were not more than 5m away from each other. I dropped the idea at that time.2 months ago I saw the possibility on the website to build a wired network. I started again. With the order for the RS485 bricks I ordered also some radios but now with antenna and amplifier. The only improvement I got was now up to 7m.
I managed now to connect with my greenhouse that is 12m away but had to place a repeater in between but the connection is no reliable.The discussion that is now ongoing is not related anymore to a RS485 network. I suggest you start an new topic specific for your radio issue. Or we both did do something wrong or the hardware that we buy does not meet the specification for transmitting distance.
Let me now if you started a new topic.
-
@wimd
i test with "PA_HIGH" and "PA_MAX" (for nodes and gateway) but this is more bad.
(for example for 10-15 meter with 2 wall)
in default PA for 10 command i have 2 error
in PA_HIGH for 10 command i have 8 error
in PA_MAX my connection is disconnect completly
can you understand where is problem? i think this is related to power supply of radio (because when i want more power for more distance so radio can not have a good connection) but i providing enough power for radio. i use a adapter 5v 2A and connect this to a radio adapter(reglator 5 to 3.3) even use a 4.7u capacitor for radio. similar to photo:

-
@gohan
I2C bus is designed for short distances, obviously between circuits on one PCB.
Max allowed capacitance i2c bus is 400pF. CAT5 cable has nominal 52pf/m.
Ideally you can communicate to distance 8m.
It is very short bus for home network, I think.
Or we need some "hacking" for i2c bus, for example at page 4 in this document:http://www.nxp.com/documents/application_note/AN460.pdf
For each node we need one bus expander ( P82B96 ) and two CAN bus drivers ( PCA82C250 ).
7 + 2*0.5 US$ ( ebay )
Plus second pair of wires.
Or buy this: http://mayhewlabs.com/products/i2c-power-extender
You can read bus length, number of nodes and speed limit, there.But, interesting idea.
With some smart "node addressing" and multi-master i2c bus I can imagine, that on some places you do not need processor.
For actuator simply use PCF8574 for example.