You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.6 KiB
59 lines
1.6 KiB
#include <Arduino.h>
|
|
#include <types.h>
|
|
#include <TinyGPS++.h> // the TinyGPS++ librarie
|
|
//#include <HardwareSerial.h> // to convert serial from the GPS into something TinyGPS can understand
|
|
#include <WiFi.h> // from the ESP32 plugin
|
|
#include <AsyncTCP.h> // for basic TCP t/rx
|
|
#include <ESPAsyncWebServer.h> // for web server impl.
|
|
//#include <SoftwareSerial.h> // to send data back over USB
|
|
|
|
#define GPS_TX_PIN 1
|
|
#define GPS_RX_PIN 3
|
|
|
|
const char* SSID = "Bytetools Technologies Inc.";
|
|
const char* PASS = "Fuck commies #69420!";
|
|
|
|
AsyncWebServer server(80);
|
|
TinyGPSPlus gps;
|
|
//HardwareSerial SerialGPS(1);
|
|
|
|
// Load variables into globals
|
|
void setup() {
|
|
Serial.begin(9600);
|
|
//SerialGPS.begin(9600, SERIAL_8N1, GPS_RX_PIN, GPS_TX_PIN);
|
|
WiFi.begin(SSID, PASS);
|
|
Serial.print("Connecting to wifi");
|
|
Serial.print(".");
|
|
while (WiFi.status() != WL_CONNECTED) {
|
|
delay(1000);
|
|
Serial.print(".");
|
|
}
|
|
Serial.println(WiFi.localIP());
|
|
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request) {
|
|
request->send(200, "text/plain", "HELO");
|
|
});
|
|
server.begin();
|
|
}
|
|
|
|
// loop forever
|
|
void loop() {
|
|
/*
|
|
//while (SerialGPS.available() > 0) {
|
|
//gps.encode(SerialGPS.read());
|
|
if (gps.location.isUpdated()) {
|
|
Serial.println("HELLO");
|
|
Serial.print("LAT=");
|
|
Serial.println(gps.location.lat());
|
|
Serial.print("LON=");
|
|
Serial.println(gps.location.lng());
|
|
Serial.print("ALT=");
|
|
Serial.println(gps.altitude.meters());
|
|
} else {
|
|
Serial.println("INVALID LOCATION");
|
|
}
|
|
//}
|
|
*/
|
|
//Serial.println("Nothing in buffer.");
|
|
//delay(1000);
|
|
}
|