diff --git a/bin/build-all.sh b/bin/build-all.sh index 9f0888f03..ab779e187 100755 --- a/bin/build-all.sh +++ b/bin/build-all.sh @@ -9,7 +9,7 @@ COUNTRIES="US EU433 EU865 CN JP ANZ KR" #COUNTRIES=CN BOARDS_ESP32="tlora-v2 tlora-v1 tlora-v2-1-1.6 tbeam heltec tbeam0.7" -# BOARDS_ESP32=tbeam +#BOARDS_ESP32=tbeam # FIXME note nrf52840dk build is for some reason only generating a BIN file but not a HEX file nrf52840dk-geeksville is fine BOARDS_NRF52="lora-relay-v1" @@ -87,8 +87,12 @@ platformio lib update do_boards "$BOARDS_ESP32" "false" do_boards "$BOARDS_NRF52" "true" +echo "Building SPIFFS for ESP32 targets" +pio run --environment tbeam -t buildfs +cp .pio/build/tbeam/spiffs.bin $OUTDIR/bins/universal/spiffs-$VERSION.bin + # keep the bins in archive also -cp $OUTDIR/bins/firmware* $OUTDIR/elfs/firmware* $OUTDIR/bins/universal/firmware* $OUTDIR/elfs/universal/firmware* $ARCHIVEDIR +cp $OUTDIR/bins/firmware* $OUTDIR/bins/universal/spiffs* $OUTDIR/elfs/firmware* $OUTDIR/bins/universal/firmware* $OUTDIR/elfs/universal/firmware* $ARCHIVEDIR echo Updating android bins $OUTDIR/forandroid rm -rf $OUTDIR/forandroid @@ -109,6 +113,6 @@ XML echo Generating $ARCHIVEDIR/firmware-$VERSION.zip rm -f $ARCHIVEDIR/firmware-$VERSION.zip -zip --junk-paths $ARCHIVEDIR/firmware-$VERSION.zip $OUTDIR/bins/firmware-*-$VERSION.* images/system-info.bin bin/device-install.sh bin/device-update.sh +zip --junk-paths $ARCHIVEDIR/firmware-$VERSION.zip $ARCHIVEDIR/spiffs-$VERSION.bin $OUTDIR/bins/firmware-*-$VERSION.* images/system-info.bin bin/device-install.sh bin/device-update.sh echo BUILT ALL diff --git a/bin/device-install.sh b/bin/device-install.sh index fb374d091..3d5f27af8 100755 --- a/bin/device-install.sh +++ b/bin/device-install.sh @@ -1,5 +1,7 @@ #!/bin/sh +set -e + # Usage info show_help() { cat << EOF @@ -36,6 +38,7 @@ if [ -f "${FILENAME}" ]; then echo "Trying to flash ${FILENAME}, but first erasing and writing system information" esptool.py --baud 921600 erase_flash esptool.py --baud 921600 write_flash 0x1000 system-info.bin + esptool.py --baud 921600 write_flash 0x00390000 spiffs-*.bin esptool.py --baud 921600 write_flash 0x10000 ${FILENAME} else echo "Invalid file: ${FILENAME}" diff --git a/bin/version.sh b/bin/version.sh index 8a7fb3ca3..2e7677737 100644 --- a/bin/version.sh +++ b/bin/version.sh @@ -1,3 +1,3 @@ -export VERSION=1.1.8 \ No newline at end of file +export VERSION=1.1.9 \ No newline at end of file diff --git a/data/static/basic.js b/data/static/basic.js new file mode 100644 index 000000000..5cbb8d72b --- /dev/null +++ b/data/static/basic.js @@ -0,0 +1,43 @@ +var meshtasticClient; +var connectionOne; + + +// Important: the connect action must be called from a user interaction (e.g. button press), otherwise the browsers won't allow the connect +function connect() { + + // Create new connection + var httpconn = new meshtasticjs.IHTTPConnection(); + + // Set connection params + let sslActive; + if (window.location.protocol === 'https:') { + sslActive = true; + } else { + sslActive = false; + } + let deviceIp = window.location.hostname; // Your devices IP here + + + // Add event listeners that get called when a new packet is received / state of device changes + httpconn.addEventListener('fromRadio', function (packet) { console.log(packet) }); + + // Connect to the device async, then send a text message + httpconn.connect(deviceIp, sslActive) + .then(result => { + + alert('device has been configured') + // This gets called when the connection has been established + // -> send a message over the mesh network. If no recipient node is provided, it gets sent as a broadcast + return httpconn.sendText('meshtastic is awesome'); + + }) + .then(result => { + + // This gets called when the message has been sucessfully sent + console.log('Message sent!'); + }) + + .catch(error => { console.log(error); }); + +} + diff --git a/data/static/index.html b/data/static/index.html new file mode 100644 index 000000000..663203013 --- /dev/null +++ b/data/static/index.html @@ -0,0 +1,18 @@ + + + +
+ +