Skip to content

Commit

Permalink
Fix tokens generation and WiFi reconnection issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed Feb 7, 2023
1 parent b85527b commit 96f069f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,12 @@
#include <Firebase_ESP_Client.h>

#include <ENC28J60lwIP.h>
//#include <W5100lwIP.h>
//#include <W5500lwIP.h>
// #include <W5100lwIP.h>
// #include <W5500lwIP.h>

/** Don't gorget to define this in FirebaseFS.h
#define ENABLE_ESP8266_ENC28J60_ETH
*/

/** 1 Define the Firebase project Server Key which must be taken from
* https://console.firebase.google.com/u/0/project/_/settings/cloudmessaging
Expand Down Expand Up @@ -112,10 +116,16 @@ void setup()

Serial.printf("Firebase Client v%s\n\n", FIREBASE_CLIENT_VERSION);

// required for legacy HTTP API
// required for legacy HTTP API
#if defined(ENABLE_ESP8266_ENC28J60_ETH)
spi_ethernet_module.enc28j60 = &eth;
// spi_ethernet_module.w5100 = &eth;
// spi_ethernet_module.w5500 = &eth;
#endif
#if defined(ENABLE_ESP8266_W5100_ETH)
spi_ethernet_module.w5100 = &eth;
#endif
#if defined(ENABLE_ESP8266_W5500_ETH)
spi_ethernet_module.w5500 = &eth;
#endif
Firebase.FCM.setServerKey(FIREBASE_FCM_SERVER_KEY, &spi_ethernet_module);

sendMessage();
Expand Down
10 changes: 8 additions & 2 deletions examples/RTDB/BasicEthernet/ESP8266/ESP8266.ino
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,15 @@ void setupFirebase()
config.token_status_callback = tokenStatusCallback; // see addons/TokenHelper.h

/* Assign the pointer to Ethernet module lwip interface */
#if defined(ENABLE_ESP8266_ENC28J60_ETH)
config.spi_ethernet_module.enc28j60 = &eth;
// config.spi_ethernet_module.w5100 = &eth;
// config.spi_ethernet_module.w5500 = &eth;
#endif
#if defined(ENABLE_ESP8266_W5100_ETH)
config.spi_ethernet_module.w5100 = &eth;
#endif
#if defined(ENABLE_ESP8266_W5500_ETH)
config.spi_ethernet_module.w5500 = &eth;
#endif

// Or use legacy authenticate method
// config.database_url = DATABASE_URL;
Expand Down

0 comments on commit 96f069f

Please sign in to comment.