The Raspberry Pi RP2040 MCU has become ubiquitous in the IoT world. It seems like most manufacturers have their own dev board variations.
I have been looking for a low cost version with rf connectivity that I could integrate into my projects.
I came across an offering from Seeed Studio that is a small low cost ($6.95) PCB module with castellated pads that integrates an RP2040 with an ESP8285 WiFi chip: Wio RP2040 Module.
- Powerful CPU: dual-core 133MHZ RP2040 processor and 264KB SRAM, 2MB Flash
- Reliable wireless connection: using powerful ESP8285 WiFi chip, supporting 2.4~2.4835 GHz frequency and AP&Station mode
- Flexibility: compatible with Thonny editor
- Extremely compact size: 18.0x 28.2x 1.0mm 32 pins SMT
- Multiple certifications: FCC and CE Certified
I wanted to try out the module, but to make testing easier I decided to get a mini dev board that incorporates the module and adds the convenience of buttons, LEDs, power regulator, and a USB-C connector: Wio RP2040 mini Dev Board for $12.95. The only inconvenient issue is the board width is not very breadboard friendly.
Lots of examples are using MicroPython, but I prefer C and Seeed has Arduino board libraries for the RP2040 - so I decided to use the Arduino IDE.
I wrote a quick program to test it out. It just measures the RP2040 core temperature and publishes it over MQTT. It also subscribes to the temperature and prints it over the Serial Monitor to verify the callback operation.
Wio_RP2040_MQTT.ino
#include "seeed_rp2040_wifi.h"
#include "arduino_secrets.h"
WiFiMqtt mqtt_test;
float tempRP2040 = 0.0;
void mqtt_cb(const char *topic, const char *msg)
{
Serial.println();
Serial.print("Subscribed topics:");
Serial.println(topic);
Serial.print("Received message:");
Serial.println(msg);
Serial.println();
}
void setup()
{
Serial.begin(115200);
while (!Serial);
delay(2000);
Serial.println("******start*******");
while(false == WiFi.begin(SECRET_SSID, SECRET_PASS))
{
Serial.println("connect wifi fail ,try again");
delay(5000);
}
Serial.println("success connect wifi");
//set
mqtt_test.mqtt_setcfg("Wio_RP2040","","",0,0,"");//client_id,username,password,cert_key_ID,CA_ID,path
//connect
while(!mqtt_test.mqtt_connect("10.0.0.234",1883,0));//server,port,reconnect
mqtt_test.mqtt_set_callback(*mqtt_cb);
mqtt_test.mqtt_subscribe("wio_rp2040/temperature",0);
}
void loop()
{
//read core temperature
Serial.printf("Core temperature: %2.2fC\n", analogReadTemp());
tempRP2040 = analogReadTemp();
char tempString[8];
dtostrf(tempRP2040, 1, 2, tempString);
//publish
mqtt_test.mqtt_publish("wio_rp2040/temperature",tempString,0,0);//topic,data,qos,retain
mqtt_test.mqtt_check_msg();
delay(1000);
}
And the plot on my MQTT server
I think that I'll get some modules to try on custom PCBs. Just have to think of some projects to do...
Top Comments