W55RP20-EVB-PICO Redis example
A simple MicroPython example implementing Redis client for the W55RP20-EVB-Pico board
This code is in the WIZnet-ioNIC GitHub repository. This contents covers the setup and execution results.
dependant library:
Hardware Requirements
- W55RP20-EVB-PICO
- Desktop or Laptop
- USB Type-C Cable
Software Tools
- Thonny
Setup board
Download the boot image from the following link and extract the firmware.uf2
file: https://github.com/WIZnet-ioNIC/WIZnet-ioNIC-micropython/releases/download/v1.0.0/WIZnet-ioNIC-micropython_Bin.zip
Connect the board to your computer using a Micro-USB to USB-A cable.
Press following two button at a time
Once connected, the file explorer will open, displaying the root folder of the board.
Drag and drop the firmware.uf2
file into the root folder. The Micropython firmware will automatically install on the board.
Redis
Redis is an open-source, in-memory data structure store used as a database, cache, and message broker. It is known for its speed, flexibility, and ease of use, supporting data structures such as strings, hashes, lists, sets, and more.
Redis is commonly used in scenarios requiring fast data access, such as real-time analytics, session management, caching to speed up application performance, or as a message broker for communication between services. Its lightweight design and support for in-memory storage make it ideal for high-performance use cases.
The example you provided is related to using Redis in a Micropython project, demonstrating how embedded systems can use Redis to communicate or store data efficiently, especially when working with Internet of Things (IoT) devices.
Run
After installation, open Thonny. Create a new script and run the example file.
You should see the current time fetched from the NTP server being printed as output.
The ping
command was used to check the connection to the Redis server. The server responded with PONG
. When you provide a message to the ping
command, it should return that message as a response. I provided the message "os"
and received it back as expected.
Using the set
command, I stored my own key "pico"
with the value "test from pico"
. Then, I used the get
command to retrieve and print the value stored under the "pico"
key from the server.
References
picoredis library test program - micropython-redis-boilerplate/main.py at main · redis-developer/micropython-redis-boilerplate (github.com)
windows redis server v3.0 installer - Releases · microsoftarchive/redis (github.com)
redis commands list - Commands | Docs (redis.io)