[squeak-dev] MQTT for Squeak?

tim Rowledge tim at rowledge.org
Mon Oct 24 19:29:21 UTC 2016


> On 24-10-2016, at 12:16 PM, Tony Garnock-Jones <tonyg at ccs.neu.edu> wrote:
> 
> On 10/24/2016 01:12 PM, tim Rowledge wrote:
>> Happily my use case is about as simple as I could imagine; several
>> devices - probably one Pi and a bunch of ESP8266 nodes - publishing
>> some small amounts of data every 15 minutes or so, and one recipient
>> wanting to get that data to make pretty graphs and stuff. AIUI that
>> means having a broker in the middle.
> 
> Can your devices make HTTP requests?

Oh definitely; Raspberry Pi are real computers. ESP8266 things are tiny and faintly Arduino-like but my goodness, people make them do amazing things for $3. I have one on my desk right now that just has a DHT22 temp/humidity sensor attached, running a simple REST server that returns JSON data.  Squeak’s Json class talks to it perfectly well and of course a plain ol’webbrowser can simply connect to the IP address on port 80 to get the raw json text. It’s just code from https://openhomeautomation.net/connect-esp8266-raspberry-pi/

> 
> I'd POST the data to something in the middle, and GET it from the
> rendering bit. (Or use the filesystem directly, if the rendering bit is
> conveniently located at the same place as the POST-receiving server.)

I have to admit to having thought of doing the direct thing earlier but my interest in mqtt was piqued by discussions with a fellow Makerspace member. We had a kids drop-in-make over the weekend and one of the ‘classes’ was making pine derby cars. Some of the kids went all out to make them beautiful and I started thinking it might be nice to add LED head/tail lights. Then it occurred to me that for $3 we could add an ESP and control those lights from wifi. Then we got carried away and realised that for 50c you could add a piezo speaker and do horn and motor noises. And crash noises too I guess. Then it grew to having the sloped track equipped with a couple of electromagnets to hold the cars in place and release them simultaneously to start the race. Since the ESP does mqtt very easily (apparently!) it seems an obvious thing to consider. 

There seems to be a lot of fun stuff one could do given an mqtt wotsit for Squeak, not to mention Scratch & Etoys.

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
It said, "Insert disk #3," but only two will fit!




More information about the Squeak-dev mailing list