Flashing failed!
-{{ flashing.error }}
- -diff --git a/config.json b/config.json
index 7d86dac..f5e4e30 100644
--- a/config.json
+++ b/config.json
@@ -1,375 +1,375 @@
{
- "basePath": "./firmware",
- "role": {
- "gui": {
- "icon": "gradient",
- "title": "Client GUI",
- "tooltip": "all your device settings are saved on internal flash"
- },
- "guiSD": {
- "icon": "gradient",
- "title": "Client GUI: data on SD card",
- "tooltip": "all your device settings are saved on SD card"
- },
- "companionBle": {
- "icon": "smartphone",
- "class": "primary-text",
- "title": "Companion radio: Bluetooth",
- "tooltip": "Chat via mobile phone App or Web Client"
- },
- "companionUsb": {
- "icon": "usb",
- "title": "Companion radio: USB",
- "tooltip": "Chat via Web client or command line client"
- },
- "repeater": {
- "icon": "cell_tower",
- "title": "Repeater",
- "tooltip": "Special role just for routing packets. Configured via Console on flasher main page"
- },
- "roomServer": {
- "icon": "forum",
- "title": "Room Server",
- "tooltip": "Special role for local room and routing packets. Configured via Console on flasher main page"
- }
- },
- "device": [
- {
- "name": "Lilygo T-Deck",
- "tooltip": "
",
- "type": "esp32",
- "firmware": [
- {
- "role": "gui",
- "files": [
- {
- "type": "flash",
- "name": "RippleUltra-TDeck-v6.0-beta21-merged.bin",
- "title": "Combined app+partition+bootloader firmware bin"
- },
- {
- "type": "download",
- "name": "RippleUltra-TDeck-v6.0-beta21.bin",
- "title": "App firmware bin (use with m5 booloader)"
- }
- ]
- },
- {
- "role": "guiSD",
- "files": [
- {
- "type": "flash",
- "name": "RippleUltra-TDeck-SD-v6.0-beta21-merged.bin",
- "title": "Combined app+partition+bootloader firmware bin"
- },
- {
- "type": "download",
- "name": "RippleUltra-TDeck-SD-v6.0-beta21.bin",
- "title": "App firmware bin (use with m5 booloader)"
- }
- ]
- }
- ]
- },
- {
- "name": "Lilygo T3 S3",
- "type": "esp32",
- "tooltip": "
",
- "firmware": [
- {
- "role": "companionUsb",
- "files": [
- {
- "type": "flash",
- "name": "LilyGo_T3S3_sx1262_companion_radio_usb.bin",
- "title": "Combined app+partition+bootloader firmware bin"
- }
- ]
- },
- {
- "role": "companionBle",
- "files": [
- {
- "type": "flash",
- "name": "LilyGo_T3S3_sx1262_companion_radio_ble.bin",
- "title": "Combined app+partition+bootloader firmware bin"
- }
- ]
- },
- {
- "role": "repeater",
- "files": [
- {
- "type": "flash",
- "name": "LilyGo_T3S3_sx1262_Repeater.bin",
- "title": "Combined app+partition+bootloader firmware bin"
- }
- ]
- }
- ]
- },
- {
- "name": "Heltec v2",
- "type": "esp32",
- "tooltip": "
",
- "firmware": [
- {
- "role": "companionUsb",
- "files": [
- {
- "type": "flash",
- "name": "Heltec_v2_companion_radio_usb.bin",
- "title": "Combined app+partition+bootloader firmware bin"
- }
- ]
- },
- {
- "role": "repeater",
- "files": [
- {
- "type": "flash",
- "name": "Heltec_v2_repeater.bin",
- "title": "Combined app+partition+bootloader firmware bin"
- }
- ]
- }
- ]
- },
- {
- "name": "Heltec v3",
- "type": "esp32",
- "tooltip": "
",
- "firmware": [
- {
- "role": "companionUsb",
- "files": [
- {
- "type": "flash",
- "name": "Heltec_v3_companion_radio_usb.bin",
- "title": "Combined app+partition+bootloader firmware bin"
- }
- ]
- },
- {
- "role": "companionBle",
- "files": [
- {
- "type": "flash",
- "name": "Heltec_v3_companion_radio_ble.bin",
- "title": "Combined app+partition+bootloader firmware bin"
- }
- ]
- },
- {
- "role": "repeater",
- "files": [
- {
- "type": "flash",
- "name": "Heltec_v3_repeater.bin",
- "title": "Combined app+partition+bootloader firmware bin"
- }
- ]
- },
- {
- "role": "roomServer",
- "files": [
- {
- "type": "flash",
- "name": "Heltec_v3_room_server.bin",
- "title": "Combined app+partition+bootloader firmware bin"
- }
- ]
- }
- ]
- },
- {
- "name": "Heltec T114",
- "type": "nrf52",
- "tooltip": "
",
- "firmware": [
- {
- "role": "repeater",
- "files": [
- {
- "type": "flash",
- "name": "Heltec_T114_repeater.zip",
- "title": "firmware OTA zip"
- },
- {
- "type": "download",
- "name": "Heltec_T114_repeater.uf2",
- "title": "firmware uf2"
- }
- ]
- },
- {
- "role": "roomServer",
- "files": [
- {
- "type": "flash",
- "name": "Heltec_T114_room_server.zip",
- "title": "firmware OTA zip"
- },
- {
- "type": "download",
- "name": "Heltec_T114_room_server.uf2",
- "title": "firmware uf2"
- }
- ]
- }
- ]
- },
- {
- "name": "RAK Wireless WisBlock / WisMesh (RAK 4631)",
- "type": "nrf52",
- "tooltip": "
",
- "firmware": [
- {
- "role": "companionUsb",
- "files": [
- {
- "type": "flash",
- "name": "RAK_4631_companion_radio_usb.zip",
- "title": "firmware OTA zip"
- },
- {
- "type": "download",
- "name": "RAK_4631_companion_radio_usb.uf2",
- "title": "firmware uf2"
- }
- ]
- },
- {
- "role": "companionBle",
- "files": [
- {
- "type": "flash",
- "name": "RAK_4631_companion_radio_ble.zip",
- "title": "firmware OTA zip"
- },
- {
- "type": "download",
- "name": "RAK_4631_companion_radio_ble.uf2",
- "title": "firmware uf2"
- }
- ]
- },
- {
- "role": "repeater",
- "files": [
- {
- "type": "flash",
- "name": "RAK_4631_Repeater.zip",
- "title": "firmware OTA zip"
- },
- {
- "type": "download",
- "name": "RAK_4631_Repeater.uf2",
- "title": "firmware uf2"
- }
- ]
- },
- {
- "role": "roomServer",
- "files": [
- {
- "type": "flash",
- "name": "RAK_4631_room_server.zip",
- "title": "firmware OTA zip"
- },
- {
- "type": "download",
- "name": "RAK_4631_room_server.uf2",
- "title": "firmware uf2"
- }
- ]
- }
- ]
- },
- {
- "name": "Seeed Studio SenseCAP T1000-E",
- "tooltip": "
",
- "type": "nrf52",
- "firmware": [
- {
- "role": "companionBle",
- "files": [
- {
- "type": "flash",
- "name": "Seeed_T1000e_companion_radio_ble.zip",
- "title": "firmware OTA zip"
- },
- {
- "type": "download",
- "name": "Seeed_T1000e_companion_radio_ble.uf2",
- "title": "firmware uf2"
- }
- ]
- }
- ]
- },
- {
- "name": "Seeed Studio Xiao C3",
- "tooltip": "
",
- "type": "esp32",
- "firmware": [
- {
- "role": "repeater",
- "title": "Repeater (Semtech SX1262)",
- "files": [
- {
- "type": "flash",
- "name": "Xiao_C3_Repeater_sx1262.bin",
- "title": "Combined app+partition+bootloader firmware bin"
- }
- ]
- },
- {
- "role": "repeater",
- "title": "Repeater (Semtech SX1268)",
- "files": [
- {
- "type": "flash",
- "name": "Xiao_C3_Repeater_sx1268.bin",
- "title": "Combined app+partition+bootloader firmware bin"
- }
- ]
- }
- ]
- },
- {
- "name": "Seeed Studio Xiao S3 WIO",
- "tooltip": "
",
- "type": "esp32",
- "firmware": [
- {
- "role": "repeater",
- "files": [
- {
- "type": "flash",
- "name": "Xiao_S3_WIO_Repeater.bin",
- "title": "Combined app+partition+bootloader firmware bin"
- }
- ]
- }
- ]
- },
- {
- "name": "UnitEng Station G2",
- "tooltip": "
",
- "type": "esp32",
- "firmware": [
- {
- "role": "repeater",
- "files": [
- {
- "type": "flash",
- "name": "Station_G2_repeater.bin",
- "title": "Combined app+partition+bootloader firmware bin"
- }
- ]
- }
- ]
- }
- ]
+ "basePath": "./firmware",
+ "role": {
+ "gui": {
+ "icon": "gradient",
+ "title": "Client GUI",
+ "tooltip": "all your device settings are saved on internal flash"
+ },
+ "guiSD": {
+ "icon": "gradient",
+ "title": "Client GUI: data on SD card",
+ "tooltip": "all your device settings are saved on SD card"
+ },
+ "companionBle": {
+ "icon": "smartphone",
+ "class": "primary-text",
+ "title": "Companion radio: Bluetooth",
+ "tooltip": "Chat via mobile phone App or Web Client"
+ },
+ "companionUsb": {
+ "icon": "usb",
+ "title": "Companion radio: USB",
+ "tooltip": "Chat via Web client or command line client"
+ },
+ "repeater": {
+ "icon": "cell_tower",
+ "title": "Repeater",
+ "tooltip": "Special role just for routing packets. Configured via Console on flasher main page"
+ },
+ "roomServer": {
+ "icon": "forum",
+ "title": "Room Server",
+ "tooltip": "Special role for local room and routing packets. Configured via Console on flasher main page"
+ }
+ },
+ "device": [
+ {
+ "name": "Lilygo T-Deck",
+ "tooltip": "
",
+ "type": "esp32",
+ "firmware": [
+ {
+ "role": "gui",
+ "files": [
+ {
+ "type": "flash",
+ "name": "RippleUltra-TDeck-v6.0-beta21-merged.bin",
+ "title": "Combined app+partition+bootloader firmware bin"
+ },
+ {
+ "type": "download",
+ "name": "RippleUltra-TDeck-v6.0-beta21.bin",
+ "title": "App firmware bin (use with m5 booloader)"
+ }
+ ]
+ },
+ {
+ "role": "guiSD",
+ "files": [
+ {
+ "type": "flash",
+ "name": "RippleUltra-TDeck-SD-v6.0-beta21-merged.bin",
+ "title": "Combined app+partition+bootloader firmware bin"
+ },
+ {
+ "type": "download",
+ "name": "RippleUltra-TDeck-SD-v6.0-beta21.bin",
+ "title": "App firmware bin (use with m5 booloader)"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Lilygo T3 S3",
+ "type": "esp32",
+ "tooltip": "
",
+ "firmware": [
+ {
+ "role": "companionUsb",
+ "files": [
+ {
+ "type": "flash",
+ "name": "LilyGo_T3S3_sx1262_companion_radio_usb.bin",
+ "title": "Combined app+partition+bootloader firmware bin"
+ }
+ ]
+ },
+ {
+ "role": "companionBle",
+ "files": [
+ {
+ "type": "flash",
+ "name": "LilyGo_T3S3_sx1262_companion_radio_ble.bin",
+ "title": "Combined app+partition+bootloader firmware bin"
+ }
+ ]
+ },
+ {
+ "role": "repeater",
+ "files": [
+ {
+ "type": "flash",
+ "name": "LilyGo_T3S3_sx1262_Repeater.bin",
+ "title": "Combined app+partition+bootloader firmware bin"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Heltec v2",
+ "type": "esp32",
+ "tooltip": "
",
+ "firmware": [
+ {
+ "role": "companionUsb",
+ "files": [
+ {
+ "type": "flash",
+ "name": "Heltec_v2_companion_radio_usb.bin",
+ "title": "Combined app+partition+bootloader firmware bin"
+ }
+ ]
+ },
+ {
+ "role": "repeater",
+ "files": [
+ {
+ "type": "flash",
+ "name": "Heltec_v2_repeater.bin",
+ "title": "Combined app+partition+bootloader firmware bin"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Heltec v3",
+ "type": "esp32",
+ "tooltip": "
",
+ "firmware": [
+ {
+ "role": "companionUsb",
+ "files": [
+ {
+ "type": "flash",
+ "name": "Heltec_v3_companion_radio_usb.bin",
+ "title": "Combined app+partition+bootloader firmware bin"
+ }
+ ]
+ },
+ {
+ "role": "companionBle",
+ "files": [
+ {
+ "type": "flash",
+ "name": "Heltec_v3_companion_radio_ble.bin",
+ "title": "Combined app+partition+bootloader firmware bin"
+ }
+ ]
+ },
+ {
+ "role": "repeater",
+ "files": [
+ {
+ "type": "flash",
+ "name": "Heltec_v3_repeater.bin",
+ "title": "Combined app+partition+bootloader firmware bin"
+ }
+ ]
+ },
+ {
+ "role": "roomServer",
+ "files": [
+ {
+ "type": "flash",
+ "name": "Heltec_v3_room_server.bin",
+ "title": "Combined app+partition+bootloader firmware bin"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Heltec T114",
+ "type": "nrf52",
+ "tooltip": "
",
+ "firmware": [
+ {
+ "role": "repeater",
+ "files": [
+ {
+ "type": "flash",
+ "name": "Heltec_T114_repeater.zip",
+ "title": "firmware OTA zip"
+ },
+ {
+ "type": "download",
+ "name": "Heltec_T114_repeater.uf2",
+ "title": "firmware uf2"
+ }
+ ]
+ },
+ {
+ "role": "roomServer",
+ "files": [
+ {
+ "type": "flash",
+ "name": "Heltec_T114_room_server.zip",
+ "title": "firmware OTA zip"
+ },
+ {
+ "type": "download",
+ "name": "Heltec_T114_room_server.uf2",
+ "title": "firmware uf2"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "RAK Wireless WisBlock / WisMesh (RAK 4631)",
+ "type": "nrf52",
+ "tooltip": "
",
+ "firmware": [
+ {
+ "role": "companionUsb",
+ "files": [
+ {
+ "type": "flash",
+ "name": "RAK_4631_companion_radio_usb.zip",
+ "title": "firmware OTA zip"
+ },
+ {
+ "type": "download",
+ "name": "RAK_4631_companion_radio_usb.uf2",
+ "title": "firmware uf2"
+ }
+ ]
+ },
+ {
+ "role": "companionBle",
+ "files": [
+ {
+ "type": "flash",
+ "name": "RAK_4631_companion_radio_ble.zip",
+ "title": "firmware OTA zip"
+ },
+ {
+ "type": "download",
+ "name": "RAK_4631_companion_radio_ble.uf2",
+ "title": "firmware uf2"
+ }
+ ]
+ },
+ {
+ "role": "repeater",
+ "files": [
+ {
+ "type": "flash",
+ "name": "RAK_4631_Repeater.zip",
+ "title": "firmware OTA zip"
+ },
+ {
+ "type": "download",
+ "name": "RAK_4631_Repeater.uf2",
+ "title": "firmware uf2"
+ }
+ ]
+ },
+ {
+ "role": "roomServer",
+ "files": [
+ {
+ "type": "flash",
+ "name": "RAK_4631_room_server.zip",
+ "title": "firmware OTA zip"
+ },
+ {
+ "type": "download",
+ "name": "RAK_4631_room_server.uf2",
+ "title": "firmware uf2"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Seeed Studio SenseCAP T1000-E",
+ "tooltip": "
",
+ "type": "nrf52",
+ "firmware": [
+ {
+ "role": "companionBle",
+ "files": [
+ {
+ "type": "flash",
+ "name": "Seeed_T1000e_companion_radio_ble.zip",
+ "title": "firmware OTA zip"
+ },
+ {
+ "type": "download",
+ "name": "Seeed_T1000e_companion_radio_ble.uf2",
+ "title": "firmware uf2"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Seeed Studio Xiao C3",
+ "tooltip": "
",
+ "type": "esp32",
+ "firmware": [
+ {
+ "role": "repeater",
+ "title": "Repeater (Semtech SX1262)",
+ "files": [
+ {
+ "type": "flash",
+ "name": "Xiao_C3_Repeater_sx1262.bin",
+ "title": "Combined app+partition+bootloader firmware bin"
+ }
+ ]
+ },
+ {
+ "role": "repeater",
+ "title": "Repeater (Semtech SX1268)",
+ "files": [
+ {
+ "type": "flash",
+ "name": "Xiao_C3_Repeater_sx1268.bin",
+ "title": "Combined app+partition+bootloader firmware bin"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Seeed Studio Xiao S3 WIO",
+ "tooltip": "
",
+ "type": "esp32",
+ "firmware": [
+ {
+ "role": "repeater",
+ "files": [
+ {
+ "type": "flash",
+ "name": "Xiao_S3_WIO_Repeater.bin",
+ "title": "Combined app+partition+bootloader firmware bin"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "UnitEng Station G2",
+ "tooltip": "
",
+ "type": "esp32",
+ "firmware": [
+ {
+ "role": "repeater",
+ "files": [
+ {
+ "type": "flash",
+ "name": "Station_G2_repeater.bin",
+ "title": "Combined app+partition+bootloader firmware bin"
+ }
+ ]
+ }
+ ]
+ }
+ ]
}
\ No newline at end of file
diff --git a/css/flasher.css b/css/flasher.css
index e69de29..7e35a9f 100644
--- a/css/flasher.css
+++ b/css/flasher.css
@@ -0,0 +1,48 @@
+body {
+ display: flex;
+ height: 100vh;
+}
+
+#flasher {
+ flex-grow: 1;
+}
+#flasher img.device {
+ width: 300px;
+}
+#flasher div.autoscroller {
+ overflow: auto;
+ max-height: 300px;
+ display: flex;
+ flex-direction: column-reverse;
+}
+#flasher pre.term {
+ font-family: monospace;
+}
+#flasher .overlay {
+ display: flex !important;
+ flex-direction: column;
+}
+#flasher .console {
+ overflow: auto;
+ display: flex;
+ flex-direction: column;
+ flex-grow: 1;
+ margin: 0;
+}
+#flasher .console .holder {
+ display: flex;
+ flex-direction: row;
+ gap: 10px;
+}
+#flasher .console-input {
+ flex-grow: 1;
+ display: block;
+ appearance: none;
+ background: transparent;
+ border: 0;
+ font-family: monospace;
+ font-size: .875rem;
+}
+#flasher .console-input:focus, #flasher console-input:focus{
+ outline: none;
+}
\ No newline at end of file
diff --git a/flasher.js b/flasher.js
index 4550726..6fec1e1 100644
--- a/flasher.js
+++ b/flasher.js
@@ -7,390 +7,390 @@ import { SerialConsole } from './lib/console.js';
const res = await fetch('./config.json');
const config = await res.json();
const commandReference = {
- 'set freq ': 'Set frequency {Mhz}',
- 'time ': 'Set time {epoch-secs}',
- 'erase': 'Erase filesystem',
- 'advert': 'Send Advertisment packet',
- 'reboot': 'Reboot device',
- 'clock': 'Display current time',
- 'password ': 'Set new password',
- 'log': 'Ouput log',
- 'log start': 'Start packet logging to file system',
- 'log stop': 'Stop packet logging to file system',
- 'log erase': 'Erase the packet logs from file system',
- 'ver': 'Show device version',
- 'set af ': 'Set Air-time factor',
- 'set tx ': 'Set Tx power {dBm}',
- 'set repeat ': 'Set repeater mode {on|off}',
- 'set advert.interval ': 'Set advert rebroadcast interval {minutes}',
- 'set guest.password ': 'Set guest password',
- 'set name ': 'Set advertisement name',
- 'set lat': 'Set the advertisement map latitude',
- 'set lon': 'Set the advertisement map longitude',
+ 'set freq ': 'Set frequency {Mhz}',
+ 'time ': 'Set time {epoch-secs}',
+ 'erase': 'Erase filesystem',
+ 'advert': 'Send Advertisment packet',
+ 'reboot': 'Reboot device',
+ 'clock': 'Display current time',
+ 'password ': 'Set new password',
+ 'log': 'Ouput log',
+ 'log start': 'Start packet logging to file system',
+ 'log stop': 'Stop packet logging to file system',
+ 'log erase': 'Erase the packet logs from file system',
+ 'ver': 'Show device version',
+ 'set af ': 'Set Air-time factor',
+ 'set tx ': 'Set Tx power {dBm}',
+ 'set repeat ': 'Set repeater mode {on|off}',
+ 'set advert.interval ': 'Set advert rebroadcast interval {minutes}',
+ 'set guest.password ': 'Set guest password',
+ 'set name ': 'Set advertisement name',
+ 'set lat': 'Set the advertisement map latitude',
+ 'set lon': 'Set the advertisement map longitude',
};
function setup() {
- const consoleEditBox = ref();
- const consoleWindow = ref();
+ const consoleEditBox = ref();
+ const consoleWindow = ref();
- const selected = reactive({
- device: null,
- firmware: null,
- wipe: false,
- port: null
- });
+ const selected = reactive({
+ device: null,
+ firmware: null,
+ wipe: false,
+ port: null
+ });
- const flashing = reactive({
- instance: null,
- active: false,
- percentage: 0,
- log: '',
- error: '',
- dfuComplete: false,
- });
+ const flashing = reactive({
+ instance: null,
+ active: false,
+ percentage: 0,
+ log: '',
+ error: '',
+ dfuComplete: false,
+ });
- const serialCon = reactive({
- instance: null,
- opened: false,
- content: '',
- edit: '',
- });
+ const serialCon = reactive({
+ instance: null,
+ opened: false,
+ content: '',
+ edit: '',
+ });
- window.app = { selected, flashing, serialCon };
+ window.app = { selected, flashing, serialCon };
- const log = {
- clean() { flashing.log = '' },
- write(data) { flashing.log += data },
- writeLine(data) { flashing.log += data + '\n' }
- };
+ const log = {
+ clean() { flashing.log = '' },
+ write(data) { flashing.log += data },
+ writeLine(data) { flashing.log += data + '\n' }
+ };
- const refresh = () => {
- location.reload();
- }
+ const refresh = () => {
+ location.reload();
+ }
- const flasherCleanup = async () => {
- const port = selected.port;
- flashing.active = false;
- flashing.log = '';
- flashing.error = '';
- flashing.dfuComplete = false;
- flashing.percentage = 0;
- selected.firmware = null;
- selected.wipe = false;
- selected.device = null;
- if(flashing.instance instanceof ESPLoader) {
- await flashing.instance?.hr.reset();
- await flashing.instance?.transport?.disconnect();
- }
- flashing.instance = null;
- }
+ const flasherCleanup = async () => {
+ const port = selected.port;
+ flashing.active = false;
+ flashing.log = '';
+ flashing.error = '';
+ flashing.dfuComplete = false;
+ flashing.percentage = 0;
+ selected.firmware = null;
+ selected.wipe = false;
+ selected.device = null;
+ if(flashing.instance instanceof ESPLoader) {
+ await flashing.instance?.hr.reset();
+ await flashing.instance?.transport?.disconnect();
+ }
+ flashing.instance = null;
+ }
- const openSerialCon = async() => {
- const port = selected.port = await navigator.serial.requestPort();
- const serialConsole = serialCon.instance = new SerialConsole(port);
- serialCon.content = 'Welcome to MeshCore serial console.\n';
- serialCon.content += 'If you came here right after flashing, please restart your device.\n';
- serialCon.content += 'Click on the cursor to get all supported commands.\n\n';
- serialConsole.onOutput = (text) => {
- serialCon.content += text;
- };
- serialConsole.connect();
- serialCon.opened = true;
- await nextTick();
+ const openSerialCon = async() => {
+ const port = selected.port = await navigator.serial.requestPort();
+ const serialConsole = serialCon.instance = new SerialConsole(port);
+ serialCon.content = 'Welcome to MeshCore serial console.\n';
+ serialCon.content += 'If you came here right after flashing, please restart your device.\n';
+ serialCon.content += 'Click on the cursor to get all supported commands.\n\n';
+ serialConsole.onOutput = (text) => {
+ serialCon.content += text;
+ };
+ serialConsole.connect();
+ serialCon.opened = true;
+ await nextTick();
- consoleEditBox.value.focus();
- }
+ consoleEditBox.value.focus();
+ }
- const closeSerialCon = async() => {
- serialCon.opened = false;
- await serialCon.instance.disconnect();
- }
+ const closeSerialCon = async() => {
+ serialCon.opened = false;
+ await serialCon.instance.disconnect();
+ }
- const sendCommand = async(text) => {
- const consoleEl = consoleWindow.value;
- serialCon.edit = '';
- await serialCon.instance.sendCommand(text);
- setTimeout(() => consoleEl.scrollTop = consoleEl.scrollHeight, 100);
- }
+ const sendCommand = async(text) => {
+ const consoleEl = consoleWindow.value;
+ serialCon.edit = '';
+ await serialCon.instance.sendCommand(text);
+ setTimeout(() => consoleEl.scrollTop = consoleEl.scrollHeight, 100);
+ }
- const dfuMode = async() => {
- await Dfu.forceDfuMode(await navigator.serial.requestPort({}))
- flashing.dfuComplete = true;
- }
+ const dfuMode = async() => {
+ await Dfu.forceDfuMode(await navigator.serial.requestPort({}))
+ flashing.dfuComplete = true;
+ }
- const flashDevice = async() => {
- const device = selected.device;
- const firmware = selected.firmware;
- const flashFile = firmware.files.find(f => f.type === 'flash');
- if(!flashFile) {
- alert('Cannot find configuration for flash file! please report this to Discord.')
- flasherCleanup();
- return;
- }
- const url = `${config.basePath}/${flashFile.name}`;
- const resp = await fetch(url);
- const port = selected.port = await navigator.serial.requestPort({});
+ const flashDevice = async() => {
+ const device = selected.device;
+ const firmware = selected.firmware;
+ const flashFile = firmware.files.find(f => f.type === 'flash');
+ if(!flashFile) {
+ alert('Cannot find configuration for flash file! please report this to Discord.')
+ flasherCleanup();
+ return;
+ }
+ const url = `${config.basePath}/${flashFile.name}`;
+ const resp = await fetch(url);
+ const port = selected.port = await navigator.serial.requestPort({});
- if(device.type === 'esp32') {
- let esploader;
- let fileData;
- let transport;
+ if(device.type === 'esp32') {
+ let esploader;
+ let fileData;
+ let transport;
- try {
- const reader = new FileReader();
- fileData = await new Promise(async (resolve) => {
- reader.addEventListener('load', () => resolve(reader.result));
- reader.readAsBinaryString(await resp.blob());
- });
- }
- catch(e) {
- console.error(e);
- flashing.error = `Cannot read flash file: ${e}`;
- return;
- }
+ try {
+ const reader = new FileReader();
+ fileData = await new Promise(async (resolve) => {
+ reader.addEventListener('load', () => resolve(reader.result));
+ reader.readAsBinaryString(await resp.blob());
+ });
+ }
+ catch(e) {
+ console.error(e);
+ flashing.error = `Cannot read flash file: ${e}`;
+ return;
+ }
- const flashOptions = {
- terminal: log,
- compress: true,
- eraseAll: selected.wipe,
- flashSize: 'keep',
- flashMode: 'keep',
- flashFreq: 'keep',
- baudrate: 115200,
- romBaudrate: 115200,
- enableTracing: false,
- fileArray: [{
- data: fileData,
- address: 0
- }],
- reportProgress: async (fileIndex, written, total) => {
- flashing.percentage = (written / total) * 100;
+ const flashOptions = {
+ terminal: log,
+ compress: true,
+ eraseAll: selected.wipe,
+ flashSize: 'keep',
+ flashMode: 'keep',
+ flashFreq: 'keep',
+ baudrate: 115200,
+ romBaudrate: 115200,
+ enableTracing: false,
+ fileArray: [{
+ data: fileData,
+ address: 0
+ }],
+ reportProgress: async (fileIndex, written, total) => {
+ flashing.percentage = (written / total) * 100;
- // we're done with this file
- if (written === total) {
- return;
- }
- },
- };
+ // we're done with this file
+ if (written === total) {
+ return;
+ }
+ },
+ };
- try {
- flashing.active = true;
- transport = new Transport(port, true);
- flashOptions.transport = transport
- flashing.instance = esploader = new ESPLoader(flashOptions);
- esploader.hr = new HardReset(transport);
- await esploader.main();
- await esploader.flashId();
- }
- catch(e) {
- console.error(e);
- flashing.error = `Failed to initialize. Did you place the device into firmware download mode? Detail: ${e}`;
- esploader = null;
- return;
- }
+ try {
+ flashing.active = true;
+ transport = new Transport(port, true);
+ flashOptions.transport = transport
+ flashing.instance = esploader = new ESPLoader(flashOptions);
+ esploader.hr = new HardReset(transport);
+ await esploader.main();
+ await esploader.flashId();
+ }
+ catch(e) {
+ console.error(e);
+ flashing.error = `Failed to initialize. Did you place the device into firmware download mode? Detail: ${e}`;
+ esploader = null;
+ return;
+ }
- try {
- await esploader.writeFlash(flashOptions);
- await esploader.after();
- }
- catch(e) {
- console.error(e);
- flashing.error = `ESP32 flashing failed: ${e}`;
- await esploader.hardReset();
- await transport.disconnect();
- return;
- }
- }
- else if(device.type === 'nrf52') {
- const dfu = this.flashing.instance = new Dfu(port, selected.wipe);
+ try {
+ await esploader.writeFlash(flashOptions);
+ await esploader.after();
+ }
+ catch(e) {
+ console.error(e);
+ flashing.error = `ESP32 flashing failed: ${e}`;
+ await esploader.hardReset();
+ await transport.disconnect();
+ return;
+ }
+ }
+ else if(device.type === 'nrf52') {
+ const dfu = this.flashing.instance = new Dfu(port, selected.wipe);
- const zipFile = await resp.blob();
- flashing.active = true;
+ const zipFile = await resp.blob();
+ flashing.active = true;
- try {
- await dfu.dfuUpdate(zipFile, async (progress) => {
- flashing.percentage = progress;
- });
- }
- catch(e) {
- console.error(e);
- flashing.error = `nRF flashing failed: ${e}`;
- return;
- }
- }
- };
+ try {
+ await dfu.dfuUpdate(zipFile, async (progress) => {
+ flashing.percentage = progress;
+ });
+ }
+ catch(e) {
+ console.error(e);
+ flashing.error = `nRF flashing failed: ${e}`;
+ return;
+ }
+ }
+ };
- return {
- consoleEditBox, consoleWindow,
- config, selected, flashing,
- flashDevice, flasherCleanup, dfuMode,
- serialCon, openSerialCon, sendCommand, closeSerialCon,
- refresh, commandReference
- }
+ return {
+ consoleEditBox, consoleWindow,
+ config, selected, flashing,
+ flashDevice, flasherCleanup, dfuMode,
+ serialCon, openSerialCon, sendCommand, closeSerialCon,
+ refresh, commandReference
+ }
}
const template = `
{{ flashing.error }}
- -Please do not disconnect the device
-- -
-{{ flashing.terminal }}
- {{ flashing.error }}
+ +Please do not disconnect the device
++ +
+{{ flashing.terminal }}
+