×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

WeatherRadio won't compile with WiFi enabled

  • Posts: 183
  • Thank you received: 23
i *KNOW* this is a me problem, but I have Googled and tried everything I can figure out and am not getting far.

Trying to compile the latest weatherradio.ino with WiFi enabled and am getting the following errors - any thoughts/pointers? I assume I am missing a library, but which one?! :-S

Thanks in advance folks!


Arduino: 1.8.13 (Mac OS X), Board: "Arduino Uno"

/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino: In function 'String getCurrentConfig()':
weatherradio:183:32: error: 'freeMemory' was not declared in this scope
arduinodata["free memory"] = freeMemory();
^~~~~~~~~~
weatherradio:201:22: error: 'esp8266Data' was not declared in this scope
wifidata["SSID"] = esp8266Data.ssid;
^~~~~~~~~~~
weatherradio:202:27: error: 'WiFi' was not declared in this scope
wifidata["connected"] = WiFi.status() == WL_CONNECTED;
^~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:202:27: note: suggested alternative: 'Wire'
wifidata["connected"] = WiFi.status() == WL_CONNECTED;
^~~~
Wire
weatherradio:202:44: error: 'WL_CONNECTED' was not declared in this scope
wifidata["connected"] = WiFi.status() == WL_CONNECTED;
^~~~~~~~~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino: In function 'void setup()':
weatherradio:238:3: error: 'initWiFi' was not declared in this scope
initWiFi();
^~~~~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:238:3: note: suggested alternative: 'init'
initWiFi();
^~~~~~~~
init
weatherradio:240:7: error: 'WiFi' was not declared in this scope
if (WiFi.status() == WL_CONNECTED) {
^~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:240:7: note: suggested alternative: 'Wire'
if (WiFi.status() == WL_CONNECTED) {
^~~~
Wire
weatherradio:240:24: error: 'WL_CONNECTED' was not declared in this scope
if (WiFi.status() == WL_CONNECTED) {
^~~~~~~~~~~~
weatherradio:241:5: error: 'server' was not declared in this scope
server.on("/", []() {
^~~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:241:5: note: suggested alternative: 'perror'
server.on("/", []() {
^~~~~~
perror
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino: In lambda function:
weatherradio:242:7: error: 'server' is not captured
server.send(200, "application/json; charset=utf-8", getSensorData(false));
^~~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:241:21: note: the lambda has no capture-default
server.on("/", []() {
^
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:241:5: note: '<typeprefixerror>server' declared here
server.on("/", []() {
^~~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino: In lambda function:
weatherradio:246:7: error: 'server' is not captured
server.send(200, "application/json; charset=utf-8", getSensorData(false));
^~~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:245:22: note: the lambda has no capture-default
server.on("/w", []() {
^
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:241:5: note: '<typeprefixerror>server' declared here
server.on("/", []() {
^~~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino: In lambda function:
weatherradio:250:7: error: 'server' is not captured
server.send(200, "application/json; charset=utf-8", getSensorData(true));
^~~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:249:22: note: the lambda has no capture-default
server.on("/p", []() {
^
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:241:5: note: '<typeprefixerror>server' declared here
server.on("/", []() {
^~~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino: In lambda function:
weatherradio:254:7: error: 'server' is not captured
server.send(200, "application/json; charset=utf-8", getCurrentConfig());
^~~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:253:22: note: the lambda has no capture-default
server.on("/c", []() {
^
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:241:5: note: '<typeprefixerror>server' declared here
server.on("/", []() {
^~~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino: In lambda function:
weatherradio:258:7: error: 'server' is not captured
server.send(200, "application/json; charset=utf-8", getCurrentVersion());
^~~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:257:22: note: the lambda has no capture-default
server.on("/v", []() {
^
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:241:5: note: '<typeprefixerror>server' declared here
server.on("/", []() {
^~~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino: In lambda function:
weatherradio:262:7: error: 'reset' was not declared in this scope
reset();
^~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:262:7: note: suggested alternative: 'memset'
reset();
^~~~~
memset
weatherradio:263:7: error: 'server' is not captured
server.send(200, "application/json; charset=utf-8", getCurrentVersion());
^~~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:261:22: note: the lambda has no capture-default
server.on("/r", []() {
^
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:241:5: note: '<typeprefixerror>server' declared here
server.on("/", []() {
^~~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino: In lambda function:
weatherradio:267:7: error: 'server' is not captured
server.send(200, "application/json; charset=utf-8", getReadDurations());
^~~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:266:22: note: the lambda has no capture-default
server.on("/t", []() {
^
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:241:5: note: '<typeprefixerror>server' declared here
server.on("/", []() {
^~~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino: In lambda function:
weatherradio:271:7: error: 'server' is not captured
server.send(404, "text/plain", "Ressource not found: " + server.uri());
^~~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:270:24: note: the lambda has no capture-default
server.onNotFound([]() {
^
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:241:5: note: '<typeprefixerror>server' declared here
server.on("/", []() {
^~~~~~
weatherradio:271:64: error: 'server' is not captured
server.send(404, "text/plain", "Ressource not found: " + server.uri());
^~~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:270:24: note: the lambda has no capture-default
server.onNotFound([]() {
^
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:241:5: note: '<typeprefixerror>server' declared here
server.on("/", []() {
^~~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino: In function 'void parseInput()':
weatherradio:312:9: error: 'parseCredentials' was not declared in this scope
parseCredentials(input.substring(2));
^~~~~~~~~~~~~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:312:9: note: suggested alternative: 'HardwareSerial'
parseCredentials(input.substring(2));
^~~~~~~~~~~~~~~~
HardwareSerial
weatherradio:313:7: error: 'disconnectWiFi' was not declared in this scope
disconnectWiFi();
^~~~~~~~~~~~~~
weatherradio:314:7: error: 'initWiFi' was not declared in this scope
initWiFi();
^~~~~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:314:7: note: suggested alternative: 'init'
initWiFi();
^~~~~~~~
init
weatherradio:320:7: error: 'reset' was not declared in this scope
reset();
^~~~~
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino:320:7: note: suggested alternative: 'memset'
reset();
^~~~~
memset
/Users/fance/Downloads/indi-3rdparty-master 2/indi-duino/devices/Firmwares/weatherradio/weatherradio.ino: In function 'void loop()':
weatherradio:343:3: error: 'wifiServerLoop' was not declared in this scope
wifiServerLoop();
^~~~~~~~~~~~~~
exit status 1
'freeMemory' was not declared in this scope


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
3 years 9 months ago #57118

Please Log in or Create an account to join the conversation.

  • Posts: 294
  • Thank you received: 54
Unless you have the Arduino UNO WiFi shield with your UNO, the UNO does not support WiFi. Furthermore, I am not sure Weather Radio supports the UNO with WiFi. You need something like a Wemos D1 or, maybe, an ESP32 based controler.
3 years 9 months ago #57119

Please Log in or Create an account to join the conversation.

  • Posts: 183
  • Thank you received: 23
I chose the Jaycar XC4411 board - which is I understand a copy of the Robotdyn board - robotdyn.com/uno-wifi-r3-atmega328p-esp8...h340g-micro-usb.html

Does the compile error make any sense - I've included all the "device" libraries (BME280 etc), but I am not sure if there's other libraries that need to be installed.
3 years 9 months ago #57120

Please Log in or Create an account to join the conversation.

  • Posts: 294
  • Thank you received: 54
If you already have a Wemos or similar device, you need to install the required libraries (ESP8266 based) and select the appropriate board before compiling. Being away from my PC, I can’t provide the details, sorry.
3 years 9 months ago #57121

Please Log in or Create an account to join the conversation.

  • Posts: 294
  • Thank you received: 54
The code uses ESP8266 specific library defines and functions for WiFi which are likely not supported with the WiFi UNO. That would explain most of the compilation errors you get.
3 years 9 months ago #57122

Please Log in or Create an account to join the conversation.

  • Posts: 183
  • Thank you received: 23
I messed around with the Board config and now that I selected ESP8266 Generic it compiles and uploads, now I just need to get the ESP8266 upload working and I'm golden!
3 years 9 months ago #57123

Please Log in or Create an account to join the conversation.

  • Posts: 294
  • Thank you received: 54
3 years 9 months ago #57126

Please Log in or Create an account to join the conversation.

  • Posts: 183
  • Thank you received: 23
So good news, i managed to get it to compile and what what I can tell, upload - when the DIP switches are in ESP8266 program mode - what I don't understand now is whether I also need to program the Uno or if it all runs as one "Combined" unit now?

Also when setting the SSID am I giving it the SSID of my existing network - in which case where do I set the IP address? - or setting it up as it's own network?
3 years 9 months ago #57127

Please Log in or Create an account to join the conversation.

  • Posts: 294
  • Thank you received: 54
You set the SSID to your home/observatory network, with the appropriate password and, once connected, your router will give it an IP address that you should be able to find out with your router’s ultilities.
3 years 9 months ago #57129

Please Log in or Create an account to join the conversation.

  • Posts: 183
  • Thank you received: 23
thanks - eventually figured it out (connect via serial and then type the "c" command, it's your friend!)

I will have a look and see if I can find a Bonjour protocol provider for the ESP8266 - one step closer to stress free INDI!

On another note, I did figure out how to program teh ESP8266 on this board but the sensors keep registering as failing to init - I then tried compiling without WiFi and installing directly to the Arduino sub-module and it worked great.

It seems this in this case, teh board is acting as a shield, what I have not figured out how to do is to connect the two board together so that the ESP8266 shield can "see" the sensors.

Also - when I enabled the DHT22 sensor I got a strange error during compile saying that it couldn't find the MLX90614.h header - but as soon as I disabled it it complies fine - bug or me being stupid again?

Finally - I couldn't get WeatherRadio see find either the serial or Ethernet version of the board under Kstars on MacOS (3.4.2/3) AND when I went to save the config with Ethernet enabled it crashed the driver. Again, might be a me thing.

Soldiering on, having fun, slowly losing my mind...,
3 years 9 months ago #57141

Please Log in or Create an account to join the conversation.

Time to create page: 0.250 seconds