Pages

Last edited by 97cweb at 2025-06-18 17:44:00.204774

github

Jump to Setup

What is Beeton Decoders

Beeton Decoders is my answer to the question why. Why must model trains run on 1970s technology? Why must it cost so much for a locked down system that has limited processing capabilities? Why not something simple, easy to expand, and easy to implement from a maker's perspective?

Beeton decoders is designed to take the challenge of dense network communication and pull it out of the tracks and into the air. Utilizing Open thread's Constrained Application (CoAp) as a foundation, Beeton simplifies communication, whilst allowing DC trains to run on the same layout, and not requiring AC encoded signals in the rails.

Beeton decoders runs with 2 layers over top of CoAp, a transport layer called LightThread, and Beeton itself, which is half of an application layer.

LightThread

LightThread directly sets up the mesh network required for Beeton, while showing the state the system is in using an RGB LED. This provides direct feedback on the status of the connection without needing serial communication to each device. LightThread manages the setup, and handles the transport of packets including acknowledgements, reliability, and keep alive signals. All this is done automatically, with optional content set by basic flags in the send method.

Beeton

The core of the system, Beeton is actually smaller than LightThread. Beeton's entire goal is to provide a template packet structure and a callback function hook to enable users to write whatever they want. The packet structure from the user's perspective contains the following information, all in binary to reduce packet size:

Thing

Thing bundles identical objects together, so they have the same methods to interact with. Think of it as assigning a class, like light bulb. There can be many light bulbs, but they all turn on and off.

ID

The specific identifier for a specific thing. This is light bulb 2, vs light bulb 1. Which do you want to control? This one.

Action

What do you want to do? Turn on, turn off, toggle? Set?etc.

Action Length

How many bytes the action takes, 0 or more bytes. Turn on, off and toggle would take 0 extra bytes, but to set would require a byte to pass the boolean value of on or off.

Payload

The content passed to the action. For the light bulb, it would be 1 byte representing on or off.

Setup

Hardware Requirements

Beeton decoders require an esp32-c6 module connected to an SD card. It does not matter whether it is microSD or regular. It also requires a button on GPIO 9 to send the connect and pair requests as well as an RGB LED to see states attached to the RGB_BUILT_IN pin. I/O and other hardware features, if any are up to the user to add and expand.

Software Requirements

Beeton was designed to be simple, thus it was designed, built and tested in Arduino. No fancy editor is required.

System Setup

Flash the Beeton example to both the leader and joiner, ensuring the SD card is connected. When the led is flashing red, initial setup has been completed. Pull the SD cards out and connect to a computer. Inside each SD card, 2 files and a folder shall be there. * network.json * beeton.json * cache

Open the network.json file and edit the role for one of them to be "leader" instead of "joiner". Editing the network prefix, channel and pan ID are outside the scope of basic setup.

Eject the SD cards and insert them back into their respective esp32 devices and reapply power. the joiner should immediately turn blue while the leader will flash yellow for about 30 seconds and then turn teal.

WPS Style Pairing

Once the devices are in their initial state, press the button on both the leader and joiner. Both boards will flash lights for a minute or so. When the joiner turns green, it has connected to the leader and save it's info.