Connecting sensor to gateway via RS485 instead of nRF24



  • Hi!
    Does anyone tried to connecting sensors with RS485 interface?
    I was wondering if it possible to replace wireless connection with wired one and maintaining all of protocol used. Just get rid of nRF24 routines and replacing them with those for RS485.



  • Great idea, especially when someone have an oppoturnity to lay cables in new built house.


  • Mod

    @Johny-Mielony why not?

    the job gateway is doing is very simple
    you can modify gateway sketch to deal with RS485 instead of RF24 library



  • @axillent looking at gateway's sketch I find it quite easy to modify for listening on serial interface, it just passes messages between interfaces.
    But how about sensors? I find it more tricky. Do I understand it right? I mainly need to modify functions in MySensor.cpp as sendWrite and process? Or there is something else?


  • Mod

    all it depends on the protocol design on your RS485 network
    Possibly are 2 scenario here:

    1. using any free design for the communication between your rs485 sensors and rs485 gateway
      It can be any existing third party design
      In this scenario you will need to make sure that your gateway will translate messages from rs485 network to match the logic of mysensors network before sending data to Vera

    2. take a look to mysensors library. you can replicate the same data exchange using rs485 instead of nordic radio
      this thay your gateway will not need a translation, it will have just to pass data between Vera and rs485 network



  • I don't have any protocol on RS485, I wanted to use MySensors protocol.
    Idea is that I want to replace the physical layer of transmission.
    Where I can place cables I want to place them, but where I can't do that I want to use radio.
    I'm not using Vera, I'm going to use OpenHAB on single board computer.
    I need just hint where to start.


  • Mod

    @Johny-Mielony just read about modbus today. Its logic is very similar to Mysensors - it have ID of the sender and ID of the reciever.
    Take a look, may be one of the modbus implementation can be used to pass mysensors data. I'm not sure it can match the need but may be it will - http://www.freemodbus.org/
    If you will succeed on this it can be a good value for the MySensors



  • I know about modbus. At first I thought about using it, but it's more for industrial than home use.
    I will experiment with RS485. I have some ideas, just need to find some time to test it.
    Of course I will share if I get to something useful.




  • Mod

    @ch3b7 cool idea
    but cat5 is too much
    i just purchased a set of 6p6c connectors - phone standard
    RS485 + power requires just 4 wires

    have an idea of the set of devices to control my swimming pool
    in my idea only the master device will be integrated to Mysensors, all other will not, it will be local RS485 network
    But if Johny will be successful I will probably will connect all devices to MySensors)



  • This chainduino looks good, but it is just arduino with on-board RS485 hardware. Still all job is done in software.
    I'm thinking about encapsulating MySensors message into frame which will be sent via RS485 bus.



  • http://sourceforge.net/p/arduino-icsc/wiki/RS-485/ this is a good library to start! now im stuck with ethernet controller in my program in .net at now i cant see any string but the gateway work good ¬¬ i need more time ^^



  • Hi, Have you seen the following:
    rs485-rs232-serial-transport-class-for-mysensors-org

    Is that what you are looking for?


Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.