I¡¯d suggest the C/MRI protocol. See
There¡¯s Arduino code available on the web in several places:
and even a Yahoo group that can help:
Bob
On Jun 16, 2017, at 4:51 PM, eallaud@... [jmriusers] <jmriusers@...> wrote:
Hi all,
I have a few sketches for my arduino to manage turnouts and sensors (each "sensor" can also be an output to control something). I would like to be able to hook that up to JMRI.
The address scheme I use is one node address (0->254) plus a subaddress (1->127) ; the arduinos are on a bus like network (rs485 probably). Each subaddress represents a turnout or a sensor; the whole setup (address+subaddres<->turnout/sensor correspondance) is saved in eeprom.
For now I am using messages that look like DCC++'s as that was my inspiration. This can be rearranged if needed.
What I need: address/subaddress to identify the turnout/sensor, a way to send commands (read sensor, write to sensor, throw turnout) and be able to receive async answer (mostly for turnouts as they are moved using servos moving slowly). Also all input sensors are checked periodically and in case some have changed, it is signalled.
I hope this is enough information to guide me to a suitable jmri supported protocol.
TIA
Emmanuel
--
Bob Jacobsen
rgj1927@...