From f4d368e1f4a998c91d9c6a4e79ed99ab8c99c246 Mon Sep 17 00:00:00 2001 From: geeksville Date: Tue, 24 Mar 2020 14:43:55 -0700 Subject: [PATCH] fix #27 - add a device-install.sh script to the release --- README.md | 60 ++++++++++++++++++++++++++++++++++++------- bin/build-all.sh | 4 +-- bin/device-install.sh | 11 ++++++++ release/.gitignore | 1 + 4 files changed, 65 insertions(+), 11 deletions(-) create mode 100755 bin/device-install.sh diff --git a/README.md b/README.md index 565dd0349..b99fe24da 100644 --- a/README.md +++ b/README.md @@ -51,31 +51,73 @@ Warning: ESP32 has no Chip ID. Reading MAC instead. MAC: 24:6f:28:b5:36:71 Hard resetting via RTS pin... ``` -6. Install the correct firmware for your board with "esptool.py write_flash 0x10000 firmware-_board_-_country_.bin". For instance "esptool.py write_flash 0x10000 release/firmware-HELTEC-US-0.0.3.bin". You should see something like this: +6. cd into the directory where the release zip file was expanded. +7. Install the correct firmware for your board with "device-install.sh firmware-_board_-_country_.bin". For instance "./device-install.sh firmware-HELTEC-US-0.0.3.bin". You should see something like this: ``` -~/development/meshtastic/meshtastic-esp32$ esptool.py write_flash 0x10000 release/firmware-HELTEC-US-0.0.3.bin +kevinh@kevin-server:~/development/meshtastic/meshtastic-esp32/release/latest$ ./device-install.sh firmware-TBEAM-US-0.1.8.bin +Trying to flash firmware-TBEAM-US-0.1.8.bin, but first erasing and writing system information esptool.py v2.6 Found 2 serial ports Serial port /dev/ttyUSB0 -Connecting...... +Connecting........____ Detecting chip type... ESP32 Chip is ESP32D0WDQ6 (revision 1) Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None -MAC: 24:6f:28:b5:36:71 +MAC: 24:6f:28:b2:01:6c Uploading stub... Running stub... Stub running... +Changing baud rate to 921600 +Changed. +Erasing flash (this may take a while)... +Chip erase completed successfully in 6.1s +Hard resetting via RTS pin... +esptool.py v2.6 +Found 2 serial ports +Serial port /dev/ttyUSB0 +Connecting....... +Detecting chip type... ESP32 +Chip is ESP32D0WDQ6 (revision 1) +Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None +MAC: 24:6f:28:b2:01:6c +Uploading stub... +Running stub... +Stub running... +Changing baud rate to 921600 +Changed. Configuring flash size... -Auto-detected Flash size: 8MB -Compressed 1184800 bytes to 652635... -Wrote 1184800 bytes (652635 compressed) at 0x00010000 in 57.6 seconds (effective 164.5 kbit/s)... +Auto-detected Flash size: 4MB +Flash params set to 0x0220 +Compressed 61440 bytes to 11950... +Wrote 61440 bytes (11950 compressed) at 0x00001000 in 0.2 seconds (effective 3092.4 kbit/s)... +Hash of data verified. + +Leaving... +Hard resetting via RTS pin... +esptool.py v2.6 +Found 2 serial ports +Serial port /dev/ttyUSB0 +Connecting..... +Detecting chip type... ESP32 +Chip is ESP32D0WDQ6 (revision 1) +Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None +MAC: 24:6f:28:b2:01:6c +Uploading stub... +Running stub... +Stub running... +Changing baud rate to 921600 +Changed. +Configuring flash size... +Auto-detected Flash size: 4MB +Compressed 1223568 bytes to 678412... +Wrote 1223568 bytes (678412 compressed) at 0x00010000 in 10.7 seconds (effective 912.0 kbit/s)... Hash of data verified. Leaving... Hard resetting via RTS pin... ``` -7. The board will boot and show the Meshtastic logo. -8. Please post a comment on our chat so we know if these instructions worked for you ;-). If you find bugs/have-questions post there also - we will be rapidly iterating over the next few weeks. +8. The board will boot and show the Meshtastic logo. +9. Please post a comment on our chat so we know if these instructions worked for you ;-). If you find bugs/have-questions post there also - we will be rapidly iterating over the next few weeks. ## Meshtastic Android app The source code for the (optional) Meshtastic Android app is [here](https://github.com/meshtastic/Meshtastic-Android). diff --git a/bin/build-all.sh b/bin/build-all.sh index 0cdecaa91..9dbc2fb48 100755 --- a/bin/build-all.sh +++ b/bin/build-all.sh @@ -5,7 +5,7 @@ set -e source bin/version.sh COUNTRIES="US EU433 EU865 CN JP" -# COUNTRIES=US +#COUNTRIES=US SRCMAP=.pio/build/esp32/output.map SRCBIN=.pio/build/esp32/firmware.bin @@ -54,6 +54,6 @@ Generated by bin/buildall.sh --> XML rm -f $ARCHIVEDIR/firmware-$VERSION.zip -zip $ARCHIVEDIR/firmware-$VERSION.zip $OUTDIR/firmware-*-$VERSION.* +zip --junk-paths $ARCHIVEDIR/firmware-$VERSION.zip $OUTDIR/firmware-*-$VERSION.* images/system-info.bin bin/device-install.sh echo BUILT ALL \ No newline at end of file diff --git a/bin/device-install.sh b/bin/device-install.sh new file mode 100755 index 000000000..1101e26b1 --- /dev/null +++ b/bin/device-install.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +FILENAME=$1 + +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 0x10000 $FILENAME + diff --git a/release/.gitignore b/release/.gitignore index 9688c673a..cb3628489 100644 --- a/release/.gitignore +++ b/release/.gitignore @@ -1,3 +1,4 @@ +*.elf *.bin *.map *.zip \ No newline at end of file