Technically there is the possiility of a UART-stub so that the USB-to-UART converter built-in on most boards suffices, but this is not yet supported by PlatformIO. So the only possibility for live-debugging is with a debug probe.Low-cost ESP32 In-circuit Debugging | by Manuel Bl. | Medium is an excellent article on that.
Dude, a simple “Yes” would have technically answered my question perfectly, but you gave me a placeholder for something I can learn (UART-USB) and a scholarly article that made everything real, practical. This is a high-quality response. I really appreciate it.
I should get the ESP-Prog in almost four weeks.($11.88 + $4 on Ali)
It’s going to show me conflicts in the code, but not offer me solutions, right?
I have an ongoing situation with my ESP Now senders. I see evidence of code running in the first few lines from serial monitor, but none of that format is correct, and then into a formatted backtrace-looking block.
One of the senders has the BME 680, SGP30 and MQ-6 sensors, plus another sensor that does analog CO, NO2, NH3. So I have 4 analog reads and 2 I2Cs happening, and then the data gets collected by ESP Now for transmission. (The R32 has 6 analog pins, A0 and A1 are used by the radio.)
My STRUCT has 16 items, but messing around with that showed me that you can really screw it up without harming the data or the transmission.
You will be able to step line-by-line through the code execution and see the value of variables along the way, which may help you find a bug during runtime. It does not help you with compile-time errors.
Then I should be going in the right direction. These scripts are building and uploading, but they work wrong- I fiddled until they broke, I guess.
Everything in the code looks right. I hardly wrote any of it by myself, mostly pasted from elsewhere.
Only the sensor test works. If the sensor isn’t connected, I get the serial message. But when it’s reconnected the program just goes to heck.
The error message says the ESP Now peer is invalid. I didn’t do anything to that stuff.
There were Struct elements out of order, so I corrected the order. Didn’t fix it.
Two of the items in the struct section were initialized to 0. In the SEND section, I have them set to 0, so I deleted those initializations. That didn’t do anything either.
— Miniterm on COM19 9600,8,N,1 —
— Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H —
Rۑ`6e��5qq�}c��-�Mode: STA
Channel: 1
SSID (12): TP-Link_7C28
Passphrase (8): 64411811
BSSID set: 0
Mode: STA
Channel: 2
SSID (12): TP-Link_7C28
Passphrase (8): 64411811
BSSID set: 0
E (4994) ESPNOW: Peer interface is invalid
Failed to add peer
Carbon Monoxide Detected!
Guru Meditation Error: Core 1 panic’ed (LoadProhibited). Exception was
unhandled.
This is the similar mess I get with the other sender, this one a WeMos D1/32.
The D32 error mentions Adafruit 12C, but the second calls out Wire. So this feels like an I2C conflict?
— Miniterm on COM27 9600,8,N,1 —
— Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H —
I%M/�`<
�=a>ii�\mdGd�55�BME680 test
Brownout detector was triggered
�DL�l�P�z+�����BE�BME680 test
Mode: STA
Channel: 1
SSID (12): TP-Link_7C28
Passphrase (8): 64411811
BSSID set: 0
Mode: STA
Channel: 2
SSID (12): TP-Link_7C28
Passphrase (8): 64411811
BSSID set: 0
E (2737) ESPNOW: Peer interface is invalid
Failed to add peer
Guru Meditation Error: Core 1 panic’ed (LoadProhibited). Exception was
unhandled.
// Init ESP-NOW
if (esp_now_init() != ESP_OK)
{
Serial.println("Error initializing ESP-NOW");
return;
}
delay(50);
// Once ESPNow is successfully Init, we will register for Send CB to
// get the status of Trasnmitted packet
esp_now_register_send_cb(OnDataSent);
// Register peer
esp_now_peer_info_t peerInfo;
memcpy(peerInfo.peer_addr, broadcastAddress, 6);
peerInfo.encrypt = false;
// Add peer
if (esp_now_add_peer(&peerInfo) != ESP_OK)
{
Serial.println("Failed to add peer");
return;
}
bme.setTemperatureOversampling(BME680_OS_8X);
bme.setHumidityOversampling(BME680_OS_2X);
bme.setPressureOversampling(BME680_OS_4X);
bme.setIIRFilterSize(BME680_FILTER_SIZE_3);
bme.setGasHeater(320, 150); // 320*C for 150 ms
uv.begin(VEML6070_1_T);
}
If you don’t 0-initialize a variable on the stack, its contents will be random. peerInfo has more members than just peer_adr and encrypt, and you set the value of those, but the others will be implicitly random.
That’s a different crash now. I would need to see the full code.
Which of your sensors works via I2C? Can you test that sensor separately and see if it fails with the same error?
Can you also delete the .pio folder so that it re-downloads the latest versions of the libraries?
When you look in the compilation log, does it show Espressif 32 platform 4.x.x instead of 3.5.0? This is the new Arduino core which might introduce some incompatibilities with older code. You can try doing platform = espressif32@3.5.0 in the platformio.ini to rollback.
Sender 1 has BME 680 and SGP30 on I2C.
Sender 2 has BME 680 and VEMLxxx Uv chip.
I actually got sender 2 and Receiver working together, then got sender 1 sending, but it was sending zeros- all data = 0 on serial (and on the receiver).
So now I’ve gotten both senders screwed up.
Can’t imagine how, but the guru error is gone for now. My ESP-Prog has been shipped. If it comes from CA, I’ll get it in a week.