Skip to content

Commit e56821b

Browse files
committed
Fix compatibility issues with ESP32
1 parent 428f11d commit e56821b

File tree

12 files changed

+24
-18
lines changed

12 files changed

+24
-18
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ install:
2626
- platformio lib update
2727

2828
script:
29-
- platformio ci --lib="." --project-option="lib_deps=JsonStreamingParser" --board=nodemcuv2
29+
- platformio ci --lib="." --project-option="lib_deps=JsonStreamingParser" --board=nodemcuv2

examples/MetOfficeDemo/oneDayForecaster.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535

3636
#include <Arduino.h>
3737
#include <SD.h>
38-
#include <ESP8266WiFi.h>
39-
#include <ESP8266HTTPClient.h>
38+
#include <ESPWiFi.h>
39+
#include <ESPHTTPClient.h>
4040
#include <ArduinoOTA.h>
4141
#include <ESP8266mDNS.h>
4242
#include <Adafruit_GFX.h>

examples/PlaneSpotterDemo/AdsbExchangeClient.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ See more at http://blog.squix.ch
2727

2828
#include <JsonListener.h>
2929
#include <JsonStreamingParser.h>
30-
#include <ESP8266WiFi.h>
30+
#include <ESPWiFi.h>
3131
#include <WiFiClient.h>
3232

3333
#define CURRENT 0

examples/PlaneSpotterDemo/PlaneSpotterDemo.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ SOFTWARE.
2323
See more at http://blog.squix.ch
2424
*/
2525
#include <Arduino.h>
26-
#include <ESP8266WiFi.h>
27-
#include <ESP8266HTTPClient.h>
26+
#include <ESPWiFi.h>
27+
#include <ESPHTTPClient.h>
2828
#include <Ticker.h>
2929
#include <JsonListener.h>
3030
#include <ArduinoOTA.h>

examples/WeatherStationDemo/WeatherStationDemo.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ See more at http://blog.squix.ch
2424
*/
2525

2626
#include <ESPWiFi.h>
27+
#include <ESPHTTPClient.h>
2728
#if defined(ESP8266)
2829
#include <Ticker.h>
2930
#endif
@@ -180,7 +181,7 @@ void setup() {
180181
Serial.println("");
181182

182183
updateData(&display);
183-
184+
184185
#if defined(ESP8266)
185186
ticker.attach(UPDATE_INTERVAL_SECS, setReadyForWeatherUpdate);
186187
#endif

src/ESPHTTPClient.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#if defined(ESP8266)
2+
#include <ESP8266HTTPClient.h>
3+
#else
4+
#include <HTTPClient.h>
5+
#endif

src/MetOfficeClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* from the api response above.
4242
*/
4343

44-
#include <ESP8266WiFi.h>
44+
#include <ESPWiFi.h>
4545
#include "MetOfficeClient.h"
4646

4747
MetOfficeClient::MetOfficeClient() {

src/WundergroundAlerts.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ See more at http://blog.squix.ch
2525

2626
#include <ESPWiFi.h>
2727
#include <WiFiClient.h>
28-
#include <ESP8266HTTPClient.h>
28+
#include <ESPHTTPClient.h>
2929
#include "WundergroundAlerts.h"
3030

3131
WundergroundAlerts::WundergroundAlerts() {

src/WundergroundAstronomy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ See more at http://blog.squix.ch
2525

2626
#include <ESPWiFi.h>
2727
#include <WiFiClient.h>
28-
#include <ESP8266HTTPClient.h>
28+
#include <ESPHTTPClient.h>
2929
#include "WundergroundAstronomy.h"
3030

3131

src/WundergroundConditions.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ See more at http://blog.squix.ch
2525

2626
#include <ESPWiFi.h>
2727
#include <WiFiClient.h>
28-
#include <ESP8266HTTPClient.h>
28+
#include <ESPHTTPClient.h>
2929
#include "WundergroundConditions.h"
3030

3131
WundergroundConditions::WundergroundConditions(boolean _isMetric) {
@@ -53,7 +53,7 @@ void WundergroundConditions::updateConditionsPWS(WGConditions *conditions, Strin
5353
void WundergroundConditions::doUpdate(WGConditions *conditions, String url) {
5454
unsigned long lostTest = 10000UL;
5555
unsigned long lost_do = millis();
56-
56+
5757
this->conditions = conditions;
5858
JsonStreamingParser parser;
5959
parser.setListener(this);
@@ -76,7 +76,7 @@ void WundergroundConditions::doUpdate(WGConditions *conditions, String url) {
7676
while((size = client->available()) > 0) {
7777
if ((millis() - lost_do) > lostTest) {
7878
Serial.println ("lost in client with a timeout");
79-
client->stop();
79+
client->stop();
8080
ESP.restart();
8181
}
8282
c = client->read();

0 commit comments

Comments
 (0)