Software Interface

The interface spec for this module is available, just ask and I’ll post up specifics. I am particularly interested in RaspberryPi3W experiments in Python, let me know what you need. The latest version of hardware now allows you to interface to the board using a simple TTL level serial cable at 9600 baud. This means you could control this board directly from many sorts of computer boards and setups.

I am also open to sharing the firmware of the board if you have a specific need. Everything is programmed in Atmel Studio 7 in straight C. The DCC functionality and servo timers are all in libraries and can be linked into any executable.

Here is a quick synopsis of the functionality:

While the Android App gives you nice buttons and sliders to control things, the actual bluetooth receiver module responds to a small set of discrete serial messages. There is a message to set the Servos, a message to send the DCC Function xx and a message to set CV xxx to xx, etc. I am a big fan of very simple. You will need a bit more info to work with these, please contact me with any questions if you feel like experimenting.

NOTE: In the latest hardware design, the new boards feature a direct serial port input. If you see ‘serial’ on your board, to the right of the bluetooth device (it’s a three pin servo type connector) you can send serial commands directly to the board, bypassing the bluetooth network chip. This is only pertinate if you want to experiment with the board, for normal operations, it’s not used.

Here are the messages the board currently responds to as of firmware release 1.04

#define SERVOPACKET 10
#define OUTPUTPACKET 11
#define LIMITPACKET 12
#define DCCTHROTTLEPACKET 13
#define DCCFUNCTIONPACKET 14
#define DCCEXTENDEDFUNCTIONPACKET 15
#define DCCCVPACKET 16
#define DIRECTION 17
#define ESTOP 18
#define COUPLER1PACKET 19
#define COUPLER2PACKET 20
#define SERVOTHROTTLEPACKET 21
#define SETBASEPACKET 22
#define RESETWATCHDOG 23
#define SETESCMODE 24
#define SETTIMEOUT 25
#define SETOUTPUTSMODE 26
#define SETWATCHDOGMODE 27
#define SETSERVODEFAULT 28
#define SETSERVOREVERSE 29