RS485 Gateway on Raspberry Pi



  • Re: RS485/RS232/Serial transport class for mysensors.org

    Hello gentlemans,
    I am strugling with crazy combination of RS485 adapter connected to Raspberry Pi, which is running Node-RED, and I would like to connect arduino sensors through RS485 to this gateway.
    For start, I hope this configuration is possible. So I connected the MAX RS485 adapter to the pi like this 0_1495647613483_raspberry rs485_bb.png
    I installed the MySensors gateway , and I am able to run it without problem, I can even see gateway started successfully, but I think it doesn't know anything about status of RS485 in real.

    On the other side I burnt example of RS485 motion sensor to arduino pro mini, and watched serial console, It cannot Find parent so there has to be some communication issue.

    I wanted to exclude Raspberry pi as gateway from this so I came with another setup, 2 arduinos with adapters together, one acting as Gateway, second one still with motion sensor example.
    0_1495647860667_pro mini nano RS485_bb.png
    However the results are still the same, Gateway starts without problem, and node is looking for gateway, no presentation, nor sending any data.

    So I was searching through forums and sites day and night, I found some examples of test sketches from altasoft library. With this setup I flashed both and I got working communication, it was sender repeater node so when I wrote something to console it looped me back from another end. Actually I had DE pins connected to D10 as I found it in description.

    When I tried to flash mysensors GW and Node again, can't get any data flowing. I tried to switch DE pins on both D10 and D2 pins as in sketch, I tried to change baudrate, switch roles with GW and Node, twist RX and TX pins, all combinations, nothing.

    Do you guys have any clue what am I doing wrong with vanilla setup like this ?

    Thanks

    EDIT:
    God, why is it , every time I am going to ask about some problem, moments later find solution.
    Wish I found this tread earlier https://forum.mysensors.org/topic/5495/rs485-on-nano/12
    So for future references, With use of RS485 wired network, there must be static node ID set for every node and for gateway too.
    P.S. We should update the documentation, and maybe add wiring picture to the https://www.mysensors.org/build/rs485


  • Mod

    NODE ID is mandatory for all nodes in mysensors anyway, probably it was not added in the example code to avoid creating conflicts with existing nodes


  • Mod

    @gohan said in RS485 Gateway on Raspberry Pi:

    NODE ID is mandatory for all nodes in mysensors anyway

    That's actually incorrect. Many people, including me, use the default AUTO, where a node ID is assigned by the controller. This is documented in the getting started guide.

    But yes, if you don't have a controller there is no-one to assign auto IDs. Maybe the error message should mention something like "Is your controller up and running?"? A long explanatory message would increase the library's flash space requirements though.


  • Mod

    I didn't expressed it correctly: what I meant that the actual NODE ID is mandatory not the #DEFINE



  • Hi,
    @admins
    an advice about the MY_NODE_ID in the how to for the rs485 section would be helpful. I think, there are at least the double of the people trying for hours until they give up. Only some of them take the efforts to register and login here to get useful information...
    By kduino


Log in to reply
 

Suggested Topics

  • 1
  • 1
  • 10
  • 5
  • 2
  • 3

60
Online

11.4k
Users

11.1k
Topics

112.7k
Posts