Hello Mates !
This is a quick preview of a virtual Python Arduino.  There has been a lot of work done recently (big refactoring) in the Serial Service area.  Previously the Arduino Service handled its own serial communication (bad idea) .. Now all of that is ripped out and thrown away.  Now any service which needs to use serial communication uses the new feature rich Serial Service ! 

The Serial service can do all sorts of new things.  Like run serial data over TCP/IP sockets, create and connect to virtual serial ports - all very easy - all very extensible.  It now has a concept of "Codecs".  Codecs allow encoding and decoding of binary data.

Referring to first picture : 1. - is the codec selector .. currently I have 4 codecs .. they are 3 character decimal where you can see each byte value wizz by from 000 to 255.  Then there is the common 2 character 00 - FF .. also ascii text and now MRLComm Arduino Messages ! Like publishVersion/21

Serial now displays accurate RX byte count and also TX count - there is also line speed which will be very nice (although at the moment its not being sent to the gui)

Line Speed is how fast data is moving on the serial line - I measured my Mega and it was showing 48K which is probably pretty accurate when I was streaming analog data off of it.

The codec framework is very extensible - and will allow us to create codecs for other serial communication - perhaps for Lidar, Wii and other communication to different processors.

It also allows us to "Mock" an Arduino - and its functionality.

With this small python script I have created a virtual Arduino which decodes the incoming bytes sent by the MRL Arduino service into easy to read messages.  Currently, it looks for a getVersion message and send back a response.  This is pretty trivial, but if you think about it - with the new Serial service you can easily capture and information on a real system and then have a Virtual Arduino script "play back" the data.

For example capture data from a real analog pin, then save that as a file (tweak it possibly) and have the Virtual Arduino open the file and send the data when it gets a analogPollStart/15 (poll the analog 15 pin) command.  Lots of fun stuff ahead !

Gareth

9 years ago

Nice one Greg.... It was well worth the refactory....

....wooohooo transparent pipelines to see the data ...

mehtaatur

9 years ago

This is very exciting Grog

Virtual Arduino... I guess this will make testing and debugging also very easy 

Ya - it should .. I've been working for a while on self-testing to make MRL much more robust.. but in the process some nice tools have come out of it.  Like a serial line viewer and capture tool.