Help needed for ESP8266, GPS neo6m and Firebase



  • Good day all,
    I'm trying to upload the GPS neo-6m data to the firebase realtime database through the ESP8266 wifi module. but, after I uploaded the code nothing happen to the firebase and I can't find the latitude and longitude in the firebase.
    can you please have a look at my code, please? I didn't receive any error messages when I uploaded the code.

    
    #include <TinyGPS++.h>
    #include <SoftwareSerial.h>
    #include <ESP8266WiFi.h>
    #include <FirebaseArduino.h>
    #include <ArduinoJson.h>
    
    
    #define FIREBASE_HOST 
    #define FIREBASE_AUTH 
    #define WIFI_SSID 
    #define WIFI_PASSWORD
    
    
    static const int RXPin =0, TXPin =2;
    
    static const uint32_t GPSBaud = 9600;
    
    
    TinyGPSPlus gps;
    
    
    
    // The serial connection to the GPS device
    
    SoftwareSerial ss(RXPin, TXPin);
    
    void setup() {
       Serial.begin(9600);  
    
      // connect to wifi.
      WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
      Serial.print("connecting");
      while (WiFi.status() != WL_CONNECTED) {
        Serial.print(".");
        delay(500);
      }
      Serial.println();
      Serial.print("connected: ");
      Serial.println(WiFi.localIP());
      
      Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
      Serial.begin(9600);
    ss.begin(GPSBaud);
     //Serial.println("a");
    }
    
      
    void loop() {
    
     while (ss.available() > 0){
    
        gps.encode(ss.read());
    
        if (gps.location.isUpdated()){
          
          Serial.print("Latitude= ");
          Serial.print(gps.location.lat(), 6);
          Firebase.pushString("/lat", "sd");
    
          Serial.print(" Longitude= ");
         Serial.println(gps.location.lng(), 6);
         Firebase.pushString("/lng", "sd");
        }
    
    
     }}
    


  • @Sara , are you able to see the Latitude and longitude on the Serial Monitor ? and are you getting any error or something?



  • @salmanfaris yes I can see the latitude and longitude on the serial monitor and when I used them on the google map I can see my house. Also, there are no error messages received.



  • @Sara try this code.

    #include <WiFi.h> // esp32 library
    
    #include <IOXhop_FirebaseESP32.h>  // firebase library
    
    #define FIREBASE_HOST "led-control-4631d.firebaseio.com"// the project name address from firebase id
    
    #define FIREBASE_AUTH "Your Firebase secret key" // the secret key generated from firebase
    
    #define WIFI_SSID "Your SSID"  // input your home or public wifi name
    
    #define WIFI_PASSWORD "Your Passcode"   //password of wifi ssid
    
    String fireStatus = ""; // led status received from firebase
    
    void setup() {
    
      Serial.begin(9600);
    
      delay(1000);
               
    
      WiFi.begin(WIFI_SSID, WIFI_PASSWORD); //try to connect with wifi
    
      Serial.print("Connecting to ");
    
      Serial.print(WIFI_SSID);
    
      while (WiFi.status() != WL_CONNECTED) {
    
        Serial.print(".");
    
        delay(500);
    
      }
    
      Serial.println();
    
      Serial.print("Connected to ");
    
      Serial.println(WIFI_SSID);
    
      Serial.print("IP Address is : ");
    
      Serial.println(WiFi.localIP());      //print local IP address
    
      Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);   // connect to firebase
    
      Firebase.setString("Your feedname", "your value");     //send initial string of led status
    
    }
    


  • @kowshik1729 I received this error message

    Arduino: 1.8.12 (Windows Store 1.8.33.0) (Windows 10), Board: "Generic ESP8266 Module, 80 MHz, Flash, ck, 26 MHz, 40MHz, QIO, 512K (no SPIFFS), 2, v2 Lower Memory, Serial, None, Only Sketch, 115200"

    sketch_mar22b:3:55: fatal error: IOXhop_FirebaseESP32.h: No such file or directory

    #include <IOXhop_FirebaseESP32.h> // firebase library

                                                       ^
    

    compilation terminated.

    exit status 1
    IOXhop_FirebaseESP32.h: No such file or directory

    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.



  • @Sara https://github.com/ioxhop/IOXhop_FirebaseESP32 Go to this site. Download the zip file.

    Go to your sketch in Arduino IDE -> include .ZIP library -> browse and select your zip file. This will install your library.

    Then try compiling your code.



  • @kowshik1729 still I'm receiving error messages. I think because the esp is different from the esp that mentioned in the code.



  • Yeah, I knew that. Typically ESP8266 can compile most of the codes of ESP32. That's why I asked to compile it once. I will get back to you with one more option.



  • @Sara https://www.instructables.com/id/Esp8266-Firebase-Connection/

    Please try the instructions here step by step and try it.



  • @kowshik1729 I already did the same steps previously with no result.


Log in to reply
 

Recent Posts

  • @Suhailjr But I think since it's not a plug and plug play system and it will laying on the PCB for the long term, it might be fine. for me, it's similar to the Intel Edison and the PICO-IMX7 System-on-Module

    dade502a-71f6-4da0-bd7d-0e9a0b602cb0-image.png

    a4b8898f-90d4-4a34-ba5d-81ab76fda904-image.png

    read more
  • @salmanfaris at last they update their design. T
    What you think on the updated connector. I felt like its more fragile and high chance for corottion issue due to humidity for long term use.

    read more
  • Built on the same 64-bit quad-core BCM2711 application processor as Raspberry Pi 4, Compute Module 4 delivers a step-change in performance over its predecessors: faster CPU cores, better multimedia, more interfacing capabilities, and, for the first time, a choice of RAM densities and a wireless connectivity option.

    3094f292-3301-4364-a444-d828f6e77ff8-image.png

    You can find detailed specs here,

    1.5GHz quad-core 64-bit ARM Cortex-A72 CPU VideoCore VI graphics, supporting OpenGL ES 3.x 4Kp60 hardware decode of H.265 (HEVC) video 1080p60 hardware decode, and 1080p30 hardware encode of H.264 (AVC) video Dual HDMI interfaces, at resolutions up to 4K Single-lane PCI Express 2.0 interface Dual MIPI DSI display, and dual MIPI CSI-2 camera interfaces 1GB, 2GB, 4GB or 8GB LPDDR4-3200 SDRAM Optional 8GB, 16GB or 32GB eMMC Flash storage Optional 2.4GHz and 5GHz IEEE 802.11b/g/n/ac wireless LAN and Bluetooth 5.0 Gigabit Ethernet PHY with IEEE 1588 support 28 GPIO pins, with up to 6 × UART, 6 × I2C and 5 × SPI

    31354fad-6332-40e8-b324-53e0aa5dbace-image.png

    Compute Module 4 IO Board
    89a3b68b-bb74-4002-9c2b-d32c2e1450b3-image.png

    The IO board provides:

    Two full-size HDMI ports Gigabit Ethernet jack Two USB 2.0 ports MicroSD card socket (only for use with Lite, no-eMMC Compute Module 4 variants) PCI Express Gen 2 x1 socket HAT footprint with 40-pin GPIO connector and PoE header 12V input via barrel jack (supports up to 26V if PCIe unused) Camera and display FPC connectors Real-time clock with battery backup

    More details:
    https://www.raspberrypi.org/products/compute-module-4/?variant=raspberry-pi-cm4001000, https://www.raspberrypi.org/blog/raspberry-pi-compute-module-4/

    read more
  • 28e1870e-33fe-4791-bc74-05c9d58098da-image.png

    Seeed is currently counting down for the 10 year anniversary of the debut of Grove 🎉. In the past 10 years, we have seen many wonderful projects created by Grove from our user and community. We want to invite you to join us to celebrate the 10 year anniversary of Grove 🤩.

    In the Grove 10 Years Celebration, we’d like to collect the stories of “Grove with You”, which we want to invite our users to share their stories they have with Grove products.

    => What project you’ve made out of Grove?
    => What is your favourite Grove?
    => which one was the first Grove you’ve purchased?

    Seeed encourages you to post and share photos, videos, stories of Grove in the Seeeed Forum, or any other platforms below that you’d like to use.

    The following ways to find us, and tag #grove10 to share the project with us!

    Twitter (@seeedstudio) Instagram (@seeedstudio) or simply email your project to grove10@seeed.cc

    Feel free to be creative in documenting your projects–we will be selecting top 10 most “Grovy” winning entries from the submissions, and the winners will receive a $100 Grove Surprise Pack 😋 as a special gift.

    Looking forward to seeing your projects! 🥳

    read more
  • @kowshik1729 I think that might not get since the platform is not opensource! but they provided everything you need to develop a system with that.

    read more