Dear community,
I am freshly moved from Arduino to PlaformIO and see a lot of helpfull functions waiting for me
I tried to complile some sketches which runs under Arduino so far - with my Wemos D1 Mini he didnt find the ESPNow libraries:
thats my platformio.ini:
[env:wemos_d1_mini32]
platform = espressif32
board = wemos_d1_mini32
framework = arduino
lib_deps =
BlueDot_BME28
And thats the declaration in the source code:
#include <Arduino.h>
#include <WiFi.h>
extern “C”
{
#include <espnow.h>
}
#include “BlueDot_BME280.h”
I am running PlatformIO on VSCode on MacOS.
Any help is appreciated !
Br Peter
According to the source code
https://github.com/espressif/arduino-esp32/blob/master/tools/sdk/include/esp32/esp_now.h
This file is called esp_now.h
and not espnow.h
? Are you sure the exact same sketch compiles under Arduino IDE?
Hi Maxgerhardt,
looks interesting. Yes, it does:
When I try that with esp_now.h I get an error in Arduino:
ESPNOW_AS_MQTT_Collector_V4:16:23: fatal error: esp_now.h: No such file or directory
#include <esp_now.h>
^
compilation terminated.
exit status 1
esp_now.h: No such file or directory
Thanks for your support !
Br Peter
Eh, yikes, I referenced the ESP32 Arduino core and not the ESP8266 core. It’s indeed called espnow.h
there.
/*
* ESPRESSIF MIT License
*
* Copyright (c) 2016 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
*
* Permission is hereby granted for use on ESPRESSIF SYSTEMS ESP8266 only, in which case,
* it is free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished
* to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or
* substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
This file has been truncated. show original
I’ll check if the include flags are correct.
No wait a second. You’re compiling an ESP8266 sketch for a target NodeMCU board in the Arduino IDE.
But in your platformio.ini
you want to programm a Wemos D1 Mini32, which has an ESP32 chip.
Which exact target board do you physically have ? It might just that you meant to just select the D1 Mini (ESP8266) and not the D1 Mini32 (ESP32).
If that’s the case, use the following platformio.ini
[env:d1_mini]
platform = espressif8266
board = d1_mini
framework = arduino
1 Like
I have both boards - the D1 Mini Lite (Sensor Node) and the Nodemcu (Data Collector). But you are right, I will check if I not mixed up details in the platformio.ini. Will come back with the result.
Thanks a lot for the hint !
Br Peter
Then you shouldn’t choose a D1 Mini as the PlatformIO target, but the D1 Mini Lite. These have different flash sizes so the firmware might not work interchangebly.
See WeMos D1 mini Lite — PlatformIO latest documentation
(i.e., just put board = d1_mini_lite
)
2 Likes
I will do so and come back with results.
Thanks once more for your support !
Br Peter
1 Like