MailBoxGuard icon indicating copy to clipboard operation
MailBoxGuard copied to clipboard

Compilation error: 'WiFi' was not declared in this scope

Open leafkicker opened this issue 1 year ago • 3 comments

When verifying the LoRa_Gateway_HARestAPI.ino code in Arduino I always receive the following error:

`C:\temp\MailBoxGuard-main\Code\Arduino\LoRa_Gateway\LoRa_Gateway_HARestAPI\LoRa_Gateway_HARestAPI.ino: In function 'void setup_wifi()': C:\temp\MailBoxGuard-main\Code\Arduino\LoRa_Gateway\LoRa_Gateway_HARestAPI\LoRa_Gateway_HARestAPI.ino:42:3: error: 'WiFi' was not declared in this scope 42 | WiFi.begin(ssid, password); | ^~~~ C:\temp\MailBoxGuard-main\Code\Arduino\LoRa_Gateway\LoRa_Gateway_HARestAPI\LoRa_Gateway_HARestAPI.ino:44:27: error: 'WL_CONNECTED' was not declared in this scope 44 | while (WiFi.status() != WL_CONNECTED) { | ^~~~~~~~~~~~ Multiple libraries were found for "SSD1306Wire.h" Used: C:\Users\Ryan\Documents\Arduino\libraries\ESP8266_and_ESP32_OLED_driver_for_SSD1306_displays Not used: C:\Users\Ryan\Documents\Arduino\libraries\SSD1306 exit status 1

Compilation error: 'WiFi' was not declared in this scope`

I have spent hours trying to find this problem, testing with different computers and versions but I am unable to get this to work.

leafkicker avatar Feb 25 '25 20:02 leafkicker

Fixed I added "#include <WiFi.h>" Can I ask why you chose "LoRa_Gateway_HARestAPI.ino" firmware? with that firmware, the gateway firmware is not universal. consider using "MQTT_JSON" so you can add other DIY devices too, for more info check the Capibridge repo

PricelessToolkit avatar Feb 25 '25 22:02 PricelessToolkit

If everything worked, please let me know so I can close this issue.

PricelessToolkit avatar Feb 26 '25 02:02 PricelessToolkit

thankyou it works!

leafkicker avatar Feb 27 '25 21:02 leafkicker