Topics

New protocol #arduino


emmanuel ALLAUD
 

Hi all,
I have developped an arduino sketch that enables it to control turnouts using servos (you can change the angles for thrown/closed), digital outputs, digital inputs (sensors). All of this can be set up using the protocol itself and saved to eeprom.
I would like to hook this up to jmri; I already had a look at cmri implementation so I have an idea (meaning quite a lot of work ;-).
But do you think it is possible to have jmri "talk" to the arduino (using the protocol you can find on the github https://github.com/manu-fwi/RR-duino) two ways: one way from the arduino to get the eeprom content and back to the arduino to change the settings if the user wants to do it.
The kind of settings I am talking about: which arduino pin is wired to a servo, a relay (to change turnout polarity), to a sensor, a digital ouput (pulsed or not), for a turnout what angles are to be used to thorw/close...
Thanks,
Manu


Bob Jacobsen
 

It’s certainly possible. Whether it’s worth it or not depends on how many people will use it.

As a stand in, you could perhaps support it via Jython scripting instead of building it into Java code. There are a couple existing examples of this:

https://www.jmri.org/jython/serialinput/

Bob

On Jul 13, 2020, at 9:57 AM, emmanuel ALLAUD <eallaud@...> wrote:

Hi all,
I have developped an arduino sketch that enables it to control turnouts using servos (you can change the angles for thrown/closed), digital outputs, digital inputs (sensors). All of this can be set up using the protocol itself and saved to eeprom.
I would like to hook this up to jmri; I already had a look at cmri implementation so I have an idea (meaning quite a lot of work ;-).
But do you think it is possible to have jmri "talk" to the arduino (using the protocol you can find on the github https://github.com/manu-fwi/RR-duino) two ways: one way from the arduino to get the eeprom content and back to the arduino to change the settings if the user wants to do it.
The kind of settings I am talking about: which arduino pin is wired to a servo, a relay (to change turnout polarity), to a sensor, a digital ouput (pulsed or not), for a turnout what angles are to be used to thorw/close...
Thanks,
Manu

Bob Jacobsen
@BobJacobsen


emmanuel ALLAUD
 

OK good idea as I already worked a lot in python.

Thanks,

Manu

Le 13/07/20 à 21:19, Bob Jacobsen a écrit :
It’s certainly possible. Whether it’s worth it or not depends on how many people will use it.

As a stand in, you could perhaps support it via Jython scripting instead of building it into Java code. There are a couple existing examples of this:

https://www.jmri.org/jython/serialinput/

Bob

On Jul 13, 2020, at 9:57 AM, emmanuel ALLAUD <eallaud@...> wrote:

Hi all,
I have developped an arduino sketch that enables it to control turnouts using servos (you can change the angles for thrown/closed), digital outputs, digital inputs (sensors). All of this can be set up using the protocol itself and saved to eeprom.
I would like to hook this up to jmri; I already had a look at cmri implementation so I have an idea (meaning quite a lot of work ;-).
But do you think it is possible to have jmri "talk" to the arduino (using the protocol you can find on the github https://github.com/manu-fwi/RR-duino) two ways: one way from the arduino to get the eeprom content and back to the arduino to change the settings if the user wants to do it.
The kind of settings I am talking about: which arduino pin is wired to a servo, a relay (to change turnout polarity), to a sensor, a digital ouput (pulsed or not), for a turnout what angles are to be used to thorw/close...
Thanks,
Manu

Bob Jacobsen
@BobJacobsen