Gadget Book: Connecting to the Internet with Raspberry Pi Pico W

Yesterday I was writing about Bluetooth coming to the Raspberry Pi Pico W and – in the original Raspberry Pi post – I also saw a link to this e-book: Connecting to the Internet with Raspberry Pi Pico W. Very interesting it looks, too.

Gadget Book: Connecting to the Internet with Raspberry Pi Pico W

Okay, it’s not a traditional book available on the shelves on your local Waterstones, but it’s a hefty (more than) application note that is worth flagging, with lots of example code and configuration steps. The word from Raspberry Pi themselves…

Pico W

It begins with a look at the Raspberry Pi Pico W microcontroller board, which is based on the Raspberry Pi silicon – the RP2040 microcontroller chip.


Next, in Chapter 2, it considers getting on the internet with the the use of the C SDK, building an example binary, which will scan for nearby wireless networks. Then comes building another project to connect online and then to self-discover the type of hardware you are using:


“There is no direct method in the C SDK that can be called to allow software to discover whether it is running on a Raspberry Pi Pico or a Pico W. However, it is possible to indirectly discover the type of underlying hardware. If the board is powered via USB or VSYS, so 3v3_EN is not pulled low externally, with GPIO25 low, ADC3 will be around 0V for Raspberry Pi Pico W and approximately 1/3 of VSYS for Raspberry Pi Pico.”

Chapter 3 looks at getting on the internet with MicroPython, using a pre-built binary that can be downloaded, and using Thonny as the recommended editor. It also looks at test flashing of the LED on the Pico W (including implementing a RESTful web server to allow you to control the LED), and making HTTP requests…

Bluetooth

With Chapter 4 your are Bluetooth bound – it begins by looking at the protocol in general terms (pairing, broadcast mode, the Generic Access Profile (GAP), the Generic Attribute Profile (GATT), and UUIDs, etc).

Chapter 5 covers working with Bluetooth and the C SDK, creating an example Bluetooth service (pictured below). Note that more example code is also available from the pico-examples GitHub repository.

Finally, in Chapter 6, there is working with Bluetooth in MicroPython.

“Wireless support for Raspberry Pi Pico W has been added to MicroPython. A pre-built binary, which can be downloaded from the MicroPython section of the documentation website, should serve most use cases and comes with micropythonlib pre-integrated into the binary.”

This section includes advertising a Bluetooth service (full code example) and creating another Bluetooth service (a temperature service peripheral) using the generic peripheral advertising code.

For completeness, Appendix A is ‘Building MicroPython from source’ and Appendix B is simply ‘Documentation release history’.

Connecting to the Internet with Raspberry Pi Pico W details

Title: Connecting to the Internet with Raspberry Pi Pico W
Author: Raspberry Pi
Publisher: Raspberry Pi Ltd
Date: 2023
Format: e-book
Pages: 46
Cost: Free

Get Started with MicroPython

And this is not the only book to flag. Reading the comments on the Pico-Bluetooth post, I saw a comment asking, “Is there going to be an updated release of the book “Get Started with MicroPython on Raspberry Pi Pico”, which will include WiFi and Bluetooth? I’d love to get my hands on that!”

The answer from the Raspberry Pi team was: “It’s being written and edited at the moment. I don’t have an eta for you, but it’ll be available before the end of the year.”

Excellent. One to keep an eye out for, indeed – I would like to get my hands on that, too.

See also: Gadget Book: The Computers That Made Britain


Comments

3 comments

  1. Hi,

    What is the point of using Raspberry PI W compared to other solutions used by suppliers like Sonoff Tuya etc?

    Ease of use, processing power for the local intelligence in the device ?

    • It’s the power and familiarity of the whole Raspberry Pi ecosystem, I would say. And cost effectiveness.

      • The Pico isn’t really part of the Pi ecosystem. It has its own toolkit which is an absolute dog to use with very poor results.

        We happily design Pis (CM4s mostly) into products for OEMs, but after two designs with poor outcomes we’ve scrapped using the RP2040 which the Pico is based on.

Leave a Reply

Your email address will not be published. Required fields are marked *

*