Merge pull request #70 from iu2frl/master
Added beacon TX from web page as #64
This commit is contained in:
commit
0f0ab53890
31
README.md
31
README.md
|
|
@ -17,16 +17,20 @@ After connection with APRX based DIGI it can be used as KISS-TNC
|
||||||
* TTGO T-beam v.1.0
|
* TTGO T-beam v.1.0
|
||||||
* Lora32 board
|
* Lora32 board
|
||||||
|
|
||||||
|
|
||||||
## User key functions:
|
## User key functions:
|
||||||
### short press:
|
### short press (OLED Enabled):
|
||||||
* if there is a GPS-FIX immediate sending of a frame with the position from the GPS
|
* if OLED is OFF a short press will wake it up and show current data
|
||||||
* if there is no GPS-FIX, immediate sending of the frame with the position saved in the configuration
|
* if OLED is ON with GPS-FIX immediate sending of a frame with the position from the GPS
|
||||||
|
* if OLED is ON without GPS-FIX, immediate sending of the frame with the position saved in the configuration
|
||||||
|
|
||||||
### long press On boot
|
### short press (OLED Disabled):
|
||||||
|
* with a valid GPS-FIX immediate sending of a frame with the position from the GPS
|
||||||
|
* without valid GPS-FIX, immediate sending of the frame with the position saved in the configuration
|
||||||
|
|
||||||
|
### long press while booting
|
||||||
* reset to factory default
|
* reset to factory default
|
||||||
|
|
||||||
### long press: on or off the GPS power supply
|
### long press: toggle on or off GPS power supply
|
||||||
* if the "FIXED_BEACON_EN" option is enabled in the configuration, a beacon will be sent every set time interval
|
* if the "FIXED_BEACON_EN" option is enabled in the configuration, a beacon will be sent every set time interval
|
||||||
|
|
||||||
## Oled screens information
|
## Oled screens information
|
||||||
|
|
@ -38,12 +42,11 @@ After connection with APRX based DIGI it can be used as KISS-TNC
|
||||||
* ((FIX TX)) - information about the forced manual sending of a frame with the position saved in the configuration when GPS is off or no fix
|
* ((FIX TX)) - information about the forced manual sending of a frame with the position saved in the configuration when GPS is off or no fix
|
||||||
* ((AUT TX)) - information about sending automatic positioning frame when GPS is turned off
|
* ((AUT TX)) - information about sending automatic positioning frame when GPS is turned off
|
||||||
* ((KISSTX)) - information about sending the frame sent by KISS
|
* ((KISSTX)) - information about sending the frame sent by KISS
|
||||||
|
* ((WEB TX)) - sending frame as requested via HTTP
|
||||||
|
|
||||||
## How to binary first flash readme... (thanx SP6VWX)
|
## How to binary first flash readme... (thanx SP6VWX)
|
||||||
* Download the appropriate binary file for your board from;
|
* Download the appropriate binary file for your board from: https://github.com/SQ9MDD/TTGO-T-Beam-LoRa-APRS/releases
|
||||||
* https://github.com/SQ9MDD/TTGO-T-Beam-LoRa-APRS/releases
|
* Download current version of the esphome-flasher tool: https://github.com/esphome/esphome-flasher/releases
|
||||||
* Download current version of the esphome-flasher tool
|
|
||||||
* https://github.com/esphome/esphome-flasher/releases
|
|
||||||
* Connect your board to your USB port and open ESPHome Flasher.
|
* Connect your board to your USB port and open ESPHome Flasher.
|
||||||
* If your board is not showing under Serial Port then you likely need to install the drivers for the CP210X serial chip. In Windows you can check by searching “Device Manager” and ensuring the device is shown under “Ports”.
|
* If your board is not showing under Serial Port then you likely need to install the drivers for the CP210X serial chip. In Windows you can check by searching “Device Manager” and ensuring the device is shown under “Ports”.
|
||||||
* In ESPHome Flasher, refresh the serial ports and select your board's serial port.
|
* In ESPHome Flasher, refresh the serial ports and select your board's serial port.
|
||||||
|
|
@ -52,6 +55,14 @@ After connection with APRX based DIGI it can be used as KISS-TNC
|
||||||
* Once complete, “Done! Flashing is complete!” will be shown.
|
* Once complete, “Done! Flashing is complete!” will be shown.
|
||||||
* any subsequent updates can be done via WWW
|
* any subsequent updates can be done via WWW
|
||||||
|
|
||||||
|
## Installing from source (only for advanced users)
|
||||||
|
* Clone Git repo to any folder of your PC
|
||||||
|
* Download and install "Visual Studio Code"
|
||||||
|
* Open "Visual Studio Code" and add "PlatformIO" plugin
|
||||||
|
* Open "PlatformIO" and click on "Import Arduino Project"
|
||||||
|
* In the top part of the window choose youy board then browse to cloned repo and click "import"
|
||||||
|
* In the left column click on the ANT-shaped icon, choose your board and click on "Upload". COM port should be detected automatically Wait for procedure to finish and keep reading
|
||||||
|
|
||||||
## Default WiFi Password:
|
## Default WiFi Password:
|
||||||
|
|
||||||
* Default WiFi Password is: xxxxxxxxxx
|
* Default WiFi Password is: xxxxxxxxxx
|
||||||
|
|
|
||||||
|
|
@ -247,6 +247,11 @@
|
||||||
<input class="button-primary" type="submit" value="Factory reset">
|
<input class="button-primary" type="submit" value="Factory reset">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
<form action="/beacon" method="post" onsubmit="return confirmAction('send beacon');">
|
||||||
|
<div>
|
||||||
|
<input class="button-primary" type="submit" value="Send Beacon">
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
|
|
@ -188,6 +188,9 @@ uint oled_timeout; // OLED Timeout, same as "Display show RX Time"
|
||||||
bool tempOled = true; // Turn ON OLED at first startup
|
bool tempOled = true; // Turn ON OLED at first startup
|
||||||
ulong oled_timer = millis();
|
ulong oled_timer = millis();
|
||||||
|
|
||||||
|
// Variable to manually send beacon from html page
|
||||||
|
bool manBeacon = false;
|
||||||
|
|
||||||
#define ANGLE_AVGS 3 // angle averaging - x times
|
#define ANGLE_AVGS 3 // angle averaging - x times
|
||||||
float average_course[ANGLE_AVGS];
|
float average_course[ANGLE_AVGS];
|
||||||
float avg_c_y, avg_c_x;
|
float avg_c_y, avg_c_x;
|
||||||
|
|
@ -863,6 +866,12 @@ void loop() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (manBeacon) {
|
||||||
|
enableOled();
|
||||||
|
writedisplaytext("((WEB TX))","","","","","");
|
||||||
|
sendpacket();
|
||||||
|
manBeacon=false;
|
||||||
|
}
|
||||||
// Only wake up OLED when necessary, note that DIM is to turn OFF the backlight
|
// Only wake up OLED when necessary, note that DIM is to turn OFF the backlight
|
||||||
if (enabled_oled) {
|
if (enabled_oled) {
|
||||||
display.dim(!tempOled);
|
display.dim(!tempOled);
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,9 @@ extern const char web_style_css_end[] asm("_binary_data_embed_style_css_out_end"
|
||||||
extern const char web_js_js[] asm("_binary_data_embed_js_js_out_start");
|
extern const char web_js_js[] asm("_binary_data_embed_js_js_out_start");
|
||||||
extern const char web_js_js_end[] asm("_binary_data_embed_js_js_out_end");
|
extern const char web_js_js_end[] asm("_binary_data_embed_js_js_out_end");
|
||||||
|
|
||||||
|
// Variable needed to send beacon from html page
|
||||||
|
extern bool manBeacon;
|
||||||
|
|
||||||
QueueHandle_t webListReceivedQueue = nullptr;
|
QueueHandle_t webListReceivedQueue = nullptr;
|
||||||
std::list <tReceivedPacketData*> receivedPackets;
|
std::list <tReceivedPacketData*> receivedPackets;
|
||||||
const int MAX_RECEIVED_LIST_SIZE = 50;
|
const int MAX_RECEIVED_LIST_SIZE = 50;
|
||||||
|
|
@ -130,8 +133,13 @@ void handle_Reboot() {
|
||||||
ESP.restart();
|
ESP.restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
void handle_Shutdown() {
|
void handle_Beacon() {
|
||||||
|
server.sendHeader("Location", "/");
|
||||||
|
server.send(302,"text/html", "");
|
||||||
|
manBeacon=true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void handle_Shutdown() {
|
||||||
#ifdef T_BEAM_V1_0
|
#ifdef T_BEAM_V1_0
|
||||||
server.send(200,"text/html", "Shutdown");
|
server.send(200,"text/html", "Shutdown");
|
||||||
axp.shutdown();
|
axp.shutdown();
|
||||||
|
|
@ -291,6 +299,7 @@ void handle_saveDeviceCfg(){
|
||||||
server.on("/scan_wifi", handle_ScanWifi);
|
server.on("/scan_wifi", handle_ScanWifi);
|
||||||
server.on("/save_wifi_cfg", handle_SaveWifiCfg);
|
server.on("/save_wifi_cfg", handle_SaveWifiCfg);
|
||||||
server.on("/reboot", handle_Reboot);
|
server.on("/reboot", handle_Reboot);
|
||||||
|
server.on("/beacon", handle_Beacon);
|
||||||
server.on("/shutdown", handle_Shutdown);
|
server.on("/shutdown", handle_Shutdown);
|
||||||
server.on("/cfg", handle_Cfg);
|
server.on("/cfg", handle_Cfg);
|
||||||
server.on("/received_list", handle_ReceivedList);
|
server.on("/received_list", handle_ReceivedList);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue