Chapter 9

Using WiFi to connect to the Internet[JM1]

In Chapter 6 we saw that being able to hook up our experiments to the Internet has the potential to greatly enhance our data science toolkit.  In Chapter 7 and Chapter 8 we looked to see if the functionality on board the micro:bit could connect us to the cloud, to give us access to the services available there.  Although both BLE and the micro:bit radio provide some really useful wireless functionality, we are still no closer to connecting properly to the IoT than we were several chapters ago.  It is time to look beyond the native functionality of the micro:bit.

Connecting to the IoT is relatively simple these days, and most commonly done using Wi-Fi[1].  In this chapter we will add Wi-Fi to our micro:bit weather station and connect it to the cloud.

Section 9.8 – Connecting to the IBM cloud:

First and foremost – check / update the firmware on your BBC micro:bit.  Its quick and easy, and best described by the lovely people at the Micro:bit Foundation in this article: how to check and update firmware on a micro:bit.

This is necessary to ensure the micro:bit can connect to an IoT platform.  There are a number of other reasons to update the firmware – other software and hardware that requires updated firmware to work properly.  It is always good practise to ensure you are running the most recent version of the firmware.

In Chapter 9 we write some code to share data with the IoT platform (IBM).

The full code listing is shown below (remember to change your details accordingly):