Remote monitoring of multiple Teensy 4.1's

SteveSFX

Well-known member
Hey all

I make 'stuff' for a local charity. Interactive things for kids usually.
A lot of the time, they break it and I end up having to drive over and it's nearly always a simple fix.

All these projects run on Teensy 4.1's - non ethernet version.
My initial idea was to switch to the Ethernet version and hook them up so that I can remotely check each install. But this has it's own issues.

The main one is the logistics of actually getting a network cable to each install. The second is I understand I would need a static IP to be able to view these modules outside their network.

Oh and third, I have never done this before.

My other thought was WiFi + 4G. 3G modules I believe are getting binned in the UK later this year, but 4G should be fine.

I was thinking maybe add a simple WiFi module to the Teensy 4.1's for comms, and have them all report to a central Teensy that has a 4G module attached.
If I want to 'quiz' a module, I contact the 4G module and then obtain data as required.

Does seem a bit involved, but cannot think of a better way.

Ideally, I would have a secure webpage that listed all the modules, but that is probably well out of my league.

Ideas?
 
It's probably sacrilege to say it here but if you want wifi in an arduino environment then unless you need the extra IO or processing power often ESP32 it a better route to take.

On the networking side if you can put a standard wifi (or wired ethernet) router in the area then you can set all the devices to connect to that. Set them to use DHCP and then (assuming a half decent router firmware) you can set each device to always be issued the same IP. This gives you the same end result as static IPs but without the risk of accidentally assigning the same / incompatible addresses and keeps all the address configuration in a single place.
You'd either need some way to remote in to the local network or have some form of cloud server that the all of the modules connect to and send their info to. Depending on how physically secure the area is a simple PC on the LAN with remote access software installed may be an option.

Having said that how many of the issues you hit are things you could fix remotely? Configuration issues would be easy to fix remotely but I can't see how that problem would show up over time very often. If it's simply a case of a power cycle or reset then a smart plug would be a simpler solution. If the problem requires physical interaction then you still need to go there, the only advantage this would give you is possibly telling you which wire/component has failed before you get there and even then it's not going to be able to tell you the issue a lot of the time.
 
I have been using ESP32's a lot, but I now need the 42 pins of a Teensy 4.1

Ideal world? I would get OTA programming working on a Teensy 4.1 (as I have on an ESP32), but that might be optimistic.

The issues I get asked are to alter timings, switching combinations etc. I literally did a 12 hour round car trip last week to alter a millis() timer taht took me 5 minutes.
 
A 12 hour drive to fix something for a charity? I admire your dedication.

Is there anyone local that could plug in to the units for you? If you can set them up with teensy loader on a computer then all you need to do is send them a new .hex file to program in. It may involve a bit more troubleshooting but probably not 12 hours worth.

OTA updates over ethernet, serial or SD card are all possible. If you use the flasherX library then a simple OTA is fairly straightforward to implement. A fail safe system where it is still recoverable if someone pulls the power mid-upgrade is also possible but gets a lot more complex.
I've implemented a system on a T4.1 using a web page based firmware update that is fail safe in the event of power or network failures. I've never managed to get to the point where I couldn't recover over the network and I tried my best.
However that was for something that was going to be completely inaccessible. It's not worth the extra effort required if plugging into the USB port is a possible fallback in the event of an update failing.

On the networking side one method I've used is to have each unit send out a UDP broadcast packet at a fixed interval (every 5 seconds or so). The packet contains basic details like unit ID, version number, status. You can then either use a PC application or another teensy based unit to listen for those broadcasts and compile a list of devices that they see. It may not be the most robust system but does make for a very simple way to monitor what's out there and detecting if something is reporting a problem or drops out unexpectedly.
 
Teensy to Teensy OTA has been shown to work. Properly programmed and ESP32 should be able to do OTA to a Teensy.
 
You could put all of the Teensy on multi-drop 485 and if the place has internet service you could connect to them and/or update them remotely via Ethernet/serial converter.
 
I am going to add a basic WiFi board to the Teensy 4.1 this week and have a play. I am not super up to speed on the OTA stuff, so I think the best way forward is some tinkering.

Yes - 12hr round trip is less than ideal, but hey ho. Doesn't happen too often, but when it does.... it sucks
 
Back
Top