diff --git a/README.md b/README.md index dd0bf50..b0c4efd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Black Magic Probe for ESP32-S2 +# Black Magic Probe / DapLink for ESP32-S2 -WiFi/USB capable version of the famous Black Magic Probe debugger. +WiFi/USB capable version of the famous BlackMagicProbe (or DapLink) debugger. # Clone the Repository @@ -32,22 +32,26 @@ Run: idf.py -p flash ``` -## Test with ESP-IDF - -Connect to the dev board with: -```shell -idf.py -p monitor -``` - -You should not see errors in the logs if the firmware is installed and running correctly. - ## Web interface development Web interface is located in `components/svelte-portal` and written in Svelte. To build it, you need to install Node.js and run `npm install` in `components/svelte-portal` directory. Then you can run `npm run dev` to start development server or `npm run build` to build production version. -Typical workflow is to fix the board's IP address in `components/svelte-portal/src/App.svelte` and then run `npm run dev`. After that, you can open `http://localhost:5000` in your browser and see changes in the web interface in real time with live reload. +Typical workflow is to fix the board's IP address in `components/svelte-portal/src/lib/Api.svelte` and then run `npm run dev`. After that, you can open `http://localhost:5000` in your browser and see changes in the web interface in real time with live reload. + +If you want to change local ip or port, you need to run `export HOST={ip} PORT={port}` before `npm run dev`. + +```shell +export HOST=127.0.0.1 PORT=3000 +npm run dev +``` When you're done, you need to run `npm run build`, `idf.py build` and then `idf.py -p flash`. You can then open `http://blackmagic.local` in your browser and see the changes in the web interface. +```shell +npm run build +idf.py build +idf.py -p flash +``` + ## Schematic diff --git a/components/svelte-portal/src/lib/Api.svelte b/components/svelte-portal/src/lib/Api.svelte index 3fc6007..0a006d1 100644 --- a/components/svelte-portal/src/lib/Api.svelte +++ b/components/svelte-portal/src/lib/Api.svelte @@ -2,32 +2,9 @@ let server = ""; if (development_mode) { - server = "http://172.30.1.206"; + server = "http://172.30.1.83"; } - // export const api_dev_mode = development_mode; - - // export const api_server = server; - - // export async function api_post(api, data) { - // const res = await fetch(api_server + api, { - // method: "POST", - // body: JSON.stringify(data), - // }); - - // const json = await res.json(); - // return json; - // } - - // export async function api_get(api) { - // const res = await fetch(api_server + api, { - // method: "GET", - // }); - - // const json = await res.json(); - // return json; - // } - export const api = { server: server, dev_mode: development_mode, diff --git a/components/svelte-portal/src/lib/UartTerminal.svelte b/components/svelte-portal/src/lib/UartTerminal.svelte index f8f307f..b09d6c7 100644 --- a/components/svelte-portal/src/lib/UartTerminal.svelte +++ b/components/svelte-portal/src/lib/UartTerminal.svelte @@ -108,7 +108,7 @@ {/if}
-
{#await api.get("/api/v1/uart/get_config", {})}