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. Controllers
  3. Mozilla WebThings Gateway
  4. Serial Baud Rate for Adapter

Serial Baud Rate for Adapter

Scheduled Pinned Locked Moved Mozilla WebThings Gateway
serial gatewayserial communication
6 Posts 2 Posters 137 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.
  • W Offline
    W Offline
    Westie
    wrote on last edited by
    #1

    Hi, Anyway of overriding the Baud Rate for the adapter.
    It seems to be 'hardcoded' at 15200 - I'd like to modify to suit the performance of the UART on the Clone Nano
    self.GATEWAY = mysensors.SerialGateway(
    dev_port, baud=15200,
    #timeout=1.0,
    #reconnect_timeout=10.0,
    event_callback=self.mysensors_message, persistence=True,
    persistence_file=self.persistence_file_path, protocol_version='2.2')

    W 1 Reply Last reply
    0
    • W Westie

      Hi, Anyway of overriding the Baud Rate for the adapter.
      It seems to be 'hardcoded' at 15200 - I'd like to modify to suit the performance of the UART on the Clone Nano
      self.GATEWAY = mysensors.SerialGateway(
      dev_port, baud=15200,
      #timeout=1.0,
      #reconnect_timeout=10.0,
      event_callback=self.mysensors_message, persistence=True,
      persistence_file=self.persistence_file_path, protocol_version='2.2')

      W Offline
      W Offline
      Westie
      wrote on last edited by
      #2

      @Westie This Serial Adapter has been a total frustration. Without the control on port speed I am forced to manual change the python code which I dont do very well and am not interested in pursuing - sorry nice effort but gets my no vote. I dont know what controller you test on but it is impossible to get any of the ones I have tried to stick on 115200 which is hard coded into the adapter.

      Has anyone had any success in change the port speed that the adapter uses - seems to be stuck on 57600 - I have tried both FTDI and CH340 on Linux Containers using Nano and Pro Mini 5v 16 Mhz.

      1 Reply Last reply
      0
      • fritsF Offline
        fritsF Offline
        frits
        wrote on last edited by
        #3

        the USB to UART adapter uses the baud rate it's host requests. I have a lot of CH340 here which work perfectly @115200.

        @Westie said in Serial Baud Rate for Adapter:

        dev_port, baud=15200,

        If this line is really in your code, please change it to baud=115200 :-)

        The baud rate MySensors uses can be set with

        #define MY_BAUD_RATE 9600
        

        see https://www.mysensors.org/download/sensor_api_20

        1 Reply Last reply
        0
        • W Offline
          W Offline
          Westie
          wrote on last edited by
          #4

          Thanks frits ... my issue is trying to get the arduino or ftdi adapter to talk at 115200 -
          Either the FTDI or arduino promini gateway is talking at 57600 so the webthings mysensors adapter is hardcoded at 115200.

          I have set #define MY_BAUD_RATE 115200 in the gateway with no joy, I even tried a Seral.begin(115200) in setup(). So Im thinking my FTDI is fixed on 57600 no matter what I send to it

          My attempts at customising the python code in the adapter to change to 57600 has been tricky due to the clash of pyserial and serial modules in a webthings docker image etc etc....

          Currently running a pro mini as the gateway as the knockoff nano CH340 couldnt achieve better comms better than 19200.. I have ordered another nano perhaps the hardware will resolve it all - fingers crossed.

          Mysensors is a great alternative to the commercial networks or even LoraWan as the data stays where it should.

          1 Reply Last reply
          1
          • W Offline
            W Offline
            Westie
            wrote on last edited by
            #5

            The kind people at Candle have updated the adapter to include a parameter for baud rate. V1.2.0. It should automatically update :). I'll test and report back.

            W 1 Reply Last reply
            1
            • W Westie

              The kind people at Candle have updated the adapter to include a parameter for baud rate. V1.2.0. It should automatically update :). I'll test and report back.

              W Offline
              W Offline
              Westie
              wrote on last edited by
              #6

              @Westie Testing using a docker image of the gateway... Update looking good - I have dropped the baud rate down to something more compatible with my clone nano.
              I found a useful tool to check the incoming serial from a Python point of view (not running the adapter when I do it) - python3 -m serial.tools.miniterm --parity N /dev/ttyUSB0 19200. This prints out the messages from the Serial Gateway in nice text when the speed is correct.

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


              14

              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