You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Had this error building synman/BME280 for an Arduino Nano ESP32 on PlatformIO.
lib/TelnetSpy/TelnetSpy.cpp:43:13: error: cannot convert 'USBCDC*' to 'HardwareSerial*' in assignment
Google suggested this compile flag:
platformio_options:
board_build.extra_flags:
- "-DARDUINO_USB_CDC_ON_BOOT=0"
Which didn't solve the problem because I put the entire section in, when it should have looked like:
build_flags =
-D PROJECT_NAME='"BME280 Sensor Publisher"'
-D HOSTNAME='"bme280-env-sensor"'
-D ELEGANTOTA_USE_ASYNC_WEBSERVER=1
-D ARDUINO_USB_CDC_ON_BOOT=0
-D BS_USE_TELNETSPY
-D BME280_LOG_LEVEL_BASIC
There's this small section :
#if ARDUINO_USB_CDC_ON_BOOT
this->hw_serial_ = &Serial0;
#else
this->hw_serial_ = &Serial;
#endif
The build has the flag set to 0, which forces the serial value to &Serial which fails on the ESP32S3.
Changing the build flag to 1 has no effect.
So I tried changing the value of usedSer = &Serial to usedSer = &Serial0, that worked, but so did the compile flag when platformio.ini was configured properly, my bad.
The compile now runs to building a firmware image :-)
The text was updated successfully, but these errors were encountered:
So I've closed the issue, hoping that Google etc. will pick up the necessary change to platformio.ini as a fix when building this code for an Arduino Nano ESP32.
Hi, I'm using a ESP32-S3. Could you please explain in detail what and where to add or change in the platformio.ini and the TelnetSpy.cpp to make the lib compile?
Had this error building synman/BME280 for an Arduino Nano ESP32 on PlatformIO.
lib/TelnetSpy/TelnetSpy.cpp:43:13: error: cannot convert 'USBCDC*' to 'HardwareSerial*' in assignment
Google suggested this compile flag:
platformio_options:
board_build.extra_flags:
- "-DARDUINO_USB_CDC_ON_BOOT=0"
Which didn't solve the problem because I put the entire section in, when it should have looked like:
build_flags =
-D PROJECT_NAME='"BME280 Sensor Publisher"'
-D HOSTNAME='"bme280-env-sensor"'
-D ELEGANTOTA_USE_ASYNC_WEBSERVER=1
-D ARDUINO_USB_CDC_ON_BOOT=0
-D BS_USE_TELNETSPY
-D BME280_LOG_LEVEL_BASIC
I kept searching and found an alternative fix...
https://www.esphome.io/api/uart__component__esp32__arduino_8cpp_source
There's this small section :
#if ARDUINO_USB_CDC_ON_BOOT
this->hw_serial_ = &Serial0;
#else
this->hw_serial_ = &Serial;
#endif
The build has the flag set to 0, which forces the serial value to &Serial which fails on the ESP32S3.
Changing the build flag to 1 has no effect.
So I tried changing the value of usedSer = &Serial to usedSer = &Serial0, that worked, but so did the compile flag when platformio.ini was configured properly, my bad.
The compile now runs to building a firmware image :-)
The text was updated successfully, but these errors were encountered: