This is an old revision of the document!
Student: Alexandru Rares Apostol, ACES
The purpose of this project involves the development of a GNSS receiver for land surveying applications. The receiver will provide accurate positioning on-site and provide a user friendly application for viewing the generated perimeters. All these features will be available at the press of a button, where the precise position will be stored in a database.
The hardware components needed for this project are:
Fig. 2.1. - Overview
Fig. 2.2. - Electrical wiring
The following flowchart of the software architecture shows the states and transitions which the application will execute. Initially, the application configures the required peripherals and I/Os and then performs updates on the incoming NMEA sentences. When an interrupt is detected on the designated digital I/O pins, the application performs additional instructions in which it constructs the GeoJSON and sends it to the remote database.
In this section I will describe the configurations implemented in order to obtain the desired functionality. The code starts by including the Firebase libraries which are used by the ESP32 to send and receive data from the remote database, and the ESP8266WiFi and EEPROM libraries for connecting to the internet and storing the updated value of certain data.
#include <Arduino.h> #include <ESP8266WiFi.h> #include <Firebase_ESP_Client.h> #include <EEPROM.h>
//Provide the token generation process info. #include "addons/TokenHelper.h" //Provide the RTDB payload printing info and other helper functions. #include "addons/RTDBHelper.h"
The setup function performs the initialization of the used peripherals, which include:
void setup() { // Initialize UART Serial.begin(9600); // Initialize Wifi Serial.print("Connecting to "); Serial.println(_SSID); WiFi.begin(_SSID, _PWD); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.print("WiFi connected with IP: "); Serial.println(WiFi.localIP()); // Configure Firebase // Assign the API Key conf.api_key = API_KEY; // Assign the RTDB URL conf.database_url = DATABASE_URL; // Sign up if (Firebase.signUp(&conf, &auth, "", "")){ Serial.println("ok"); signupOK = true; } else{ Serial.println("nui ok gion"); Serial.printf("%s\n", conf.signer.signupError.message.c_str()); } /* Assign the callback function for the long running token generation task */ conf.token_status_callback = tokenStatusCallback; Firebase.begin(&conf, &auth); // EEPROM READ count = EEPROM.read(0); count1 = EEPROM.read(1); // Configure button input pinMode(interruptPin, INPUT); attachInterrupt(digitalPinToInterrupt(interruptPin), interruptFunction, FALLING); attachInterrupt(digitalPinToInterrupt(nextArrayPin), nextArrayHandle, FALLING); Serial.println("Setup finished");
}