switchdoclabs / OurWeatherWeatherPlus

OurWeather Software for WeatherPlus Board - creates (or you rename) a directory called "SDL_ESP8266_WeatherPlus"
http://www.switchdoc.com
20 stars 32 forks source link

Unresolved includes #16

Open gb0101010101 opened 5 years ago

gb0101010101 commented 5 years ago

There are a number of includes that fail to resolve when building on linux.

I have installed ESP8266 boards from http://arduino.esp8266.com/stable/package_esp8266com_index.json but could only find "Adafruit Feather HUZZAH ESP8266" and not "Adafruit HUZZAH ESP8266" as stated in BUILD.MD. Is this the correct board?

Directions from Adafruit say to use this board: https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/using-arduino-ide

'#include "Wire.h"' used in multiple libraries point to local file that does not exist. Is this supposed to be '#include ' which would use the file from the ESP8266 library?

'#include "Crc16.h"' in SDL_ESP8266_WeatherPlus.ino. Local file is lowercase 'crc16.h' and therefore fails to include on Case Sensitive Linux OS. Renaming file solves the problem. Same goes for '#include "elapsedMillis.h"' in same INO file.

Conversely there is '#include ' which should be lowercase '#include '

Then it gets a bit more complex. There is '#include ' in SDL_Weather_80422.cpp. Is this supposed to use the local file 'TimeLib.h' or '#include ' or 'Time' library by Michael Margolis?

Finally there is '#include "user_interface.h"' in local WifiManager.h. "user_interface.h" is not in your repo.

I see that others have brought up similar issues but they were not fixed in repo: https://github.com/switchdoclabs/OurWeatherWeatherPlus/issues/2 https://github.com/switchdoclabs/OurWeatherWeatherPlus/issues/4 https://github.com/switchdoclabs/OurWeatherWeatherPlus/issues/14

Thanks for any info you provide. Should be receiving my kit in 2 days and would like to get the code compiling before then.

switchdoclabs commented 5 years ago

Hi,

We usually answer these questions over on the Forum at forum.switchdoc.com http://forum.switchdoc.com/

What IDE are you using to build with?

Here are some answers partially at least:

On Mar 20, 2019, at 2:50 PM, gb0101010101 notifications@github.com wrote:

There are a number of includes that fail to resolve when building on linux.

I have installed ESP8266 boards from http://arduino.esp8266.com/stable/package_esp8266com_index.json http://arduino.esp8266.com/stable/package_esp8266com_index.json but could only find "Adafruit Feather HUZZAH ESP8266" and not "Adafruit HUZZAH ESP8266" as stated in BUILD.MD. Is this the correct board?

Yes

Directions from Adafruit say to use this board: https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/using-arduino-ide https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/using-arduino-ide '#include "Wire.h"' used in multiple libraries point to local file that does not exist. Is this supposed to be '#include ' which would use the file from the ESP8266 library?

I’d have to say that I’m not sure. We compile it using the Arduino IDE and it is resolved correctly. If it compiles the other way, then you are probably right. Note: Libraries and the Arduino IDE is one of the big problem with moving distributions from one place to another as far as IDEs go.

'#include "Crc16.h"' in SDL_ESP8266_WeatherPlus.ino. Local file is lowercase 'crc16.h' and therefore fails to include on Case Sensitive Linux OS. Renaming file solves the problem. Same goes for '#include "elapsedMillis.h"' in same INO file.

Yes, that makes sense. Conversely there is '#include ' which should be lowercase '#include '

Same as above. Then it gets a bit more complex. There is '#include ' in SDL_Weather_80422.cpp. Is this supposed to use the local file 'TimeLib.h' or '#include ' or 'Time' library by Michael Margolis?

This is a real problem. I believe TimeLib.h is correct, but again it depends. Oh, that is a bit of a pun. Finally there is '#include "user_interface.h"' in local WifiManager.h. "user_interface.h" is not in your repo.

OK, I don’t have that repo here to check. I can check it later at the lab. Again, we use the Arduino IDE on Mac and Windows to compile. Even if I am a Linux guy.

Best regards,

John Shovic

I see that others have brought up similar issues but they were not fixed in repo:

2 https://github.com/switchdoclabs/OurWeatherWeatherPlus/issues/2

4 https://github.com/switchdoclabs/OurWeatherWeatherPlus/issues/4

14 https://github.com/switchdoclabs/OurWeatherWeatherPlus/issues/14

Thanks for any info you provide. Should be receiving my kit in 2 days and would like to get the code compiling before then.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/switchdoclabs/OurWeatherWeatherPlus/issues/16, or mute the thread https://github.com/notifications/unsubscribe-auth/AHEsSHQ2esDxBWC3bTd2_2C457p4wW09ks5vYq0ygaJpZM4cAVxq.

gb0101010101 commented 5 years ago

Hi John,

Thanks for the prompt reply. I managed to get it to compile with the following changes:

include "Wire.h" -> #include

include "Crc16.h" -> Renamed file from repo to match

include "elapsedMillis.h" -> Renamed file from repo to match

include -> #include

include -> #include

include "user_interface.h" problem disappeared without me changing anything. No I dea why it happened.

Also had to modify 2 occurrences of Wire.requestFrom() in WXLink.h Wire.requestFrom(0x08, 32, true); -> Wire.requestFrom(8, 32, 1); This is using ESP8266 Wire v2.4.2 library. I think the 2nd value was wrong type but chnaged all to 'int' to match candidate for an easier change.

Will post other issues on the Switchdoc Forum of which hopefully there will be none. Just wanted to respond here so that others would know what needed to be changed.

ConorIA commented 4 years ago

Thank you @gb0101010101 for this guide. I followed your indications in https://github.com/switchdoclabs/OurWeatherWeatherPlus/issues/16#issuecomment-475109321 and managed to compile. The changes should be made in the repo. I may do my part and open a PR later in the week. Also, I found that WifiManager.h needs to be updated for newer versions of the https://github.com/esp8266/Arduino. (I was running into this bug) Instead of taking on that challenge, I just installed version 2.5.0 (I tried to guess what version may have been used to compile here) and that worked.

EDIT: I see @gb0101010101 has already made substantial changes on their fork. Amazing. Some of the improvements could be cherry-picked back here. I have a question about one of the commits, but issues on the fork are disabled and no email is on the profile. @gb0101010101, please send me an email at conor@conr.ca if you don't mind me asking about the AM2315 driver.

MrDornback commented 4 years ago

A word of advice, which bit me in my backside when I wasn't paying attention. If you change includes from local "" to global <>, you may be missing some custom functions/handlers that are specific to the SDL software and .h .cpp files.

I found this when dealing with an HTTP_HEAD re-declaration issue...
https://github.com/switchdoclabs/OurWeatherWeatherPlus/pull/23