diff --git a/Firmware/include/config.h b/Firmware/include/config.h index db8cfd2d..a7a2e813 100644 --- a/Firmware/include/config.h +++ b/Firmware/include/config.h @@ -22,7 +22,7 @@ #ifndef GLOBALVAR_H #define GLOBALVAR_H -#define FW_VER "0.9.10" // Flyball ETS firmware version +#define FW_VER "0.9.13" // Flyball ETS firmware version #define Simulate false // Set to true to enable race simulation (see Simulator.h/.cpp) #define NumSimulatedRaces 25 // number of prepeared simulated races. Sererial interface command to change interface: e.g. "race 1" diff --git a/Firmware/lib/WebHandler/WebHandler.cpp b/Firmware/lib/WebHandler/WebHandler.cpp index 8e5f1f74..12e8ea8f 100644 --- a/Firmware/lib/WebHandler/WebHandler.cpp +++ b/Firmware/lib/WebHandler/WebHandler.cpp @@ -2,6 +2,7 @@ // // #include "WebHandler.h" +#include void WebHandlerClass::_WsEvent(AsyncWebSocket *server, AsyncWebSocketClient *client, AwsEventType type, void *arg, uint8_t *data, size_t len) { @@ -195,7 +196,6 @@ void WebHandlerClass::init(int webPort) _lWebSocketReceivedTime = 0; _ws->onEvent(std::bind(&WebHandlerClass::_WsEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5, std::placeholders::_6)); - _wsa->onEvent(std::bind(&WebHandlerClass::_WsEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5, std::placeholders::_6)); _server->addHandler(_ws); @@ -218,6 +218,8 @@ void WebHandlerClass::init(int webPort) //Authentication handler _server->on("/auth", HTTP_GET, std::bind(&WebHandlerClass::_onAuth, this, std::placeholders::_1)); + AsyncElegantOTA.begin(_server); // Start ElegantOTA + _server->begin(); _lLastRaceDataBroadcast = 0; diff --git a/Firmware/partitions_custom.csv b/Firmware/partitions_custom.csv index 2abbf9ba..89ddda4c 100644 --- a/Firmware/partitions_custom.csv +++ b/Firmware/partitions_custom.csv @@ -1,6 +1,6 @@ # Name, Type, SubType, Offset, Size, Flags nvs, data, nvs, 0x9000, 0x5000, otadata, data, ota, 0xe000, 0x2000, -app0, app, ota_0, 0x10000, 0x180000, -app1, app, ota_1, 0x190000,0x180000, -spiffs, data, spiffs, 0x310000,0xf0000, +app0, app, ota_0, 0x10000, 0x1f0000, +app1, app, ota_1, 0x200000,0x1f0000, +spiffs, data, spiffs, 0x3f0000,0x10000, diff --git a/Firmware/platformio.ini b/Firmware/platformio.ini index 73294079..7751f542 100644 --- a/Firmware/platformio.ini +++ b/Firmware/platformio.ini @@ -33,31 +33,25 @@ upload_protocol = esptool board_build.partitions = partitions_custom.csv - ; if jtag board is in use debug_tool = esp-prog debug_init_break = tbreak setup # using the latest stable version lib_deps = - ESP Async WebServer - NeoPixelBus - 1655 ;TinyGPSPlus - 887 ;LiquidCrystal by Arduino/Adafruit - bblanchon/ArduinoJson - https://github.com/thingSoC/embedis ;Embedis - Crypto - AsyncTCP + me-no-dev/AsyncTCP + me-no-dev/ESP Async WebServer + ayushsharma82/AsyncElegantOTA + makuna/NeoPixelBus @ ^2.6.0 + mikalhart/TinyGPSPlus @ ^1.0.2 + arduino-libraries/LiquidCrystal @ ^1.0.7 + bblanchon/ArduinoJson @ ^6.16.1 + https://github.com/thingSoC/embedis + rweather/Crypto @ ^0.2.0 + Timezone ;ottowinter/ESPAsyncWebServer-esphome @ ^1.2.7 - ;makuna/NeoPixelBus @ ^2.6.0 - ;mikalhart/TinyGPSPlus @ ^1.0.2 - ;arduino-libraries/LiquidCrystal @ ^1.0.7 - ;bblanchon/ArduinoJson @ ^6.16.1 - ;https://github.com/thingSoC/embedis ;Embedis - ;links2004/WebSockets @ 2.2.0 - ;rweather/Crypto @ ^0.2.0 ;ottowinter/AsyncTCP-esphome @ ^1.1.1 - Timezone + ;links2004/WebSockets @ 2.2.0 build_flags = -I include/ diff --git a/README.md b/README.md index 0e4f90a3..b6eaf567 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,8 @@ ## FlyballETS-Software by simonttp78 -This project rely on original Flyball ETS project by Alex Gore. Information about initial version, that evolves as well, can be found here: -[Flyball ETS project](https://sparkydevices.wordpress.com/tag/flyball-ets/). -FlyballETS-Software is a for of Alex'es FlyballETS-Software repositorium and contains the sources for the microcontroller software. +This project is a fork of Flyball ETS project by vyruz1986. Highlights described below. -## Major changes vs FlyballETS original project by Alex Gore +## Major changes vs oryginal FlyballETS project by vyruz1986 * Configurable results accuracy: 2 or 3 digits * Total crossing time replaced with Net time @@ -24,8 +22,9 @@ FlyballETS-Software is a for of Alex'es FlyballETS-Software repositorium and con * Battery calibration improvements * Local system time * WebUI and LCD layout changes +* Firmware update via WebUI -> thanks to AsyncElegantOTA by ayushsharma82 * Reset and Manual stop indicated by white fault light blink -* Configurable laser diodes on time in order to simplify set-up process +* Configurable ON time for laser diodes ## Source files @@ -66,3 +65,4 @@ This project was made possible by the following awesome libraries/projects and t - [NeoPixelBus](https://github.com/Makuna/NeoPixelBus) for reliably controlling WS2812 LEDs using ESP32 - [Espurna Project](https://bitbucket.org/xoseperez/espurna) was used as a great example to solve several problems, such as the web UI and the settings interface. - [Timezone](https://github.com/JChristensen/Timezone) used for local time adjustments: time zones and daylight saving time change +- [AsyncElegantOTA](https://github.com/ayushsharma82/AsyncElegantOTA) used for firmware update via WebUI diff --git a/WebUI/src/app/app.component.html b/WebUI/src/app/app.component.html index 4075128c..ff6814d9 100644 --- a/WebUI/src/app/app.component.html +++ b/WebUI/src/app/app.component.html @@ -1,3 +1,3 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/WebUI/src/app/app.module.ts b/WebUI/src/app/app.module.ts index 67236252..fa383972 100644 --- a/WebUI/src/app/app.module.ts +++ b/WebUI/src/app/app.module.ts @@ -10,7 +10,6 @@ import { NavbarComponent } from "./components/navbar/navbar.component"; import { HomeComponent } from "./components/home/home.component"; import { RacedisplayComponent } from "./components/racedisplay/racedisplay.component"; import { ConfigComponent } from "./components/config/config.component"; - import { SystemDataComponent } from "./components/system-data/system-data.component"; import { LightsComponent } from "./components/racedisplay/lights/lights.component"; import { EtsdataService } from "./services/etsdata.service"; @@ -24,7 +23,7 @@ import { TimeDisplayComponent } from "./components/racedisplay/time-display/time import { DogDetailsComponent } from "./components/racedisplay/dog-details/dog-details.component"; const appRoutes: Routes = [ - { path: "", component: HomeComponent }, + { path: "", component: RacedisplayComponent }, { path: "racedisplay", component: RacedisplayComponent }, { path: "config", component: ConfigComponent }, ]; diff --git a/WebUI/src/app/components/navbar/navbar.component.html b/WebUI/src/app/components/navbar/navbar.component.html index 7c247e23..2a85b73a 100644 --- a/WebUI/src/app/components/navbar/navbar.component.html +++ b/WebUI/src/app/components/navbar/navbar.component.html @@ -8,13 +8,16 @@ diff --git a/WebUI/src/app/components/racedisplay/dog-details/dog-details.component.html b/WebUI/src/app/components/racedisplay/dog-details/dog-details.component.html index bc1837cb..6561219b 100644 --- a/WebUI/src/app/components/racedisplay/dog-details/dog-details.component.html +++ b/WebUI/src/app/components/racedisplay/dog-details/dog-details.component.html @@ -28,4 +28,5 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/WebUI/src/app/components/racedisplay/race-control/race-control.component.html b/WebUI/src/app/components/racedisplay/race-control/race-control.component.html index 78b4be46..45cd58eb 100644 --- a/WebUI/src/app/components/racedisplay/race-control/race-control.component.html +++ b/WebUI/src/app/components/racedisplay/race-control/race-control.component.html @@ -1,13 +1,13 @@
- +       - +       - +
diff --git a/WebUI/src/app/components/racedisplay/race-control/race-control.component.ts b/WebUI/src/app/components/racedisplay/race-control/race-control.component.ts index c919bea9..3fb3342d 100644 --- a/WebUI/src/app/components/racedisplay/race-control/race-control.component.ts +++ b/WebUI/src/app/components/racedisplay/race-control/race-control.component.ts @@ -35,8 +35,8 @@ export class RaceControlComponent implements OnChanges, OnInit { this.overallMaxState = Math.max(...this.raceStates.RaceStates); this.startDisabled = !(this.overallMaxState == 0); - this.stopDisabled = (this.overallMaxState == 0 || this.overallMaxState == 3); - this.resetDisabled = !(this.overallMaxState == 3); + this.stopDisabled = !(this.overallMaxState == 1 || this.overallMaxState == 2); + this.resetDisabled = (this.overallMaxState == 1 || this.overallMaxState == 2); } EmitCommand(command: RaceCommandEnum) { diff --git a/WebUI/src/app/components/system-data/system-data.component.html b/WebUI/src/app/components/system-data/system-data.component.html index e2bb8872..47ae6a0d 100644 --- a/WebUI/src/app/components/system-data/system-data.component.html +++ b/WebUI/src/app/components/system-data/system-data.component.html @@ -2,10 +2,10 @@
Batt: {{systemData.batteryPercentage}}% - | T: {{systemData.systemTimestamp | date:'short'}} + | Id: {{systemData.PwrOnTag}}/{{systemData.RaceID}} | Up: {{hmsTime}} + | T: {{systemData.systemTimestamp | date:'short'}} | C: {{systemData.numClients}} - | Id: {{systemData.PwrOnTag}}/{{systemData.RaceID}} | Mem: {{systemData.freeHeap}}
diff --git a/WebUI/src/app/components/system-data/system-data.component.ts b/WebUI/src/app/components/system-data/system-data.component.ts index 919c32f7..0997c722 100644 --- a/WebUI/src/app/components/system-data/system-data.component.ts +++ b/WebUI/src/app/components/system-data/system-data.component.ts @@ -11,7 +11,7 @@ export class SystemDataComponent implements OnInit { hmsTime:string; - systemData:SystemData = {batteryPercentage: 0, systemTimestamp: null, uptime: 0, numClients: 0, PwrOnTag: 0, RaceID: 0, freeHeap: 0}; + systemData:SystemData = {batteryPercentage: 0, PwrOnTag: 0, RaceID: 0, uptime: 0, systemTimestamp: null, numClients: 0, freeHeap: 0}; constructor(private etsDataService:EtsdataService) { this.etsDataService.dataStream.subscribe((data) => { if(data.SystemData) {