ESP32 compiling

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
FanM
Normal user
Posts: 35
Joined: 07 Sep 2021, 23:37

ESP32 compiling

#1 Post by FanM » 07 Sep 2021, 23:48

Hi friends!
I have a question about compiling ESPEasy in Arduino IDE.
IDE v.1.8.16
ESP32 sdk 1.0.6
ESPEasy Build is ESPEasy_ESP32_mega-20210802

When trying to compile, i get a lot of errors:

Code: Select all

sketch\src\Commands_tmp\objs.a(__tmpfile.cpp.o): In function `Command_Wifi_Connect(EventStruct*, char const*)':
c:\users\dmitriy\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\bits/stl_map.h:502: multiple definition of `Command_Wifi_Connect(EventStruct*, char const*)'
sketch\src\Commands\objs.a(WiFi.cpp.o):D:\_ESPEASY_\ESP32\ESPEasy\src\Commands/WiFi.cpp:63: first defined here
sketch\src\Commands_tmp\objs.a(__tmpfile.cpp.o): In function `Command_RTC_resetFlashWriteCounter(EventStruct*, char const*)':
__tmpfile.cpp:(.text._Z34Command_RTC_resetFlashWriteCounterP11EventStructPKc+0x0): multiple definition of `Command_RTC_resetFlashWriteCounter(EventStruct*, char const*)'
sketch\src\Commands\objs.a(RTC.cpp.o):D:\_ESPEASY_\ESP32\ESPEasy\src\Commands/RTC.cpp:22: first defined here
sketch\src\Commands_tmp\objs.a(__tmpfile.cpp.o): In function `Command_System_NoSleep(EventStruct*, char const*)':
__tmpfile.cpp:(.text._Z22Command_System_NoSleepP11EventStructPKc+0x0): multiple definition of `Command_System_NoSleep(EventStruct*, char const*)'
sketch\src\Commands\objs.a(System.cpp.o):D:\_ESPEASY_\ESP32\ESPEasy\src\Commands/System.cpp:15: first defined here
sketch\src\Commands_tmp\objs.a(__tmpfile.cpp.o): In function `Command_Wifi_AllowAP(EventStruct*, char const*)':
And that is only beginning. Please help me, what is wrong?

By the way. Compiling for ESP8266 is without errors with same libraries.

One more thing. Flashing the:
ESP_Easy_mega_20210802_normal_ESP32_4M316k-factory.bin
Is OK. ESPEasy works fine.

But i need to add some functions in Arduino IDE.
Actually i need:
1. Get temperature from DS18B20
2. Send that information through the UART of HC-12 module. I have remote display that show that temperature away from ESP32.
3. Send infromation about temperature on remote server with GET request.
I know how to do that by using ESP32 in Arduino IDE withiud any additional firmware. Maybe ESPEasy can do that, i do not know...
Last edited by FanM on 08 Sep 2021, 00:13, edited 1 time in total.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP32 compiling

#2 Post by TD-er » 08 Sep 2021, 09:13

Hmm, how did you obtain the source files?
It looks like a tree of files on which PlatformIO has been compiling.
You can either delete the directories with _tmp in the dir name, or fetch the files from GitHub as a ZIP.

FanM
Normal user
Posts: 35
Joined: 07 Sep 2021, 23:37

Re: ESP32 compiling

#3 Post by FanM » 08 Sep 2021, 09:56

Hi
I use file ESPEasy_ESP32_mega-20210802.zip
bin
Espressif_flash_download_tool_v3.8.5
source

IN SOURCE:

Code: Select all

lib
misc
src
static
tools
README
esp32_partition_app1310k_spiffs1503k.csv
esp32_partition_app1810k_spiffs316k.csv
esp32_partition_app4096k_spiffs1024k.csv
esp32_partition_app4096k_spiffs2048k.csv
esp32_partition_app4096k_spiffs8124k.csv
platformio.ini
platformio_core_defs.ini
platformio_esp32_envs.ini
platformio_esp82xx_base.ini
platformio_esp82xx_envs.ini
platformio_special_envs.ini
README.md
License.txt
requirements.txt
I use folder src, there is file ESPEasy.ino.
Folders ControllerQueue_tmp and PluginStructs_tmp deleted.
The same results.

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP32 compiling

#4 Post by Ath » 08 Sep 2021, 10:14

Hm, those sources are already over a month old, when trying development work, you'd better take the current mega branch (main development branch currently), the green Code button reveals an option to download as ZIP.

And all that combined with my on-going advise to start using VSCode for development ;) https://espeasy.readthedocs.io/en/lates ... ormIO.html
/Ton (PayPal.me)

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP32 compiling

#5 Post by Ath » 08 Sep 2021, 10:27

A big advantage of using the PlatformIO/VSCode combo is that the used libraries are the actually tested ones, as they are part of the configuration, while Arduino IDE expects you to select the 'correct' platform libraries, and especially for ESP32 there is quite some 'volatility' (to say it nicely :? )
/Ton (PayPal.me)

FanM
Normal user
Posts: 35
Joined: 07 Sep 2021, 23:37

Re: ESP32 compiling

#6 Post by FanM » 08 Sep 2021, 10:30

Can you please give me the link for that release.
The only last release i found is
mega-20210802
https://github.com/letscontrolit/ESPEasy/releases
I have no idea where to find a newer one.

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP32 compiling

#7 Post by Ath » 08 Sep 2021, 10:36

When opening the main Github page for ESPEasy, there is a big green Code button. The 'Download ZIP' link will get you the latest.
Screenshot - 8-09-2021 , 10_34_41.png
Screenshot - 8-09-2021 , 10_34_41.png (13.79 KiB) Viewed 6458 times
/Ton (PayPal.me)

FanM
Normal user
Posts: 35
Joined: 07 Sep 2021, 23:37

Re: ESP32 compiling

#8 Post by FanM » 08 Sep 2021, 10:55

That is news for me, thank you. I will try with your lates release.
I have a suggestion. Before there was a different src for ESP8266 and for ESP32. Now you have one for both models?

And do you have any detailed information about every folder that located in your zip files?
I am not programmer, but want to know what they all means and how can i use them.
hooks
misc
patches
static
test
tools

Seems there are many files for python.
Or maybe i do not need to go so far...

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP32 compiling

#9 Post by Ath » 08 Sep 2021, 13:13

FanM wrote: 08 Sep 2021, 10:55 I have a suggestion. Before there was a different src for ESP8266 and for ESP32. Now you have one for both models?
I've been on ESPEasy as a user for 3 years, and as developer for just over a year, but I'm not aware of separate source archives. It is all handled by conditional compilation and running the right (PlatformIO) configurations to get the right build.
That is also one of the reasons I suggest to use VSCode as the development platform.
FanM wrote: 08 Sep 2021, 10:55 And do you have any detailed information about every folder that located in your zip files?
I am not programmer, but want to know what they all means and how can i use them.
hooks
misc
patches
static
test
tools

Seems there are many files for python.
Or maybe i do not need to go so far...
Well, there is some documentation on that, but there is an assumption that you know something about programming/software development in general. The Easy part of ESPEasy is meant to point at the usability of the product, not necessarily on the development side :D

To return to your original question, I think you can already solve it all, but I am not really sure about that serial output, as I've never used that, though the Ser2Net plugin does support a serialsend command, that could help you. There are others here that can help with that.
/Ton (PayPal.me)

FanM
Normal user
Posts: 35
Joined: 07 Sep 2021, 23:37

Re: ESP32 compiling

#10 Post by FanM » 08 Sep 2021, 23:11

Ath, thank you very much for your supporting.
According to your recommendation i've started to work with VSCode (with Platformio). MIf aybe not actually started to work, something like trying to start to work :)
I have some more questions.
1. I've opened Project in VSCode, choose Project task that i need (seems the tasks is located in platformio_esp32_envs.ini file) and Build. All compiled succesfully. Now i have some bin files:
ESP_Easy_mega_20210908_test_A_ESP32_4M316k.bin
ESP_Easy_mega_20210908_test_A_ESP32_4M316k-factory.bin
In theory, is it the same files that we have in bin folder in release?
2. If i need to add some functions in code, just as i told before, where should i place it in code? I want to connect Ds18B20 and the temperature from it send in UART on HC-12 module.
My situation is that i have wood-burning stove with something like water inside. I get temperature from it and send it in blynk (can check it in my cell phone) and send them on my arduino with display and HC-12 (located in my room), to see the current temp.

In Arduino my code was:

Code: Select all

float temp = 0;
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <ESP8266HTTPClient.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <OneWire.h>
#include <DallasTemperature.h>
const char* host = "XXX";
char auth[] = "XXX";
char ssid[] = "XXX";
char pass[] = "XXX";
#define ONE_WIRE_BUS 4
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
  sensors.begin();
}
void loop()
{
  Blynk.run();
  temp = get_temp();
  Serial.println(temp);
  delay(10000);
  Blynk.virtualWrite(10, temp);
}

float get_temp ()
{
  sensors.requestTemperatures();
  temp = (sensors.getTempCByIndex(0));
  delay(1000);
  return (temp);
}
Now i have no idea how to add that in PlatformIO. If possible to make BLynk work too, that will be just fantastic...

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP32 compiling

#11 Post by Ath » 09 Sep 2021, 09:59

Well, as I wrote already, usually there is no need to compile ESPEasy yourself, unless there is something that is not (yet) supported by a component of ESPEasy.
Your requirements and what ESPEasy has to offer:
- DS18b20 sensor: Fully supported
- Serial communication: Supported
- Blynk controller: Supported on ESP8266, for ESP32 it needs an update of the library used (the old lib didn't support ESP32).
- HTTP GET for sending data out: Fully supported

For some of the features you will probably have to use rules, f.e. the serial out, as that could use the Serial Server plugin.

I'll first take a step back to explain some concepts of ESPEasy, just to make things more clear.

- ESPEasy has a concept of 'Plugins' for retrieving data or send data to a display, that can be configured in Tasks (Devices tab). Every active task will be 'run' on an interval base (there are several intervals, but the data reading is usually user-configurable)
- There are also 'Controllers', that can send out data to an external destination, f.e. the HTTP controller, Domoticz, Blynk and MQTT (Home Assistant, etc.). Each task can be 'connected' to 0 or more of these controllers to send out the available data.
- And then there is the concept of 'Events' that are generated and 'Rules' to handle these, f.e. when new data is available, or some system event has occurred, like the time (HH:MM) has changed, WiFi is (dis)connected, etc. In 'rules' you can script what needs to happen with that event, f.e. send out a http get request (though you can also use a controller for that), or write data to the serial port, or change the state of a GPIO pin. In rules you can also do calculations, and it supports if/then/else structures.

I may have forgotten some stuff, but these are the most important concepts ;)
/Ton (PayPal.me)

FanM
Normal user
Posts: 35
Joined: 07 Sep 2021, 23:37

Re: ESP32 compiling

#12 Post by FanM » 09 Sep 2021, 10:22

Thank you very much! That information is very useful for me. I will move on...

FanM
Normal user
Posts: 35
Joined: 07 Sep 2021, 23:37

Re: ESP32 compiling

#13 Post by FanM » 12 Sep 2021, 18:15

Hi there!
Tell me please, how to add blynk controller in ESPEasy firmware. Seems in default it is not presents, need to do something.
I do not see it in the list of controllers.

Post Reply

Who is online

Users browsing this forum: No registered users and 33 guests