JArduino
JArduino copied to clipboard
Record actions on the Arduino side
It would be great to be able to record a sequence of actions (basic imperative programs, somehow) directly on the Arduino board. Then, we would have an autonomous, yet remotely reconfigurable, Arduino-based solution. The Java side would only send instructions once in a while to start/stop these composite actions and/or upload new "programs". These "programs" could run on demand (e.g. start(x) to explicitely start program x) or periodically every n seconds.
And in addition it would be great if such process can leverage SD Card memory or direct memory depending of the devices (new Arduino has plenty of Ram). To ensure performance such storage must leverage the fact that JArduino messages has fixed size and don't need a parser.
In addition, it would be nice if this feature request, is resolved from the side of ThingML and not JArduino because i think this feature can be generalized to all ThinlML case studies
Well... ThingML already compiles behavior (complex sequences of actions formalized in state machines) to Arduino. The generated firmware is then "static" and cannot easily evolve, except by reflashing the whole thing, causing an outage, or by sending some foreseen configuration messages able to change the behavior (typically by setting a property influencing guards on transition) in a close-world/foreseen fashion.
The sequences of actions to be stored on the Arduino will probably be much simpler, imperative-like programs like:
readTemperature()
sendTemperature()
readLight()
sendLight()
It would be feasible to dynamically monitor the execution of a compiled ThingML state machine for some period of time (e.g. triggered by a start/stop message) by automatically instrumenting it, and logging what happens. Then we could replay, erase, create sequences, etc. ThingML behavior is however not limited to asynchronous fixed-size message passing between components, we have an action language (variable affectation, arithmetic, function calls, control structure, etc) and a rich semantic on states, regions, internal transitions, etc, which is currently compiled on the Arduino. It is not quite clear (yet, not impossible) how all this behavior could be serialized on the Arduino and dynamically "interpreted"...