Not uploading the open file

I repeated this many times, trying to vary something.

The program on my WeMos is the one I uploaded days ago. Nothing else is connected to the PC. PIO says it uploaded the file, but:

1- > Executing task in folder Web_Server_SSE_WeMos32: C:\Users\joema.platformio\penv\Scripts\pio.exe device monitor <

— Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
— More details at Redirecting...
Error: ‘ESP32_exception_decoder’
The terminal process “C:\Users\joema.platformio\penv\Scripts\pio.exe ‘device’, ‘monitor’” terminated with exit code: 1.

2- Termite serial monitor is giving me 'cold not find a valid BME 280 sensor…"
That’s from a completely different program. This one has no sensors. It’s only an ESP Now receiver.
It did not upload the file.
This has been happening for the past week, but I blamed myself.

How do you know that it never uploaded?

Did you do a ‘build’ first then ‘upload’ or did you take the easy option and just ‘upload’? Sometimes when I do that, I miss compilation or linker errors and I end up testing the previous code.

I try to always ‘build’ first then, when it’s a clean build, ‘upload’.

Assuming your code compiles, can you post the output from the upload please. Thanks.

Plus your platformio.ini file too, just in case.

Cheers,
Norm.

I built the heck out of it, cleaned it. I know it isn’t uploaded, because the serial output is from the previous program. Outputs follow.

Build:
Building in release mode
Retrieving maximum program size .pio\build\wemos_d1_mini32\firmware.elf
Checking size .pio\build\wemos_d1_mini32\firmware.elf
Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
RAM: [= ] 12.3% (used 40336 bytes from 327680 bytes)
Flash: [====== ] 57.6% (used 755046 bytes from 1310720 bytes)
========= [SUCCESS]

Serial monitor:

Executing task in folder Web_Server_SSE_WeMos32: C:\Users\joema.platformio\penv\Scripts\pio.exe device monitor <

— Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
— More details at Redirecting...
could not open port ‘COM16’: could not open port ‘COM16’: PermissionError(13, ‘Access is denied.’, None, 5)
The terminal process “C:\Users\joema.platformio\penv\Scripts\pio.exe ‘device’, ‘monitor’” terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

PIO Serial Monitor ends there. Termite gives this:
“Could not find a valid BME280 sensor, check wiring!”

Here is the code:

/*
  Rui Santos
  Complete project details at https://RandomNerdTutorials.com/esp-now-esp32-arduino-ide/
  
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files.
  
  The above copyright notice and this permission notice shall be included in all
  copies or substantial portions of the Software.
*/

#include <Arduino.h>
#include <esp_now.h>
#include <WiFi.h>

// Structure example to receive data
// Must match the sender structure
typedef struct struct_message
{
  char a[32];
  float b;
  int c;
  int d;
  int e;
  int f;
  int g;

} struct_message;

// Create a struct_message called myData
struct_message myData;

// callback function that will be executed when data is received
void OnDataRecv(const uint8_t *mac, const uint8_t *incomingData, int len)
{
  memcpy(&myData, incomingData, sizeof(myData));
  Serial.print("Bytes received: ");
  Serial.println(len);
  Serial.print("Char: ");
  Serial.println(myData.a);
  Serial.print("Temperature: ");
  Serial.println(myData.b);
  Serial.print("Humidity: ");
  Serial.println(myData.c);
  Serial.print("Pressure: ");
  Serial.println(myData.d);
  Serial.print("Gas: ");
  Serial.println(myData.e);
  Serial.print("Altitude: ");
  Serial.println(myData.f);
  Serial.print("Uv Index: ");
  Serial.println(myData.g);
  Serial.println();
}

void setup()
{
  // Initialize Serial Monitor
  Serial.begin(9600);

  // Set device as a Wi-Fi Station
  WiFi.mode(WIFI_STA);

  // Init ESP-NOW
  if (esp_now_init() != ESP_OK)
  {
    Serial.println("Error initializing ESP-NOW");
    return;
  }

  // Once ESPNow is successfully Init, we will register for recv CB to
  // get recv packer info
  esp_now_register_recv_cb(OnDataRecv);
}

void loop()
{
}

I successfully flashed my Uno.
It may have already had the NeoPixel running, so I messed it up and watched it not work, then fixed it.

So I know it flashed.

