nRF905-API icon indicating copy to clipboard operation
nRF905-API copied to clipboard

Compilation Error, undeclared frame and wifi

Open mrtnkhl opened this issue 1 year ago • 4 comments

Arduino IDE v2.3.4 (2024-12-03) Board: DOIT ESP32 DEVKITV1

Just cloned the repository today and tried to compile the code. Getting the below listed errors.

/Users/user/Documents/Projects/Zehnder/nrf905/nRF905-API/src/nRF905API/fan.cpp: In member function 'size_t Fan::discover(uint8_t, uint32_t)':
/Users/user/Documents/Projects/Zehnder/nrf905/nRF905-API/src/nRF905API/fan.cpp:117:46: error: 'FAN_FRAME_04' was not declared in this scope; did you mean 'FAN_FRAME_0B'?
  117 |                                         case FAN_FRAME_04 :     // Main unit link was succesful (acknowledge) BETA TESTING for ComfoAir E300 RF
      |                                              ^~~~~~~~~~~~
      |                                              FAN_FRAME_0B
/Users/user/Documents/Projects/Zehnder/nrf905/nRF905-API/src/nRF905API/nRF905API.ino: In function 'void setup()':
/Users/user/Documents/Projects/Zehnder/nrf905/nRF905-API/src/nRF905API/nRF905API.ino:77:9: error: 'WiFi' was not declared in this scope
   77 |         WiFi.mode(WIFI_OFF);
      |         ^~~~
/Users/user/Documents/Projects/Zehnder/nrf905/nRF905-API/src/nRF905API/nRF905API.ino:77:19: error: 'WIFI_OFF' was not declared in this scope; did you mean 'WIFI_IF_AP'?
   77 |         WiFi.mode(WIFI_OFF);
      |                   ^~~~~~~~
      |                   WIFI_IF_AP
/Users/user/Documents/Projects/Zehnder/nrf905/nRF905-API/src/nRF905API/nRF905API.ino:82:27: error: 'WIFI_STA' was not declared in this scope; did you mean 'WIFI_IF_STA'?
   82 |                 WiFi.mode(WIFI_STA);
      |                           ^~~~~~~~
      |                           WIFI_IF_STA
/Users/user/Documents/Projects/Zehnder/nrf905/nRF905-API/src/nRF905API/nRF905API.ino:88:42: error: 'WL_CONNECTED' was not declared in this scope
   88 |                 while ((WiFi.status() != WL_CONNECTED) && (wifi_connect_retries < MAX_WIFI_CONNECT_RETRIES)) {
      |                                          ^~~~~~~~~~~~
/Users/user/Documents/Projects/Zehnder/nrf905/nRF905-API/src/nRF905API/nRF905API.ino:101:30: error: 'WL_CONNECTED' was not declared in this scope
  101 |         if (WiFi.status() != WL_CONNECTED) {
      |                              ^~~~~~~~~~~~
/Users/user/Documents/Projects/Zehnder/nrf905/nRF905-API/src/nRF905API/nRF905API.ino:107:27: error: 'WIFI_AP' was not declared in this scope; did you mean 'WIFI_IF_AP'?
  107 |                 WiFi.mode(WIFI_AP);
      |                           ^~~~~~~
      |                           WIFI_IF_AP
Multiple libraries were found for "EEPROM.h"
  Used: /Users/user/Library/Arduino15/packages/esp32/hardware/esp32/3.0.7/libraries/EEPROM
  Not used: /Users/user/Documents/Arduino/libraries/M2RET
exit status 1

Compilation error: 'FAN_FRAME_04' was not declared in this scope; did you mean 'FAN_FRAME_0B'?

mrtnkhl avatar Dec 13 '24 13:12 mrtnkhl

I'm getting the same error and while the PR from @cdamman fixes the FAN_FRAME error, I also get the WiFi errors I see in your message when using my ESP32 DEV board and the PR doesn't fix that unfortunately. So if anyone knows hw to fix that part, I'm very interested

BasKloet avatar Dec 17 '24 10:12 BasKloet

same errors here weeks ago. I've removed the FAN_FRAME_04 code part (put case FAN_FRAME_04 in comment) and included wifi....h files include in numerous files, then it compiled completely. Added :

#include <WiFi.h>

to : /nRF905API.ino /api/json_api_v1.cpp /html/configwizard.cpp /html/html.cpp /hardware/esp32.cpp

also had to change in /hardware/esp32.cpp :

String Board::get_localIPv6(void) {
	return WiFi.localIP().toString();
}
bool Board::enable_IPv6(void) {
	return WiFi.enableIPv6();
}

Best is that the project owner fixes this in main branch.

8OND007 avatar Dec 19 '24 12:12 8OND007

@8OND007 Thanks for your reply, I got it to work perfectly by combining the PR by @cdamman with your changes. So thank you very much!

BasKloet avatar Dec 23 '24 15:12 BasKloet

Hello, just got an ESP32 board 🙂 Pushed the fix in my PR as well! https://github.com/eelcohn/nRF905-API/pull/33/commits/9e9b9406a76b4302cfc1eda17155121884944a9b

cdamman avatar Dec 23 '24 17:12 cdamman