Microsoft MakeCode

Filling out IoT fields?

We have this DF Robot IoT board which looks quite functional . If I wanted to explain to a 14 yr old how to fill in the fields in each block in the above code, where would I begin ? https://www.dfrobot.com/product-1926.html
I have Thingspeak on another device but it is only partially functional. Thanks

I’m not sure there’s an easy answer that’s overly kid-friendly, but here are a few ideas:

  • Maybe start by trying to get a clearer understanding of MQTT by itself (ignore ThingSpeak for now). This site has an ok overview: http://www.steves-internet-guide.com/mqtt-works/
  • setup Wi-Fi is about connecting to the local wi-fi access point. It’s the micro:bit equivalent of entering connecting to Wi-Fi on a laptop (which you could demonstrate)
  • The setup mqtt is about connecting to a remote “Broker” for messages. The broker is somewhat like a mash-up of a post office and a newspaper copy shop/printing office. They recieve messages (specific newspapers) and deliver copies to anyone who has subscribed to that newspaper. This unusual post office also requires that each person have a “key” to get-in/join and they indicate the particular newspaper that they are most interested in (their default). These (individual “key” and default newspaper) are the user/password and topic in the setup mqtt Imagine that there is a newspaper called the “OzarkTimes”. People who want to publish this newspaper or join to get it would indicate “Ozark Times” as their default topic.
  • MQTT Send message to Topic will send a new copy of a specific newspaper. For example, MQTT Send "Sunny Tomorrow" to "OzarkTimes" would send the message “Sunny Tomorrow” to everyone who indicated they wanted to subscribe to the “OzarkTimes” (using the specific post office/copy shop that was configured in setup mqtt)
  • You should add in a block for MQTT on TOPIC received MESSAGE to be able to show any messages that are sent to a particular topic, like “OzarkTimes”. For example, you could "MQTT on Ozark Times received Message` that will then show the resulting message on the screen. (This would allow a micro:bit to show the “Sunny Tomorrow” message that was sent by another micro:bit.

To compare it to the micro:bit radio blocks:

  • radio can just send to/from other micro:bits in radio range (~100-300 ft / ~35-100 meters)
  • MQTT goes through the internet and could be used to communicate between micro:bits around the world. It can also allow micro:bits to share data with any other device that can interact with mqtt. These can include “website” dashboard and other electronic devices.

That’s just the MQTT part. You could use just the setup wi-fi with the ThingSpeak blocks to directly interact with ThingSpeak.

I hope that helps a bit,
Bill

You worked very hard on this description, @bsiever . Thanks for that. I have re-read it and will look into MQTT hoping that eventually the kids and I can better understand the Internet of Things via our hardware and MakeCode. Not sure that it is possible but there seems to be a lot of talk about it. Thanks again, Frank