Web Server based on the Raspberry Pico using an ESP8266 with AT firmware for WiFi

Overview

PicoWebServer

This program runs on a Raspberry Pico RP2040 to provide a web server when connected to an Espressif ESP8266. This allows the Pico to be monitored and controlled from a browser. The Pico RTC can also be updated with the current time from NTP servers and the ESP8266 GPIOs can be accessed from the Pico.

It was written as an exercise in learning the Pico SDK so is more complex than it needs to be. The web server runs on Core 1 and the example runs on Core 0. FIFOs and interrupts are used to communicate between the cores, and mutexes used for coordination. The Pico and ESP8266 communicate over a UART serial connection. Logging is output over the Pico USB.

The program consists of:

  • PicoWebServer.cpp
  • PicoWebServer.h
  • blinkLed.pio (optional, used for learning about PIOs)

ESP8266

The ESP8266 provides wifi connectivity for the Raspberry Pico. The ESP8266 needs to be loaded with Espressif AT firmware after which no programming of the ESP8266 is required. The AT firmware resources can be downloaded from Espressif:

  • AT firmware. Note ESP8266 NonOS AT Bin is no longer available and has been replaced by ESP8266 IDF AT Bin which I have not tested and is not suitable for 1MB flash. A copy of the old firmware ESP8266_NonOS_AT_Bin_V1.7.4.zip has therefore been stored in this repository.
  • Flashing tool.
  • Instructions.

Connection Pins

Pico ESP8266
0 (TX) 3 (RX)
1 (RX) 1 (TX)
2 RST
GND GND

The ESP8266 can be powered from the Pico, or a separate power source can be used but retaining the common GND connection. Pico pin 2 is used to reset the ESP8266.

Configuration

Requires the Pico SDK and appropriate toolchain.

The following user configuration must be completed in the PicoWebServer.h file:

#define WIFISSID "****" // wifi SSID
#define WIFIPASS "****" // wifi password
#define STATICIP "192.168.1.135" // static IP for PicoWebServer
#define GATEWAY "192.168.1.1" // gateway IP (eg router)
#define TIMEZOME 0 // +/- local time offset in hours from UTC

Example

The files PicoWSexample.cpp and PicoWSpage.h provide an example of using the PicoWebServer to display the following content on a browser. The web page refreshes every 10 seconds using AJAX and JSON: image2

You might also like...
This is a set of utilities that allow you to read, write or erase SPI flash chips using a Raspberry Pi Pico (RP2040) chip.

Pico SPI Utilities This is a set of utilities that allow you to read, write or erase SPI flash chips using a Raspberry Pi Pico (RP2040) chip. While th

Emulating PSX Memory Card (or controller) using a Raspberry Pi Pico
Emulating PSX Memory Card (or controller) using a Raspberry Pi Pico

PicoMemcard PicoMemcard allows you to build your own supercharged PSX Memory Card that can be connected to your computer via USB in order to transfer

Enable LoRaWAN communications on your Raspberry Pi Pico or any RP2040 based board. 📡

pico-lorawan Enable LoRaWAN communications on your Raspberry Pi Pico or any RP2040 based board using a Semtech SX1276 radio module. Based on the Semte

Capture audio from a microphone on your Raspberry Pi Pico or any RP2040 based board. 🎤

pico-microphone Capture audio from a microphone on your Raspberry Pi Pico or any RP2040 based board. 🎤 Hardware RP2040 board Raspberry Pi Pico Microp

ESP32 and ESP8266 Arduino wifi template

ESP wifi template ESP32 and ESP8266 Arduino wifi template Features Popular WiFI AP mode WiFI STA mode ETH mode DNS server for AP mode Async DDNS clien

Firebase Arduino Client Library for ESP8266 and ESP32. The unified version of Firebase-ESP8266 and Firebase-ESP32 Realtime database libraries with Cloud Firestore, Firebase and Google Cloud Storage, Cloud messaging and Cloud Functions supports.
A fork of Picoprobe, an SWD progammer firmware, for the Pico Debug'n'Dump

pdnd-picoprobe A fork of Picoprobe, an SWD progammer firmware, for the Pico Debug'n'Dump. Usage Make sure the "Mode" switch is set to I2C/SWD Follow g

RPi Pico/RP2040 firmware for the Scoppy Oscilloscope

scoppy-pico RPi Pico/RP2040 firmware for the Scoppy Oscilloscope Installation and getting started instructions Scoppy Android app - Play Store Scoppy

