CoffeePlusPi
Posts: 43
Joined: Sun Aug 06, 2023 2:18 pm

Blynk IoT With RP2040

Mon Nov 27, 2023 11:23 pm

Hi guys,

I recently made an RP2040 board, which does work, so I wired an ESP-01 (correctly) to the board. Everything turns on, can connect to WiFi, blink my dang LEDs, the whole package. My issue here is that I want to use this with Blynk IoT so that I can have that IoT function with my phone. I used the example code in the Arduino IDE for the ESP-01 and RP2040, and while they do successfully connect to the Blynk IoT app and everything, the entire thing goes offline 9 seconds after giving the online status. Has anybody run into this issue? I tried to add Serial Print functions in the Void Loop section, but it did not loop in the serial monitor. Here is my code, maybe I just messed up? Thanks!

#define BLYNK_PRINT Serial

/* Fill in information from Blynk Device Info here */
#define BLYNK_TEMPLATE_ID "XXXXXXX"
#define BLYNK_TEMPLATE_NAME "XXXXXXX"
#define BLYNK_AUTH_TOKEN "XXXXXXX"


#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "XXX";
char pass[] = "XXX";

// Hardware Serial on Mega, Leonardo, Micro...
#define EspSerial Serial1

// or Software Serial on Uno, Nano...
//#include <SoftwareSerial.h>
//SoftwareSerial EspSerial(2, 3); // RX, TX

// Your ESP8266 baud rate:
#define ESP8266_BAUD 115200

ESP8266 wifi(&EspSerial);

void setup()
{
// Debug console
Serial.begin(9600);

delay(10);

// Set ESP8266 baud rate
EspSerial.begin(ESP8266_BAUD);
delay(10);

Blynk.begin(BLYNK_AUTH_TOKEN, wifi, ssid, pass);
}

void loop()
{
Blynk.run();
Serial.println("Looping...");
delay(10);
}

Return to “Other RP2040 boards”