But this is looking up irrelevant libraries:
Processing wemos_d1_mini32 (platform: espressif32; board: wemos_d1_mini32; framework: arduino)

Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: Redirecting...
PLATFORM: Espressif 32 (2.0.0) > WeMos D1 MINI ESP32
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink,
minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:

  • framework-arduinoespressif32 3.10004.201016 (1.0.4)
  • tool-esptoolpy 1.20600.0 (2.6.0)
  • toolchain-xtensa32 2.50200.80 (5.2.0)
    LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Library Manager: Installing me-no-dev/ESPAsyncWebServer.git
    Warning! Could not find the package with ‘me-no-dev/ESPAsyncWebServer.git’ requirements for your system ‘windows_amd64’
    Library Manager: Installing adafruit/Adafruit_Sensor.git
    Warning! Could not find the package with ‘adafruit/Adafruit_Sensor.git’ requirements for your system ‘windows_amd64’
    Found 31 compatible libraries
    Scanning dependencies…
    Dependency Graph
    |-- 1.1.1
    |-- 2.1.2
    | |-- 1.1.4+sha.6cea0d9
    | |-- 1.0
    | |-- 1.0.1
    |-- 1.1.4+sha.6cea0d9
    |-- 1.2.3+sha.241aca3
    | |-- 1.1.1
    | |-- 1.0
    | |-- 1.0
    |-- 1.0
    Building in release mode
    Retrieving maximum program size .pio\build\wemos_d1_mini32\firmware.elf
    Checking size .pio\build\wemos_d1_mini32\firmware.elf
    Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
    RAM: [= ] 12.3% (used 40336 bytes from 327680 bytes)
    Flash: [====== ] 57.6% (used 755046 bytes from 1310720 bytes)
    =================== [SUCCESS]

Only using WiFi and esp_now.
No sensors.
This is from the earlier flash.

It;s not using the open file at all.

I’m working now with another file with only Arduino.h and WiFi.h.

This is a MAC address program I’ve used successfully on my other two WeMos. I pulled this third WeMos out to see if the failure to upload the open file is specific to one unit- it’s not. (#1 is the ESP Now sender, with a sensor, but it’s not plugged in.)

Library Manager: Installing me-no-dev/ESPAsyncWebServer.git
Warning! Could not find the package with 'me-no-dev/ESPAsyncWebServer.git' requirements for your system 'windows_amd64'
Library Manager: Installing adafruit/Adafruit_Sensor.git
Warning! Could not find the package with 'adafruit/Adafruit_Sensor.git' requirements for your system 'windows_amd64'
Found 31 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <AsyncTCP> 1.1.1
|-- <Adafruit BME280 Library> 2.1.2
|   |-- <Adafruit Unified Sensor> 1.1.4+sha.6cea0d9
|   |-- <SPI> 1.0
|   |-- <Wire> 1.0.1
|-- <Adafruit Unified Sensor> 1.1.4+sha.6cea0d9
|-- <ESP Async WebServer> 1.2.3+sha.241aca3
|   |-- <AsyncTCP> 1.1.1
|   |-- <FS> 1.0
|   |-- <WiFi> 1.0
|-- <WiFi> 1.0

I seem to be unable to upload to an ESP 32 chip.

More accurately, I appear to be uploading one file exclusively.

I’ve been trying to upload an I2C scanner, but each WeMos I flash is looking for a BME280 sensor.

When I include the 'ESP_ monitor jazz, PIO calls it an error and stops cooperating.

Termite serial monitor continues to work. I can get the ‘no BME280’ through that when I can’t get it through PIO serial monitor.

The 8266 flashed the I2C Devices program.

Start a new project. Make it as simple as it gets, Blink an LED. Try uploading it – does it upload? If so, I rather suspect that your other sketch is not compiling.

Something is either missing or you didn’t copy it correctly. After the dependency graph, there’s usually something similar to this:

Building in release mode
Checking size .pio/build/uno/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]  11.0% (used 225 bytes from 2048 bytes)
Flash: [=         ]   9.6% (used 3106 bytes from 32256 bytes)
Configuring upload protocol...
AVAILABLE: arduino
CURRENT: upload_protocol = arduino
Looking for upload port...

Followed by details of the upload.

So, try running a clean first, then run a build (ie, not an upload) and check for errors. If there are none, then try an upload. Make sure you see all the output from the upload, including the bits about uploading after the dependency graph.

Assuming, of course, that your device’s upload does indeed produce such a thing!

I have mentioned before that sometimes I make a quick change to a sketch and bypass the build, and just upload which will do a build – I mean, what could go wrong? – and yes, the build fails, so I end up running with the old version. Running the two stages separately makes you pay attention to the messages from each stage. (Or it should!)

Cheers,
Norm.

He just copy pasted the output straight in to the post without formatting it as code with Markdown. I’ve corrected it. The texty reads <library name> but in Markdown, everything in < text > is considered a comment and not rendered.

Hi @maxgerhardt,

thanks. I was meaning that the missing bits come after what was posted by @monsterthews , where it determines the ports etc for uploading (at least, for an Uno that is) and then does the upload. I’ve not got an ESP setup yet to be able to test an upload to that specific device.

Thanks again.

Cheers,
Norm.