serial gateway: !TSM:INIT:TSP FAIL



  • Hi,

    I am trying to use a rfm69hw chip with my raspberry pi 4. For that I wired the chip to an arduino pro mini and flashed the serial gateway sketch. The sketch initializes fine when I check the arduino IDE serial monitor.

    When I then hook the pro mini up to the pi (using USB) I can see that a tty device is being created (ttyUSB0).

    I can also read from the device using python:

    pi@raspberrypi:~/monitorgpio $ python3 testscript.py 
    ----
    b''
    b'0;255;3;0;9;0 MCO:BGN:INIT GW,CP=RPNGA---,FQ=8,REL=0,VER=2.4.0-alpha\n'
    b'0;255;3;0;9;18 TSM:INIT\n'
    b'0;255;3;0;9;24 TSF:WUR:MS=0\n'
    b''
    b'0;255;3;0;9;1284 TSM:INIT:TSP OK\n'
    b'0;255;3;0;9;1294 TSM:INIT:GW MODE\n'
    b'0;255;3;0;9;1302 TSM:READY:ID=0,PAR=0,DIS=0\n'
    b'0;255;3;0;9;1314 MCO:REG:NOT NEEDED\n'
    b'0;255;3;0;14;Gateway startup complete.\n'
    b'0;255;0;0;18;2.4.0-alpha\n'
    b'0;255;3;0;9;1327 MCO:BGN:STP\n'
    b'0;255;3;0;9;1349 MCO:BGN:INIT OK,TSP=1\n'
    b'0;255;3;0;9;1359 TSM:READY:NWD REQ\n'
    b''
    b''
    b'0;255;3;0;9;3371 ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:\n'
    b''
    b''
    b''
    ^CTraceback (most recent call last):
      File "testscript.py", line 10, in <module>
        output = ser.readline()
      File "/home/pi/.local/lib/python3.7/site-packages/serial/serialposix.py", line 483, in read
        ready, _, _ = select.select([self.fd, self.pipe_abort_read_r], [], [], timeout.time_left())
    KeyboardInterrupt
    

    When I then start the mysensors gateway I get this output though:

    pi@raspberrypi:~/MySensorsDev/MySensors $ sudo ./bin/mysgw 
    Jan 30 23:02:12 INFO  Starting gateway...
    Jan 30 23:02:12 INFO  Protocol version - 2.4.0-alpha
    Jan 30 23:02:12 DEBUG Serial port /dev/ttyUSB0 (38400 baud) created
    Jan 30 23:02:12 DEBUG MCO:BGN:INIT GW,CP=RPNGL---,FQ=NA,REL=0,VER=2.4.0-alpha
    Jan 30 23:02:12 DEBUG TSF:LRT:OK
    Jan 30 23:02:12 DEBUG TSM:INIT
    Jan 30 23:02:12 DEBUG TSF:WUR:MS=0
    Jan 30 23:02:12 DEBUG !TSM:INIT:TSP FAIL
    Jan 30 23:02:12 DEBUG TSM:FAIL:CNT=1
    Jan 30 23:02:12 DEBUG TSM:FAIL:DIS
    Jan 30 23:02:12 DEBUG TSF:TDI:TSL
    
    

    What am I doing wrong?

    I configured the gw like this:

    ./configure  --my-transport=rfm69 --my-rfm69-frequency=868 --my-is-rfm69hw --my-gateway=serial --my-serial-baudrate=38400 --my-serial-is-pty --my-serial-groupname=tty --my-serial-port=/dev/ttyUSB0
    

    Side note: After starting the gateway I can see that /dev/ttyUSB0 disappears and only reappears if I unplug and replug the arduino.

    Any help is greatly appreciated since this was my backup plan to get a gateway on the pi working (directly connecting my rfm69hw chip to the pi doesn't work/yields low range).


  • Mod

    @kiesel mysgw and the pro mini are completely redundant. If you plan to use the pro mini, do not use mysgw. If you plan to use mysgw, do not use the pro mini. The only case the two might be used together is if you want two gateways (which then must use different radio channels)

    mysgw can be used only if the radio is wired directly to the raspberry pi's gpio pins.



  • @mfalkvidd

    Oh, I completely misunderstood then! I thought mysgw would interpret the serial input and then make it accessible to the controller.

    Thanks för clearing that up, I will give it a shot tomorrow.


Log in to reply
 

Suggested Topics

  • 3
  • 4
  • 2
  • 24
  • 10
  • 2

26
Online

11.2k
Users

11.1k
Topics

112.5k
Posts