ESP32 + platformio troubles

Hardware I’m using: NodeMCU-32S

I’ve got a working Blynk application on my ESP32 that I’m retooling to build with PlatformIO and porting to FreeRTOS. I ran into issues so I took a really simple Blynk example that I had working in the Arduino IDE and tried building it with PlatformIO to compare. It works fine with Arduino IDE (which pulls in Blynk 0.4.10) but not with PlatformIO (Blynk 0.6.1).

My simple example app:

#define BLYNK_DEBUG
#define BLYNK_PRINT Serial

#include <esp_task_wdt.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>

char auth[] = "[my auth]";
const char ssid[] = "[my ssid]";
const char pass[] = "[my password]";

void setup()
{
    esp_task_wdt_init(30000, false);

    // Debug console
    Serial.begin(115200);

    Blynk.begin(auth, ssid, pass);
}

void loop()
{
    Blynk.run();
}

Console output with it connecting successfully (Arduino/Blynk 0.4.10):

[1134] Connected to WiFi
12:33:56.847 -> [1134] IP: 192.168.1.19
12:33:56.881 -> [1134] 
12:33:56.881 ->     ___  __          __
12:33:56.915 ->    / _ )/ /_ _____  / /__
12:33:56.915 ->   / _  / / // / _ \/  '_/
12:33:56.949 ->  /____/_/\_, /_//_/_/\_\
12:33:56.982 ->         /___/ v0.4.10 on Arduino
12:33:57.020 -> 
[5001] Connecting to blynk-cloud.com:8442
[5778] Ready (ping: 328ms).

Console output with it failing (PlatformIO/Blynk 0.6.1, plus Blynk debug messages enabled):

[2272] Connected to WiFi
[2272] IP: 192.168.1.19
[2272] 
	___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
		/___/ v0.6.1 on ESP32

[2278] Connecting to blynk-cloud.com:80
[2548] <[1D|00|01|00] [my auth]
[7550] Connecting to blynk-cloud.com:80
[7878] <[1D|00|01|00] [my auth]

It appears the request just never gets accepted in this case.

I’ve messed around with various Blynk options (changing the port to 8080, using the raw IP address instead of blynk-cloud.com, etc). But eventually compared to the Arduino build and I think it’s either something different with the newer Blynk lib that is escaping me or some intricacy of PlatformIO that is hosing this.

Anyone have any experience with this? I’m pretty confused. PlatformIO seems awesome, I really want to switch over to it.

Additional details:

• Blynk server
• Blynk Library 0.6.1

Have you tried updating your Arduino IDE version of Blynk to 0.6.1 and see what happens?

Pete.

Good idea, just tried this. It works fine with Arduino and Blynk 0.6.1.

I’m pretty confused now. PlatformIO seems to enable some additional ESP-IDF system features such as watchdog timers etc. But I don’t know much about that yet. Is there some way it would be interfering with the basic Blynk functionality? The wifi stack appears to be working, I can ping it at least.

There’s a few threads on PlatformIO on the forum. This one looks interesting…

Pete.

So I got it to work by changing my platformio.ini configuration to drop the espressif-32 framework. Haven’t figured out what the actual effect of that, but at least I can move forward.

1 Like