Remote communication options

I've been adding support for remotely controlling very small Arduino compatible devices over USB via StandardFirmata using firmata4j. This is working well however has a number of issues:

  1. As far as I know, Firmata doesn't support SPI (there is a proposal to include support)
  2. firmata4j only supports serial connections
To resolve option 1 I am looking into developing my own remote communication protocols using various combinations of JSON and Google Protocol Buffers over MQTT, HTTP and WebSockets. This is currently work in progress, however, GPIO and SPI are both working - I've tested GPIO output as well as controlling an SSD1331 colour OLED display over SPI (I've not tested I2C yet). Performance was surprisingly good. I need to work on a protocol for discovering board capabilities remotely that works for all Single Board Computers as well as Arduino compatible devices.

I'm not sure how to include Protocol Buffer support on Arduino devices as there are currently no protobuf libraries in the Arduino IDE Library Manager. There is the nanopb library - it would be great if someone could tell me how to include this in my Arduino sketch! JSON support was really easy using ArduinoJson.

For option 2 I have been looking into developing my own Firmata library that uses Netty thereby abstracting away from actual communication protocols. Netty itself doesn't support serial communication, however, I need to see if this netty-jssc library works.

Other notes: my HTTP remote library doesn't support callbacks - I need to investigate Server-Sent Events.

There are 2 options for Particle WiFi devices:

  1. VoodooSpark firmware
  2. Firmata for Spark firmware
I've added support for VoodooSpark however I've yet to try Firmata on my Particle Photon. Unfortunately, just like StandardFirmata VoodooSpark also doesn't support SPI.

Please leave a comment if you have any suggestions!

Comments

  1. Hi Mat,

    I just released new version of firmata4j. It abstracts communication transport out and adds support for network connection.

    Could you, please, look at that and maybe put forward some thoughts on how to improve it even more (using netty for example).

    Oleg

    ReplyDelete
  2. Hi Oleg,
    Sounds great, I'll take a look this weekend. In case you didn't see it I went ahead and created a socket based implementation in diozero, mainly to adhere to my RemoteProtocolInterface. Package:
    https://github.com/mattjlewis/diozero/tree/master/diozero-provider-remote/src/main/java/com/diozero/firmata
    I didn't use netty for this (have used it a lot elsewhere in diozero) - it gets in the way sometimes.
    I based my Firmata adapter implementation on standard Java InputStream / OutputStream classes with the idea that it would work with outher protocols. It's a shame that the jssc library doesn't use standard java.io classes.

    Matt

    ReplyDelete

Post a Comment

Popular posts from this blog

Java control of WS2811 / WS2812 LED Strips (aka NeoPixels)

Adding a custom library to Arduino IDE