I’ve just started looking at a TinyML project I want to do. The first thing I need to do is get some sensor data off my board.
I thought about just bunging it over a uart. In some ways it would be the quickest easiest way to go about things. However, this thing is likely to evolve into something a bit more structured over time, with several different data types, which would necessitate building packets and coming up with some sort of protocol. That’s beginning to sound a bit too much like hard work.
Next thing I considered was sending some JSON. That would make the protocol rather easier, as I could just create some JSON on the microcontroller send it over to the host and use any number of JSON parsers to extract the data.
But, if I’m using JSON I should really send it over HTTP. The board has ethernet and I can get an HTTP server up and running without too trouble.
However, I’ve seen plenty of people talking about MQTT in reference to sensor data. I’ve never used it before. No time like the present!
I’ve got mosquitto installed locally. I’ve managed to setup two subscribers. I’ve published some mock data. I’ve played with wildcards. All in the cli on my PC so far, but I only started a bit before lunch so early days yet. So far it shows promise.
I’m not sure if some sort of hybrid approach where I use MQTT for notifications and HTTP for the actual data (which later down the line may be audiovisual) would be a good idea. I’m not sure what the strengths/weaknesses of MQTT are yet. I know HTTP can do all this without too much bother.
Also, not sure about cloud services for MQTT yet. The microcontroller I’m using doesn’t have hardware crypto, so TLS might be a bit pants. If I do everything locally, I don’t need to bother so much about security. The board I’m using has a ton of other gear that looks useful though. I can’t find another board that has equivalent sensors/connectors for other sensors, has crypto support and is a sane price though.
I think for now, keeping it local will suit my purposes. There’s plenty I don’t know how to do yet, so adding another layer of things I don’t know will just add burden and stress. Maybe I’ll do something more cloudy later.
I think now though its time for a walk in the sun!