Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. serial gateway: !TSM:INIT:TSP FAIL

serial gateway: !TSM:INIT:TSP FAIL

Scheduled Pinned Locked Moved Troubleshooting
3 Posts 2 Posters 49 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kiesel
    wrote on last edited by
    #1

    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).

    mfalkviddM 1 Reply Last reply
    0
    • K kiesel

      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).

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by mfalkvidd
      #2

      @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.

      K 1 Reply Last reply
      1
      • mfalkviddM mfalkvidd

        @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.

        K Offline
        K Offline
        kiesel
        wrote on last edited by
        #3

        @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.

        1 Reply Last reply
        1
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        20

        Online

        11.7k

        Users

        11.2k

        Topics

        113.1k

        Posts


        Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • MySensors
        • OpenHardware.io
        • Categories
        • Recent
        • Tags
        • Popular