Node red won't read serial gateway



  • I am using two moteinos (RFM69CHW), one as a serial gateway and the other as a DHT node. The serial gateway successfully reads the DHT node's broadcast just fine on my laptop - I can see the temp and humidity scroll by in the serial monitor.

    But when I move the serial gateway to my raspberry pi, on which run mosquitto and node red, the serial gateway seems to init and then dies. Here is the debug

    7/5/2017, 5:52:39 PMnode: Serial to MQTT debug
    msg : Object
    { payload: "0;255;3;0;9;MCO:BGN:INIT GW,CP…", _msgid: "fa7a7cfa.9f8e3" }
    7/5/2017, 5:52:40 PMnode: Serial to MQTT debug
    msg : Object
    { payload: "0;255;3;0;9;TSM:INIT↵", _msgid: "83392787.d54478" }
    7/5/2017, 5:52:40 PMnode: Serial to MQTT debug
    msg : Object
    { payload: "0;255;3;0;9;TSF:WUR:MS=0↵", _msgid: "bcc29997.3e1ed8" }
    7/5/2017, 5:52:40 PMnode: Serial to MQTT debug
    msg : Object
    { payload: "0;255;3;0;9;TSM:INIT:TSP OK↵", _msgid: "1f8d6154.08a47f" }
    7/5/2017, 5:52:40 PMnode: Serial to MQTT debug
    msg : Object
    { payload: "0;255;3;0;9;TSM:INIT:GW MODE↵", _msgid: "5a2c462e.09d748" }
    7/5/2017, 5:52:40 PMnode: Serial to MQTT debug
    msg : Object
    { payload: "0;255;3;0;9;TSM:READY:ID=0,PAR…", _msgid: "67f5b4ad.dd813c" }
    7/5/2017, 5:52:40 PMnode: Serial to MQTT debug
    msg : Object
    { payload: "0;255;3;0;9;MCO:REG:NOT NEEDED…", _msgid: "7f7e915f.d8a83" }
    7/5/2017, 5:52:40 PMnode: Serial to MQTT debug
    msg : Object
    { payload: "0;255;3;0;14;Gateway startup c…", _msgid: "e7e4a656.416e28" }
    7/5/2017, 5:52:40 PMnode: Serial to MQTT debug
    msg : Object
    { payload: "0;255;0;0;18;2.1.1↵", _msgid: "28518b77.2d31c4" }
    7/5/2017, 5:52:40 PMnode: Serial to MQTT debug
    msg : Object
    { payload: "0;255;3;0;9;MCO:BGN:STP↵", _msgid: "b0188d98.b6cee" }
    7/5/2017, 5:52:40 PMnode: Serial to MQTT debug
    msg : Object
    { payload: "0;255;3;0;9;MCO:BGN:INIT OK,TS…", _msgid: "e3fccbc5.3f0cd8" }

    Looks like my parameters for the serial node work ? - and I have a green light saying connected.

    Watching the dht node in serial monitor, it looks like it no longer connects with the gateway:

    0 MCO:BGN:INIT NODE,CP=RRNNA--,VER=2.1.1
    3 TSM:INIT
    4 TSF:WUR:MS=0
    6 TSM:INIT:TSP OK
    8 TSF:SID:OK,ID=254
    10 TSM:FPAR
    142 TSF:MSG:SEND,254-254-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    2149 !TSM:FPAR:NO REPLY
    2151 TSM:FPAR
    2282 TSF:MSG:SEND,254-254-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    4289 !TSM:FPAR:NO REPLY
    4291 TSM:FPAR
    4421 TSF:MSG:SEND,254-254-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    6428 !TSM:FPAR:NO REPLY
    6430 TSM:FPAR
    6560 TSF:MSG:SEND,254-254-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    8567 !TSM:FPAR:FAIL
    8568 TSM:FAIL:CNT=1
    8570 TSM:FAIL:PDT

    But when I reconnect the gateway to my laptop, it works fine again.

    Is this a power issue at the pi usb port? Workaround?

    Any other thoughts /similar experiences????

    How to troubleshoot?

    Thanks in advance.


  • Admin

    @trubel

    Do you have the raspberry pi at the same place as your laptop? In other words, is the gateway relocated when connected to the rpi, compared to when you have it at your laptop?

    This seems like RF link issues.. So my guess is that the node can not see the gateway, whenever it is connected to the rpi..

    Try sending a I_HEARTBEAT_REQUEST to the gateway from node-red (create a node that injects a message like the following:

    0;255;3;0;18;
    

    The gateway should respond with I_HEARTBEAT_RESPONSE, like the following package:

    0;255;3;0;22;
    


  • I have since been diverted onto other troubleshooting but I no believe this was a serial port permissions issue.

    When I used this command ls -l /dev/ttyUSB*

    I could see that only the “root” user and the “dialout” group have proper permissions to use the serial port, so I added pi to the dialout group.

    Thanks for your help


Log in to reply
 

Suggested Topics

1
Online

11.2k
Users

11.1k
Topics

112.5k
Posts