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. Development
  3. Implementing controller for Serial Gateway

Implementing controller for Serial Gateway

Scheduled Pinned Locked Moved Development
1 Posts 1 Posters 569 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.
  • M Offline
    M Offline
    Marcell Kovacs
    wrote on last edited by
    #1

    Hi,
    I started to develop a simple controller in Java, implementing node ID assignment and the most basic stuff to let mysensors work. The sensor data is then mirrored to MQTT, similar to the way Openhab 1.6 tutorial shows.

    With MySensors 1.6 and 2.0, I had about the same problem: flow control between controller and gateway.

    Now I have a system having 3 threads:

    • sending
    • receiving
    • listening for ACK packets, resending messages after a timeout

    I have 16 relays controlling my lights in my home. If I send a command to each of them too fast, some messages gets lost. (I'm connecting over USB-serial, reproduced on Windows 10 and Raspberry Pi).

    It actually turned out, if I wait about 350 milliseconds after sending a command, the system gets pretty stable. But... slow as well.
    Can you please advice on how to properly implement flow control on a serial gateway? I know this should have a simple solution and I must be doing something wrong : )

    About buffering from Java side, I'm flushing my output stream be deterministic when waiting for that 350 ms.

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


    24

    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