Skip to content

Commit

Permalink
TEST: re-implemented webSocket server (passive client), Dev. Mode out…
Browse files Browse the repository at this point in the history
…put now works through temporary buffer, WebUI fixes
  • Loading branch information
way5 committed Jun 10, 2024
1 parent 38247fb commit be6c7eb
Show file tree
Hide file tree
Showing 21 changed files with 2,195 additions and 1,886 deletions.
5 changes: 3 additions & 2 deletions configure.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
"oled_menu_scroll_lead_in_time_in_ms": 600,
"oled_menu_screen_saver_kick_in_seconds": 180,
"oled_menu_over_draw": 0,
"oled_menu_reset_always_scroll_on_selection": 0
"oled_menu_reset_always_scroll_on_selection": 0,
"serial_buffer_max_len": 1024
},
"ui-lang": "en",
"ui-hdw-fonts": "12@FreeSans,16@FreeSans",
"ui-web-font": "Oswald Regular",
"version": "24.0607"
"version": "24.0610"
}
37 changes: 22 additions & 15 deletions gbs-control.ino
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//! This is autogenerated file
//! Please do not edit if you're using PlatformIO

#define VERSION "24.0607"
#define VERSION "24.0610"

/*
###########################################################################
# File: main.cpp #
# File Created: Friday, 19th April 2024 3:13:38 pm #
# Author: Robert Neumann #
# Last Modified: Sunday, 2nd June 2024 11:15:45 pm #
# Last Modified: Monday, 10th June 2024 4:04:57 pm #
# Modified By: Sergey Ko #
# #
# License: GPLv3 #
Expand Down Expand Up @@ -173,6 +173,10 @@ void setup()

// dev
rto->invertSync = false;
rto->debugView = false;
rto->developerMode = false;
rto->freezeCapture = false;
rto->adcFilter = false;

adco->r_gain = 0;
adco->g_gain = 0;
Expand All @@ -187,7 +191,7 @@ void setup()

if (rto->webServerEnabled) {
wifiInit();
webSocket.begin();
serverWebSocketInit();
serverInit();

#ifdef HAVE_PINGER_LIBRARY
Expand Down Expand Up @@ -224,7 +228,7 @@ void setup()
while (millis() - initDelay < 1500) {
display.drawXbm(2, 2, gbsicon_width, gbsicon_height, gbsicon_bits);
display.display();
wifiLoop(0);
// wifiLoop(0);
delay(1);
}
display.clear();
Expand Down Expand Up @@ -275,8 +279,8 @@ void setup()
// ? WHY?
initDelay = millis();
while (millis() - initDelay < 1000) {
wifiLoop(0);
delay(1);
// wifiLoop(0);
delay(10);
}

// dummy commands
Expand Down Expand Up @@ -306,9 +310,8 @@ void setup()

// restart and dummy
startWire();
delay(1);
delay(10);
GBS::STATUS_00::read();
delay(1);

if (!checkBoardPower()) {
stopWire();
Expand All @@ -335,6 +338,7 @@ void setup()
}

zeroAll();
_DBGN(F("(!) reset runtime parameters while setup"));
setResetParameters();
prepareSyncProcessor();

Expand All @@ -349,8 +353,6 @@ void setup()
// FIXME double reset?
// setResetParameters();

// wifiLoop(1);

// startup reliability test routine
/*rto->videoStandardInput = 1;
writeProgramArrayNew(ntsc_240p, 0);
Expand Down Expand Up @@ -391,11 +393,7 @@ void loop()
static unsigned long lastTimeInterruptClear = millis();

menuLoop();
wifiLoop(0); // WiFi + OTA + WS + MDNS, checks for server enabled + started
// Serial takes precedence
handleSerialCommand();
// handle user commands
handleUserCommand();
wifiLoop(); // WiFi + OTA + WS + MDNS, checks for server enabled + started

// run FrameTimeLock if enabled
if (uopt->enableFrameTimeLock && rto->sourceDisconnected == false
Expand Down Expand Up @@ -640,8 +638,17 @@ void loop()
}
#endif // HAVE_PINGER_LIBRARY

// Serial takes precedence
handleSerialCommand();
// skip the code below if we don't hava the web server
if (!rto->webServerEnabled || !rto->webServerStarted)
return;
// handle user commands
handleUserCommand();
// web client handler
server.handleClient();
MDNS.update();
dnsServer.processNextRequest();
// websocket event handler
webSocket.loop();
// handle ArduinoIDE
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gbscontrol-webui",
"version": "1.2.0",
"version": "1.2.2",
"description": "gbscontrol-webui",
"author": "",
"license": "GPL-3.0",
Expand Down
13 changes: 7 additions & 6 deletions public/src/index.html.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -364,19 +364,19 @@
<div>L{SLOT_SETTINGS_LEGEND}</div>
</legend>
<table class="gbs-preferences">
<tr>
<!-- <tr>
<td>
L{MATCH_PRESETS_SWITCH}
<ul class="gbs-help">
<ul class="gbs-help"> -->
<!-- prettier-ignore -->
<li>L{MATCH_PRESETS_SWITCH_HELP_1}</li>
<!-- <li>L{MATCH_PRESETS_SWITCH_HELP_1}</li>
</ul>
</td>
<td gbs-message="Z" gbs-message-type="action" gbs-click="normal" class="gbs-icon"
gbs-toggle-switch="matchPreset">
toggle_off
</td>
</tr>
</tr> -->
<tr>
<td>
L{FULL_HEIGHT_SWITCH}
Expand Down Expand Up @@ -540,7 +540,8 @@
<li>L{DEVELOPER_MODE_SWITCH_HELP_1}</li>
</ul>
</td>
<td class="gbs-icon">toggle_off</td>
<td gbs-message="d" gbs-message-type="user" gbs-click="normal"
class="gbs-icon">toggle_off</td>
</tr>
</table>
</fieldset>
Expand All @@ -553,7 +554,7 @@
<div>L{DEVELOPER_LEGEND}</div>
</legend>
<div class="gbs-flex gbs-margin__bottom--16">
<button class="gbs-button" gbs-output-toggle>
<button class="gbs-button" gbs-output-toggle active>
<div class="gbs-icon">code</div>
<div>L{TOGGLE_CONSOLE_BUTTON}</div>
</button>
Expand Down
Loading

0 comments on commit be6c7eb

Please sign in to comment.