# Micro:bit Help DFRobot IoT?

**URL:** <https://forum.makecode.com/t/micro-bit-help-dfrobot-iot/8986>\
**Category:** micro:bit\
**Created:** [July 1, 2021, 12:56am UTC](https://forum.makecode.com/t/micro-bit-help-dfrobot-iot/8986 "2021-07-01T00:56:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![frank\_schmidt](https://avatars.discourse-cdn.com/v4/letter/f/7993a0/32.png) [@frank\_schmidt](https://forum.makecode.com/u/frank_schmidt)\
**Post date:** [July 1, 2021, 12:56am UTC](https://forum.makecode.com/t/micro-bit-help-dfrobot-iot/8986/1 "2021-07-01T00:56:29Z")

</div>

I have this new IoT board by DF Robot: Micro:IoT and I have this code from the Github repo. Does anyone know how or what entries should be made in the blocks to make it work ? Thanks:

> **[dfrobotIoT1](https://makecode.microbit.org/93614-36316-57163-49268)**
>
> Made with ❤️ in Microsoft MakeCode for micro:bit.

> **[DFRobot/pxt-DFRobot-microIoT](https://github.com/DFRobot/pxt-DFRobot-microIoT)**
>
> This is a micro:bit-based IoT expansion board with multi-function, aiming to help you to build your IoT applications in few steps! - DFRobot/pxt-DFRobot-microIoT

---

<div class="post-metadata">

**Author:** ![bsiever](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bsiever/32/1032_2.png) [@bsiever](https://forum.makecode.com/u/bsiever)\
**Post date:** [July 1, 2021, 9:41pm UTC](https://forum.makecode.com/t/micro-bit-help-dfrobot-iot/8986/2 "2021-07-01T21:41:16Z")

</div>

Hi Frank,

I’ve done things like this before (with [AdaFruit IO](https://io.adafruit.com/)), but not this particular device/service, so I can’t provide much more insight than the following:

It looks like the extension goes through your home Wi-Fi (so it needs your Wi-Fi access point name in the “yourSSID” and the corresponding password for “yourPassword” in the `setup Wi-Fi` block).

The mqtt blocks use DF Robot’s MQTT server, so you’ll need to create an account at: [https://iot.dfrobot.com/](https://iot.dfrobot.com/). MQTT is a pretty popular way of sending message back-and-forth between IoT devices…It can be used to have a web service, like a webpage “dashboard”, interact with devices (micro:bits) or have devices talk to one another via the MQTT broker. Here’s a video with a quick introduction to MQTT: [An Introduction to MQTT for Beginners](https://www.youtube.com/watch?v=2aHV2Fn0I60).

After creating the account on [https://iot.dfrobot.com/](https://iot.dfrobot.com/) you can “add a device” and create an IoT\_id(user) and IoT\_pwd(password) to use with devices. I think these are what you’d add to the `MQTT:IoT setup mqtt` block’s user/password fields. This will then allow the `MQTT Send Message ...` blocks to post messages to that topic. If successful, the message should be visible somewhere on the “dashboard” of your [https://iot.dfrobot.com/](https://iot.dfrobot.com/) account. And you should be able to use the dashboard to send messages back to the device.

It looks like the extension could also work with other internet services (rather than DFRobot’s MQTT server): [ThingSpeak](https://thingspeak.com/) and [BeeBotte](https://beebotte.com/). With either you’d create an account on their service and they’d provide a “key” (password) used to interact with their service, which you’d use in the “key” field of the corresponding block. You then post messages which are relayed to your on-line dashboard on the service. I’ve used ThingSpeak a bit and it may be easier to use than MQTT.

If you want to try MQTT, I’d suggest:

1. Have the `Micro:IoT setup Wi-Fi` in `setup` (like in your example, but add in your Wi-Fi access point name and password)
2. Create an account at DF Robot and add a device and then generate the user name / password (these are different from the user name and password you use to create the account!)
3. Have the `Micro:IoT setup mqtt` block after the Wi-Fi setup and add in the user/password created in the previous step.
4. Have an `on button A` block that posts a message to a topic via the `MQTT Send Message` block.
5. Have an `MQTT on ... received` block that will display the message (the message variable from the `Variable` menu) on the screen via a `show string` block.
6. Program the device.
7. Try pressing the `A` button to send an MQTT message to DFRobot. Look around your dashboard on your DFRobot account to see if you receive the message. Maybe try to send one back (to that it scrolls across the microbit screen).

Good luck!  
Bill

---

<div class="post-metadata">

**Author:** ![frank\_schmidt](https://avatars.discourse-cdn.com/v4/letter/f/7993a0/32.png) [@frank\_schmidt](https://forum.makecode.com/u/frank_schmidt)\
**Post date:** [July 1, 2021, 10:12pm UTC](https://forum.makecode.com/t/micro-bit-help-dfrobot-iot/8986/3 "2021-07-01T22:12:40Z")

</div>

thanks, Bill,  
by the way, I now have your Mbit app working with Microbit V2 and TWO (2) motor-drivers by different companies On the same Microbit with the same MakeCode program and with iOS and Android . I’ll make a video. DF Robot Micro Maqueen and Kittenbot Robotbit, 1 Microbit V2, drives both bots , same MakeCode code and same Mbit app. on both smart phones.  
I’ll try your above suggestions and report back.  
Frank
