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. MySensors Serial Gateway minimal example to send data

MySensors Serial Gateway minimal example to send data

Scheduled Pinned Locked Moved Troubleshooting
serialgatewayserial protocol
9 Posts 3 Posters 6.2k Views 1 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.
  • D Offline
    D Offline
    Dirk_H
    Contest Winner
    wrote on last edited by Dirk_H
    #1

    Hello everybody,

    I'm just trying the MySensors protocol stack. I thought the easiest way to get it work and understand would be to have to nodes: one serial gateway and one dimmer.

    I then thought i could connect the serial gateway to my favorite terminal program and see what the nodes are talking, I also thought that i should be able to send commands.

    So I set everything up and I get the incoming messages on the serial terminal program:
    0;0;3;0;14;Gateway startup complete.
    0;0;3;0;9;read: 3-3-0 s=255,c=0,t=17,pt=0,l=5:1.4.1
    3;255;0;0;17;1.4.1
    0;0;3;0;9;read: 3-3-0 s=255,c=3,t=6,pt=1,l=1:0
    3;255;3;0;6;0
    0;0;3;0;9;read: 3-3-0 s=0,c=0,t=4,pt=0,l=5:1.4.1
    3;0;0;0;4;1.4.1
    0;0;3;0;9;read: 3-3-0 s=255,c=3,t=11,pt=0,l=11:DimmableLED
    3;255;3;0;11;DimmableLED
    0;0;3;0;9;read: 3-3-0 s=255,c=3,t=12,pt=0,l=3:1.1
    3;255;3;0;12;1.1
    0;0;3;0;9;read: 3-3-0 s=0,c=2,t=3,pt=0,l=0:
    3;0;2;0;3;

    This looks quite good to me. However now I want to send something so I type
    3;0;1;0;3;50;\n
    (of cause the \n is sent by the terminal program, i.e. it is the linefeed)

    I expect this means send to node 3, childid 0, set command (1), no ack (0), V_dimmer type (3); value : 50

    Then the DImmer node also seems to receive something because it says
    read: 0-0-3 s=0,c=0,t=0,pt=0,l=1:\n

    However I cannot see any changes in the brightness of the conneced LED. I also dont understand why:
    3;0;1;0;3;99; does not work??!

    I think I have something clearly missunderstood about any of the concepts? I hope you can help me.

    Thanks
    Dirk_H

    1 Reply Last reply
    0
    • hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #2

      @Dirk_H said:

      3;0;1;0;3;50;\n

      What happens if you send (without the last semicolon):
      3;0;1;0;4;50\n

      But the received debug message looks strange though.... not at all right.

      1 Reply Last reply
      0
      • ch3b7C Offline
        ch3b7C Offline
        ch3b7
        wrote on last edited by
        #3

        try to send with ack "3;0;1;1;3;5" and see if the node response, im have the same sketch with led and only with value more than 70% the led turn on other value still off

        1 Reply Last reply
        0
        • D Offline
          D Offline
          Dirk_H
          Contest Winner
          wrote on last edited by
          #4

          Ok I tried to send the suggested messages:

          3;0;1;0;4;50 (without semicolon) : nothing happnes, i.e. the gateway does not even try to send (tx led also not blinking, although rx light on ftdi usb->ttl chip is blinking)

          3;0;1;0;4;50; (with semicolon) returns "0;0;3;0;9;send: 0-0-3-3 s=0,c=0,t=0,pt=0,l=1,st=ok:" on gateway and "read: 0-0-3 s=0,c=0,t=0,pt=0,l=1:\n" on the dimmer node

          Exaclty the same readings for 3;0;1;0;3;50; in case you menat 3 instead of 4 (the latter 3)

          3;0;1;1;3;5 does not work (does not work with semicolon at the end and does not work without it)

          3;0;1;1;3;50; retruns the same messages as the 3;0;1;0;4;50;

          Thanks for your efforts, I really hope that we can find the mistake. However may I assume that in principle it should be possible to send from the serial gateway with a terminal program as I proposed?

          1 Reply Last reply
          0
          • ch3b7C Offline
            ch3b7C Offline
            ch3b7
            wrote on last edited by
            #5

            you try send with the arduino terminal?

            1 Reply Last reply
            0
            • hekH Offline
              hekH Offline
              hek
              Admin
              wrote on last edited by
              #6

              fishy...

              You shouldn't have that last semicolon. It could (potentially) confuse the parser on the gateway.

              Guess you've tried the different newline modes available in serial monitor.

              Your radio communication seems to work anyway. Always something ;)

              1 Reply Last reply
              0
              • D Offline
                D Offline
                Dirk_H
                Contest Winner
                wrote on last edited by
                #7

                Hmm ok, without the last semicolon nothing works - it does not try to send.
                I forgot to mention that I use a Arduino mini pro 3.3V @ 8MHz. Somewhere I read that the gateway should have 16Mhz- but because everything else (i.e. receiving) worked, I thought 8MHz would also work..

                Because of that I tried an Arduino Nano running on 16MHz -> and THIS WORKS. :smile:

                If one changes the MySensors.h Baudrate to e.g. 38400 than everything also works fine with the 8MHz.

                However I think it is a very bad behaviour that receive works 100% fine but send not, evil computers :grinning:

                BTW, can I also change the lib files when working in a cloned codebender sketch?

                Thanks for your support!

                1 Reply Last reply
                0
                • hekH Offline
                  hekH Offline
                  hek
                  Admin
                  wrote on last edited by hek
                  #8

                  @Dirk_H said:

                  Interesting findings.

                  BTW, can I also change the lib files when working in a cloned codebender sketch?

                  Not unless you upload/overwrite with your own lib. Probably easier to work locally when doing "advanced" stuff.'

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    Dirk_H
                    Contest Winner
                    wrote on last edited by
                    #9

                    One last thing I'd like to clarify after re-reading my previous post.

                    The correct send string I entered in the terminal is without trailing ";" - like it was supposed before. As mentioned, the problem has been the BAUD rate of 156k with 8MHz crystal..

                    So the correct command which will change the PWM -Dimmer level on node 3 to 50% is:

                    3;0;1;0;3;50\n

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


                    12

                    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