Serial Gateway Issue with Node-Red



  • I am using a serial gateway connected to node-red. I am trying to parse the serial output but having problems. It appears that the node-red messages may not be "splitting" correctly (or mysensors is not outputting them correctly). At first you see a bunch of what I think are node ID requests. This seems strange to me because I am setting the node and child IDs in my sketch (Using version 1.5 of mysensors). I have two nodes:

    • node=50 (arduino UNO)
      -- child=0(DS18B20)
      -- child=20 (DHT22 Humidity)
      -- child=21 (DHT22 Temperature)
    • node=30 (sensebender)
      -- child=1 (Temperature)
      -- child=2 (Humidity)
      -- child=130 (Voltage)

    Looking at the serial output in node-red

    --first message

    "0;0;3;0;9;read: 50-50-0 s=30,c=1,t=23,pt=3,l=2,sg=0:45\n50;30;1;0;23;45\n"
    

    --next message

     "0;0;3;0;9;read: 50-50-255 s=255,c=3,t=7,pt=0,l=0,sg=0:\n"
    

    --next message

    "0;0;3;0;9;send: 0-0-50-50 s=255,c=3,t=8,pt=1,l=1,sg=0,st=fail:0\n"
    

    --next message

    "0;0;3;0;9;read: 50-50-0 s=30,c=1,t=23,pt=3,l=2,sg=0:34\n50;30;1;0;23;34\n"
    

    --next message

    "0;0;3;0;9;read: 50-50-0 s=30,c=1,t=23,pt=3,l=2,sg=0:36\n50;30;1;0;23;36\n"
    

    --next message

    "0;0;3;0;9;read: 50-50-0 s=30,c=1,t=23,pt=3,l=2,sg=0:43\n50;30;1;0;23;43\n"
    

    --next message

    "0;0;3;0;9;read: 30-30-0 s=1,c=1,t=0,pt=7,l=5,sg=0:24.4\n30;1;1;0;0;24.4\n0;0;3;0;9;read: 30-30-0 s=2,c=1,"
    

    --next message

    t=1,pt=2,l=2,sg=0:69\n30;2;1;0;1;69\n"
    

    --next message

    You can see that the last couple ,messages did not appear to split correctly. Is this a problem with something I am doing or node-red or mysensors?

    Has anybody had this trouble?



  • @bpair
    I think I found the issue with my serial port configuration:
    baud rate: 115200
    data bits: 8
    parity: none
    stop bits: 1
    split input: after a timeout of 10ms

    I have since changed the "split input" to split on "\n" chracter


  • Admin

    @bpair
    Yes, split by \n, I also tried the timeout option as a start, but changed to \n..

    I've made a couple of plugins for Node-Red, that could be used to parse / generate messages to mysensors serial gw.

    (Links other places in the forum)


Log in to reply
 

Suggested Topics

112
Online

10.6k
Users

10.8k
Topics

111.1k
Posts