Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge main #1

Merged
merged 5 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .vscode/arduino.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"configuration": "CDCOnBoot=default,MSCOnBoot=default,DFUOnBoot=default,PartitionScheme=noota_3gffat,DebugLevel=none",
"board": "esp32:esp32:lolin_s2_mini",
"configuration": "xtal=80,vt=flash,exception=disabled,stacksmash=disabled,ssl=all,mmu=3232,non32xfer=fast,FlashMode=dout,FlashFreq=40,eesz=4M2M,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=921600",
"board": "esp8266:esp8266:d1_mini_clone",
"sketch": "src/Wardriver/Wardriver.ino",
"port": "/dev/ttyACM0"
"port": "/dev/ttyUSB0"
}
586 changes: 39 additions & 547 deletions .vscode/c_cpp_properties.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/Wardriver/Vars.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
#include "Arduino.h"
#include <HardwareSerial.h>

#define VERSION 1.1
#define VERSION_STR "v1.1"
#define VERSION 1.2
#define VERSION_STR "v1.2"
#define WIGLE_HEADER "MAC,SSID,AuthMode,FirstSeen,Channel,RSSI,CurrentLatitude,CurrentLongitude,AltitudeMeters,AccuracyMeters,Type"

#define SERIAL_BAUD 115200
#define SERIAL_BAUD 1152007
#define GPS_BAUD 9600
#define TIMEZONE_UTC -7
#define SCAN_INTERVAL 500
Expand Down
3 changes: 3 additions & 0 deletions src/Wardriver/Wardriver.ino
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
void setup() {
Serial.begin(115200);
pinMode(A0, INPUT);
ESP.wdtDisable();

Wardriver::init();
ESP.wdtEnable(0);
}

void loop() {
Expand Down
33 changes: 30 additions & 3 deletions src/Wardriver/src/Filesys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,17 @@ Filesys::Filesys() {
void Filesys::init(Filesys::ScreenUpdateCallback callback) {

#if defined (ESP8266)
if (!SD.begin(SD_CS)) {
bool sdSuccess = SD.begin(SD_CS);
if (!sdSuccess) {
callback("SD Card: NOT FOUND");
ESP.wdtDisable();
while (!SD.begin(SD_CS)) { delay(0); }

while (!sdSuccess) {
sdSuccess = SD.begin(SD_CS);
ESP.wdtFeed();
}
}
callback("SD Card: FOUND!!");

#elif defined (ESP32)

EspTinyUSB::registerDeviceCallbacks(new Device());
Expand Down Expand Up @@ -82,6 +87,28 @@ void Filesys::init(Filesys::ScreenUpdateCallback callback) {
callback(tmpMsg);

#endif

Filesys::configure();

}

void Filesys::configure() {

// create config.txt if it doesn't exist
// if (!FS_VAR.exists("config.txt")) {
// File tmpSettings = FS_VAR.open("config.txt", FILE_WRITE);
// tmpSettings.println("# Duplicates recommended");
// tmpSettings.println("Duplicates: y");
// tmpSettings.println("GPS RX: D4");
// tmpSettings.println("GPS RX: D3");

// tmpSettings.close();
// }

// read settings & write to variables
// File tmpSettings = FS_VAR.open("config.txt", FILE_WRITE);
// tmpSettings.read()

}


Expand Down
3 changes: 3 additions & 0 deletions src/Wardriver/src/Filesys.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ class Filesys {

static void open();
static void close();

private:
static void configure();
};
11 changes: 6 additions & 5 deletions src/Wardriver/src/Wardriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,12 @@ void initGPS() {
sats = gps.satellites.value();

Serial.println(gps.location.isValid());
delay(0); smartDelay(500);
ESP.wdtFeed(); smartDelay(500);
}
while (! (gps.date.year() == 2000)) {
Screen::drawMockup("...","...",sats,totalNets,openNets,clients,bat,speed,"GPS: Waiting for time...");
delay(0); smartDelay(500);
while ((gps.date.year() == 2000)) {
Screen::drawMockup("...","...",sats,totalNets,openNets,clients,bat,speed,"GPS: Validating time...");
ESP.wdtFeed(); smartDelay(500);
Serial.println(gps.date.year());
}
Screen::drawMockup("...","...",sats,totalNets,openNets,clients,bat,speed,"GPS: LOCATION FOUND");

Expand Down Expand Up @@ -168,8 +169,8 @@ void getBattery() {
void Wardriver::init() {
Screen::init();
Screen::drawSplash(2);

Filesys::init(updateScreen); delay(1000);

getBattery();
initGPS();

Expand Down