Adding WiFi To The Pico 2
Written by Harry Fairhead   
Monday, 19 August 2024
Article Index
Adding WiFi To The Pico 2
Connecting the ESP8266 ESP-01
Attention!
Some Utility Functions
Connecting to WiFi
Sending Data
A Web Server
Complete Listing Of Web Server

The ESP8266 provides a low cost and relatively easy way to get a newly available Pico 2 onto WiFi.

Programming the Raspberry Pi Pico In C

By Harry Fairhead

picoC2E360

Buy from Amazon.

Contents

  • Preface
  • Chapter 1 The Raspberry Pi Pico – Before We Begin
  • Chapter 2 Getting Started
  • Chapter 3 Getting Started With The GPIO
  • Chapter 4 Simple Output
  • Chapter 5 Some Electronics
  • Chapter 6 Simple Input
        Extract:   GPIO Input ***NEW!
  • Chapter 7 Advanced Input – Events and Interrupts
  • Chapter 8 Pulse Width Modulation
        Extract: Basic PWM
  • Chapter 9 Controlling Motors And Servos
  • Chapter 10 Getting Started With The SPI Bus
  • Chapter 11 A-To-D and The SPI Bus
  • Chapter 12 Using The I2C Bus
  • Chapter 13 Using The PIO
        Extract: A 1-Wire PIO Program  
  • Chapter 14 The DHT22 Sensor Implementing A Custom Protocol
  • Chapter 15 The 1‑Wire Bus And The DS1820
  • Chapter 16 The Serial Port
  • Chapter 17 Using the Pico W
       Extract: Simple Web Client
       Extract:A Better Connect
  • Chapter 18 The Pico/W In C: Direct To Hardware 

Extra: Adding WiFi To The Pico 2

<ASIN:1871962803>

<ASIN:187196279X>

Raspberry Pi recently launched the second generation of its popular, low-cost, Pico microcontroller board. The Pico 2 currently lacks WiFi which severely limits its utility as an IoT device. The ESP8266 provides a low cost and relatively easy way to remedy this. As we will make a lot of use of the Pico’s serial ports, it is assumed that you know roughly how these work. In particular, it is assumed that you are familiar with the material in the previous chapter.

The Amazing ESP8266

Before we get on to the details of using the ESP8266 we need to find out what makes it special. It is remarkably low cost, $5 or less, but it is a full microprocessor with GPIO lines, RAM and built-in WiFi. It is built by a Chinese company Espressif Systems, but there are a number of copies on the market. The proliferation of devices and software revisions makes it difficult to work with, but it is well worth the effort. 

While you can set up a development system yourself and program the ESP8266 to do almost anything, it comes with built-in software that allows it to be used as a WiFi module for other processors. This is how we are going to use it to give WiFi capability to the Pico2.

The ESP8266 connects to the outside world using the serial port. The Pico controls it and transfers data using a system of AT commands. These were commonly used to control modems and other communication equipment and they still are used in mobile phone modems. In essence the ESP8266 looks like a modem that connects to WiFi. The module that is used in this chapter is the ESP-01, which is widely available from many different sources, but they all look like this:

ESP01

There is another version, the ESP-07, which comes with a screen RF stage and other advantages, and this should also work. A bigger problem is that there are new versions of the firmware and some of these might not work in exactly the same way. However, it should be easy to make the changes necessary.



Last Updated ( Saturday, 24 August 2024 )