OTA Programming from RPi & SPI

Started by roman_s, May 02, 2017, 09:58:02 PM

roman_s

I got bitten by the Moteino bug and am starting to scale up my sensor network around the house. That will become easier to manage with OTA programming, so I am looking into my options. From my limited insight so far it seems like Felix' approach is based on a Moteino Gateway that a PC talks to through the serial port. However, my current gateway that listens sensor readings is a bare RFM69 connected to a Raspberry Pi Zero via SPI (using https://github.com/etrombly/RFM69 and hence a simple Python-based daemon).

I wonder if it's worth the effort to try to port the OTA library & client to something that runs on the Rpi and talks to the radio through SPI, as opposed to a sketch and a Windows GUI. I'd prefer a scriptable, programmatic approach, but it seems to be a non-trivial amount of work.

Any opinions?

Thanks,
Roman

Felix

IMHO its not worth it. But I am biased because I believe in a middle man (moteino or avr/atmega) between the computer and the radio. I like to have the two talk serial rather than go to SPI, reason being that if Pi stops being made tomorrow, I can take serial to the next Pi or PC or whatever, but with the SPI i have to reimplement everything.

roman_s

Makes sense, thanks for the feedback, Felix. Even though the challenge is tempting, I'll just use one of my Moteinos as a OTA programming gateway and keep the rest of my setup. I assume I can simply connect its serial pins with the Pi Zero?

On that note: I still want to follow the programmatic approach, using a script instead of a GUI. Does https://github.com/LowPowerLab/WirelessProgramming/blob/master/WirelessProgramming.py still work? It is part of the old repo that is now marked as obsolete (I guess it is entirely subsumed by https://github.com/LowPowerLab/RFM69).

I do have one more question regarding your reply though: Isn't SPI a common standard just like serial, and just as "future-proof"? Or did you mean that you prefer the generality of a PC as a programming client, rather than a microcontroller?

Roman

Felix

Yes connect to GPIO serial.

The py script is old and wont work. I may combine a windows GUI to invoke an updated py script but I need to find the time to make that change, not top priority right now.

SPI is more low level, you dont find a "SPI" port on the laptops at best buy, serial is universal and on every PC, either in USB or RS232 form, on the Pi its also available on the GPIO directly.

brolly759

Why wont the Py script work anymore?

Felix

Because it's deprecated by changes to the OTA algorithm.

brolly759

Ugh, thats not good, I was building something with a Pi that uses 2 modules, 1 for OTA and 1 for the network hub... Is there anyway to wireless OTA a Mote using a Pi at the moment? If not, what is the ETA on the Py script to be updated?

Felix


I don't have an ETA but I plan to explore a way to invoke that from the .net program and then it could also be directly invoked on linux.
If you are not afraid of some coding you could take the existing py script to make changes to it yourself based on what the moteino OTA programmer expects. There are a few handshakes and the rest is the transmission packet by packet.

brolly759

Is there a version of software that works with the py script so I can do a compare on the differences?

Felix

Currently the RFM69_OTA.h is the header for the new OTA library.
Before it used to be called WirelessHEX69, located here for reference.
The current .net GUI worked with that WirelessHEX until I merged that into the RFM69 library as RFM69_OTA.h.
So if you go back in history on the WirelessHEX69, perhaps this revision, you might be able to run it. Also the OTA examples would need to include WirelessHEX69.h instead of the latest RFM69_OTA.h. Good luck :)

brolly759

I dont need SPI communication, is their a USB/UART python OTA already written and currently working? Hell I can use any programming language as long as it works on linux lol


Felix

#12
I answered that here.
Looks like I might be able to use IronPython to include a small py runtime in a .net executable and then just pass parameters to a py script. If that works, then I will bring the py script up to date and keep the OTA logic there rather than in c#.

brolly759

So, any updated Python code yet? :)

I can settle with an ESP8266/32 OTA for Motes :)

Felix