Raspberry Pi Pico (RP2040) and Micro-ROS (ROS 2) Integration

The Pico is an amazing microcontroller and I couldn't wait for ROS 2 support or Arduino Core, so here is my approach. Once the Arduino Core for RP2040 is out it will be easier to use micro_ros_arduino.

Comments
  • README.md discrepancies

    README.md discrepancies

    Perhaps the Espressif page has been revised since you wrote the README.md and the links do not work or do not describe the actual content of the page. https://www.espressif.com/en/products/socs/esp8266ex/resources

    • The name "ESP8266 NonOS AT Bin" does not exist but perhaps it has been renamed, is "ESP8266 IDF AT Bin (Latest)" the one we want?
    • The "Flashing tool" link gets a 404 but the tools seem to be on the Resources page.
    • The "Instructions" link is correct.

    Thank you.

    Screenshot 2021-02-26 020450 Screenshot 2021-02-26 022242

    opened by martinmarty 4
  • Separate functionality for Communication

    Separate functionality for Communication

    Just an idea. I know, this is going to be a Webserver using ESP8266 and RPi Pico. My suggestion would be to separate communication from all other functionality by introducing a separate WiFi class in charge of handling initialization, connection establishment and data transfer. Doing this, the project would offer two benefits: providing an example for combining Pico with the ESP8266, AND, offering a library so that others could build their own WiFi-based examples. This library could provide a simular interface such as Wireless (from pythonwifi.iwLibs) or other proven libraries.

    opened by ms1963 2
Owner
null
Breakout game for Raspberry Pi Pico with Pimoroni Pico Display pack

breakout_rpi_pico Breakout game for Raspberry Pi Pico with Pimoroni Pico Display pack Prebuilt binary (breakout.uf2) is here. To build your own binary

null 19 Oct 15, 2022
Pico-uart-bridge - Raspberry Pi Pico UART-USB bridge

Raspberry Pi Pico USB-UART Bridge This program bridges the Raspberry Pi Pico HW UARTs to two independent USB CDC serial devices in order to behave lik

Álvaro Fernández Rojas 150 Nov 25, 2022
Digital rain animation gif with glow squeezed into a raspberry pi pico and pimoroni pico-display

pico-display-matrix Digital rain animation gif with glow squeezed into a raspberry pi pico and pimoroni pico-display or how to actually use all Flash

null 32 Sep 10, 2022
Flashrom/serprog compatible firmware for the Raspberry Pi Pico

pico-serprog This is a very basic flashrom/serprog compatible SPI flash reader/writer for the Raspberry Pi Pico. It does not require a custom version

stacksmashing 34 Nov 3, 2022
Busylight firmware for Raspberry Pi Pico

Rasperry Pi Pico Busylight This is the GitHub repository for the project: https://buildcomics.com/ (TO Be Determined) You will also find the "instruct

Build Comics 12 Oct 24, 2022
Prueba del Raspberry PI PICO con un display Raspberry PI TFT 3.5"

Raspberry-PI-PICO-display-RPI35 Prueba del Raspberry PI PICO con un display Raspberry PI TFT 3.5" Con ayuda de la libreria https://github.com/khoih-pr

null 1 Nov 10, 2021
Control Heidelberg Wallbox Energy Control over WiFi using ESP8266 and configure your own local load management

< scroll down for English version and additional information > wbec WLAN-Anbindung der Heidelberg WallBox Energy Control über ESP8266 Die Heidelberg W

null 87 Nov 16, 2022
A laser cut Dreamcast Pop'n Music controller and integrated memory card using the Raspberry Pi Pico's Programmable IO

Dreamcast Pop'n Music Controller Using Raspbery Pi Pico (RP2040) Intro This is a homebrew controller for playing the Pop'n Music games on the Sega Dre

null 38 Oct 25, 2022
Open source PCB for arcade sticks using Raspberry Pi Pico.

Pico Fighting Board Open source PCB for arcade sticks using Raspberry Pi Pico. Introduction They say imitation is the highest form of flattery. If tha

null 109 Nov 16, 2022
USB host implementation using PIO of raspberry pi pico (RP2040).

Pico-PIO-USB USB host implementation using PIO of raspberry pi pico (RP2040). You can add additional USB port to RP2040. ?? This library is WIP. API m

null 662 Nov 16, 2022