{"id":18,"date":"2026-04-13T12:25:58","date_gmt":"2026-04-13T12:25:58","guid":{"rendered":"http:\/\/burcham.org.uk\/?p=18"},"modified":"2026-04-13T12:25:58","modified_gmt":"2026-04-13T12:25:58","slug":"learning-mqtt","status":"publish","type":"post","link":"https:\/\/burcham.org.uk\/?p=18","title":{"rendered":"Learning MQTT"},"content":{"rendered":"\n<p>I&#8217;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.<\/p>\n\n\n\n<p>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&#8217;s beginning to sound a bit too much like hard work.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>But, if I&#8217;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.<\/p>\n\n\n\n<p>However, I&#8217;ve seen plenty of people talking about MQTT in reference to sensor data. I&#8217;ve never used it before. No time like the present!<\/p>\n\n\n\n<p>I&#8217;ve got mosquitto installed locally. I&#8217;ve managed to setup two subscribers. I&#8217;ve published some mock data. I&#8217;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.<\/p>\n\n\n\n<p>I&#8217;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&#8217;m not sure what the strengths\/weaknesses of MQTT are yet. I know HTTP can do all this without too much bother.<\/p>\n\n\n\n<p>Also, not sure about cloud services for MQTT yet. The microcontroller I&#8217;m using doesn&#8217;t have hardware crypto, so TLS might be a bit pants. If I do everything locally, I don&#8217;t need to bother so much about security. The board I&#8217;m using has a ton of other gear that looks useful though. I can&#8217;t find another board that has equivalent sensors\/connectors for other sensors, has crypto support and is a sane price though.<\/p>\n\n\n\n<p>I think for now, keeping it local will suit my purposes. There&#8217;s plenty I don&#8217;t know how to do yet, so adding another layer of things I don&#8217;t know will just add burden and stress. Maybe I&#8217;ll do something more cloudy later.<\/p>\n\n\n\n<p>I think now though its time for a walk in the sun!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;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 &hellip; <a href=\"https:\/\/burcham.org.uk\/?p=18\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Learning MQTT<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/burcham.org.uk\/index.php?rest_route=\/wp\/v2\/posts\/18"}],"collection":[{"href":"https:\/\/burcham.org.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/burcham.org.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/burcham.org.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/burcham.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18"}],"version-history":[{"count":1,"href":"https:\/\/burcham.org.uk\/index.php?rest_route=\/wp\/v2\/posts\/18\/revisions"}],"predecessor-version":[{"id":19,"href":"https:\/\/burcham.org.uk\/index.php?rest_route=\/wp\/v2\/posts\/18\/revisions\/19"}],"wp:attachment":[{"href":"https:\/\/burcham.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/burcham.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/burcham.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}