-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arduino/Firmata support #262
Comments
@krwq has been looking into writing a sample of how to flash an Arduino from a C# app running on an Raspberry Pi, but we're not very far along in the thinking in this space. Happy to have the discussion and get thoughts and ideas here on the topic. |
If your question is whether or not our main library (System.Device.Gpio) would work on an Arduino, mostly the answer for that is no, and the reason is because Arduino can't run any .NET Standard-compatible framework that we are aware of (.NET Core, Mono, etc). That said, as @joshfree points out, we have been looking into driving an Arduino connected to a Raspberry Pi (which can run our library) for different scenarios. |
@joshfree @joperezr thanks for the replies. For clarity, the request isn't about running .NET code directly on the Arduino, but interfacing with the Arduino using the Firmata protocol. This is the same approach Node, Python, Go, and Ruby have gone (with regards to Arduinos) where you run code (dotnet process) on another machine (i.e. not the Arduino, for example your Windows/Mac laptop, or a Raspberry Pi, but ultimately anything with USB/Serial). This basically allows you to develop directly on your developer machine (once again, the dotnet process is running on your machine) but you are able to leverage the IO on the Arduino (GPIOs, I2C, SPI, etc). After some quick searches, here are a few .NET libraries (some Framework and some Standard/Core) that use this approach to different levels.
Regarding the second part of the discussion regarding "backpacks", this is more of a use case where you would flash custom firmware (could be a custom blend of Firmata) on an Arduino and then interface to the Arduino over I2C (or SPI). This is useful when you need realtime (i.e. nanosecond) timing such as required to drive a WS2812/NeoPixel, something you couldn't accomplish directly on a Raspberry Pi (well technically it is supported using some complex direct access.. but the "backpack" is simplier and not directly tied to the Raspberry Pi (ex. flash 1 Arduino, can use on your laptop, Rasberry Pi, Beaglebone, etc). For a Node example of this, take a look at node-pixel and it's firmwares. I'm mostly a hobbiest in IoT, but have created a Node library to communicate with the PN532 NFC chip which is used in a healthcare setting. I've also research/document a lot of my findings on my wiki. Here's ones on Firmata and NeoPixel/WS2812 that might be relevant in this discussion. |
Just came across this, although this might be native Firmata bindings, although looked relevant at first glance and under the MS umbrella) This was also referenced under @shanselman's Setting up Windows 10 for IoT on your Raspberry Pi 2 article. |
@techniq - is my understanding correct that what you propose would be perhaps something like IGpioController implementation which could remotely access arduino ports and perhaps allow more than GPIO? That sounds pretty cool - is this something you'd be interested in picking up? I couldn't find any license info on https://github.com/firmata/protocol not sure if we can use any of that stuff - we should probably create an issue asking them. This also doesn't sound like something really hard to implement with some custom protocol in case Firmata doesn't allow this |
@krwq As much as I'd like to help, I'm pretty buried in work (and hobby projects) at the moment. I'm currently just evaluating dotnet/iot as a replacement for my current (and future) Node IoT projects and saw this as one potential limitation. Your description is correct, the ability to use dotnet/iot (GpioController, etc) to drive an Arduino "remotely", over a USB to TTL cable (as is typically) such as the FTDI Serial (although there are a bunch of different variants of this), but also potentially over BLE (which I've done int he past using Adafruit's Bluefruit LE UART Friend. I think in general Firmata has been traditionally done over Serial (whether USB to Serial, or BLE to Serial) but I think there might be some over I2C now (could be wrong). I've also seen some interesting serial implementations over MQTT, Wifi, etc (some examples here). I believe I've flashed an ESP8266 with Firmata and connective via Wifi, but it's been a while (does open up even more possibilities to control something wirelessly). Currently working on driving a grid of WS2812B and have been using node-pixel with the custom firmware/firmata.. Here's a video showing the web interface running on my laptop, which then pushes to a node server and then via node-pixel to the Arduino (and thus the WS2812 grid). I also have some strips I'm working on using for other effects. Regarding the license, based on the footnote here, it should be public domain.
The |
@techniq this sounds pretty cool and something we might be interested in. We currently have quite bit of work for other things so for now will mark it as up for grabs. I can definitely help if someone else is interested but might not have to time to do it myself at this point. I'll take a deeper look in a spare moment - if this is easy enough I can just do it at one point. |
This is more of a question/discussion than an issue, but I was curious if any prior discussions have taken place on supporting Arduinos using Firmata (similar to how Node does with for example johnny-five) or directly where you use the Arduino more as a peripheral (with access to it's GPIOs, SPI, etc). This approach is also used by gobot (Go) and artoo (Ruby).
Secondly, but tightly related, is the concept of backpacks, or custom firmware flashed on an Arduino/etc that you can then communicate with via I2C (or maybe SPI/Serial). This is an approach when using node-pixel to communicate with WS2812 (NeoPixel) lights without an embedded IC. I saw the NeoPixel stick with integrated IC was recently supported, but it would be nice to support non-embedded IC 28xx lights as well (basically all the other lights on Adafruit or Amazon.
The text was updated successfully, but these errors were encountered: