Ардуинщики всех стран - объединяйтесь! В этом форуме, конечно.
Ответить

переделка скетча из ESP8266 в ESP32

Пт ноя 19, 2021 16:19:31

Всем привет!
Хочу повторить проект погодной станции: https://www.instructables.com/ESP8266-W ... idget-V20/

Это небольшое устройство на ESP8266 и TFT дисплее, показывающее прогноз погоды. Файлы проекта: https://github.com/ThingPulse/esp8266-w ... tion-color

Скетч скачал, все необходимые библиотеки установил. Для ESP8266 компиляция проходит без проблем.
Но у меня нет отдельно дисплея, есть TFT шилд с ESP32 на борту, то есть TSP32 и TFT дисплей распаяны на одном текстолите.
Попробовал откомпиллировать для ESP32 - куча ошибок! Большинство удалось убрать. Но с некоторыми не знаю что делать:

Лог компиляции:
Спойлерesp8266-weather-station-color:82:9: error: expected constructor, destructor, or type conversion before '(' token
E:\Home Made\Создать\1- ESP8266 Weather Widget V2.0\esp8266-weather-station-color\esp8266-weather-station-color.ino: In function 'void initTime()':
esp8266-weather-station-color:164:30: error: invalid conversion from 'const char*' to 'long int' [-fpermissive]
In file included from E:\Home Made\Создать\1- ESP8266 Weather Widget V2.0\esp8266-weather-station-color\esp8266-weather-station-color.ino:35:
settings.h:78:21: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
#define NTP_SERVERS "pool.ntp.org"
^~~~~~~~~~~~~~
E:\Home Made\Создать\1- ESP8266 Weather Widget V2.0\esp8266-weather-station-color\esp8266-weather-station-color.ino:164:34: note: in expansion of macro 'NTP_SERVERS'
esp8266-weather-station-color:164:45: error: too few arguments to function 'void configTime(long int, int, const char*, const char*, const char*)'
In file included from E:\Home Made\Создать\1- ESP8266 Weather Widget V2.0\esp8266-weather-station-color\esp8266-weather-station-color.ino:29:
C:\Users\�����\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.1\cores\esp32/Arduino.h:186:17: note: declared here
extern "C" void configTime(long gmtOffset_sec, int daylightOffset_sec,
^~~~~~~~~~
E:\Home Made\Создать\1- ESP8266 Weather Widget V2.0\esp8266-weather-station-color\esp8266-weather-station-color.ino: In function 'void loop()':
esp8266-weather-station-color:294:27: error: 'WAKE_RF_DEFAULT' was not declared in this scope
E:\Home Made\Создать\1- ESP8266 Weather Widget V2.0\esp8266-weather-station-color\esp8266-weather-station-color.ino:294:27: note: suggested alternative: 'EMAC_CLK_DEFAULT'
E:\Home Made\Создать\1- ESP8266 Weather Widget V2.0\esp8266-weather-station-color\esp8266-weather-station-color.ino: In function 'void drawAbout()':
esp8266-weather-station-color:627:48: error: 'class EspClass' has no member named 'getFlashChipRealSize'; did you mean 'getFlashChipSize'?
esp8266-weather-station-color:629:47: error: 'class EspClass' has no member named 'getChipId'; did you mean 'getChipModel'?
esp8266-weather-station-color:630:44: error: 'class EspClass' has no member named 'getVcc'
esp8266-weather-station-color:646:55: error: 'class EspClass' has no member named 'getResetInfo'
Несколько библиотек найдено для "WiFi.h"
Используется: C:\Users\Игорь\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.1\libraries\WiFi
Не используется: C:\Program Files (x86)\Arduino\libraries\WiFi
exit status 1
expected constructor, destructor, or type conversion before '(' token

Что можете посоветовать? Как исправить эти ошибки?
Прикрепляю файлы проекта.

Добавлено after 2 minutes:
У меня была установлено ядро ESP32 версии 2.0.1, попробовал установить 1.0.4 и откомпиллировать и все равно ошибки, хоть и немного другие:
Спойлерesp8266-weather-station-color:82:9: error: expected constructor, destructor, or type conversion before '(' token
E:\Home Made\Создать\1- ESP8266 Weather Widget V2.0\esp8266-weather-station-color\esp8266-weather-station-color.ino: In function 'void connectWifi()':
esp8266-weather-station-color:141:10: error: 'class WiFiClass' has no member named 'hostname'
E:\Home Made\Создать\1- ESP8266 Weather Widget V2.0\esp8266-weather-station-color\esp8266-weather-station-color.ino: In function 'void initTime()':
esp8266-weather-station-color:164:30: error: invalid conversion from 'const char*' to 'long int' [-fpermissive]
esp8266-weather-station-color:164:45: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
esp8266-weather-station-color:164:45: error: too few arguments to function 'void configTime(long int, int, const char*, const char*, const char*)'
In file included from E:\Home Made\Создать\1- ESP8266 Weather Widget V2.0\esp8266-weather-station-color\esp8266-weather-station-color.ino:29:0:
C:\Users\�����\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:173:17: note: declared here
extern "C" void configTime(long gmtOffset_sec, int daylightOffset_sec,
^
E:\Home Made\Создать\1- ESP8266 Weather Widget V2.0\esp8266-weather-station-color\esp8266-weather-station-color.ino: In function 'void loop()':
esp8266-weather-station-color:294:27: error: 'WAKE_RF_DEFAULT' was not declared in this scope
E:\Home Made\Создать\1- ESP8266 Weather Widget V2.0\esp8266-weather-station-color\esp8266-weather-station-color.ino: In function 'void drawAbout()':
esp8266-weather-station-color:627:48: error: 'class EspClass' has no member named 'getFlashChipRealSize'
esp8266-weather-station-color:629:47: error: 'class EspClass' has no member named 'getChipId'
esp8266-weather-station-color:630:44: error: 'class EspClass' has no member named 'getVcc'
esp8266-weather-station-color:646:55: error: 'class EspClass' has no member named 'getResetInfo'
Несколько библиотек найдено для "WiFi.h"
Используется: C:\Users\Игорь\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\WiFi
Не используется: C:\Program Files (x86)\Arduino\libraries\WiFi
exit status 1
expected constructor, destructor, or type conversion before '(' token

Изображение
Вложения
esp8266-weather-station-color.zip
(60.04 KiB) Скачиваний: 105

Re: переделка скетча из ESP8266 в ESP32

Пт ноя 19, 2021 18:50:38

Гдето была статья с описанием различий. Но точно не в википедии где нихрена не понятно и неинформативно.
Ну а пока заказал с китая 8266, посмотрим увидим
Ответить