Skip to content

Instantly share code, notes, and snippets.

@opatut
Last active March 3, 2023 18:49
Show Gist options
  • Save opatut/c1690ad5b79f6c46fe441b192fb38bf3 to your computer and use it in GitHub Desktop.
Save opatut/c1690ad5b79f6c46fe441b192fb38bf3 to your computer and use it in GitHub Desktop.
OpenBikeSensor Configuration Flasher
spiffsgen.py
*/cfg.obs
*.spiffs

Instant flashing of OpenBikeSensor configuration

  • Create a directory for your config. Le'ts call it myconfig.

  • Create a file myconfig/cfg.obs with the configuration JSON content:

    {"obs":[{"displayConfig": 783}]}

    This example file would enable advanced display options.

  • Make sure esptool or esptool.py is installed. If it is somewhere weird, run the following with ESPTOOL environment variable set to point to your esptool command.

  • Run configure.sh myconfig

#!/bin/bash
set -e
name=$1
shift
esptool=${ESPTOOL:-esptool}
if ! which $esptool >/dev/null 2>/dev/null ; then
esptool=esptool.py
fi
if ! which $esptool >/dev/null 2>/dev/null ; then
echo "esptool.py not found, please set ESPTOOL variable"
exit 1
fi
if [ ! -f $name/cfg.obs ]; then
echo "No config at $name."
exit 1
fi
if [ ! -f spiffsgen.py ]; then
wget https://raw.githubusercontent.com/espressif/esp-idf/639e7ad494d93fc82159f9fe854041bc43a96d5f/components/spiffs/spiffsgen.py
fi
python spiffsgen.py 0x030000 $name $name.spiffs
$esptool write_flash 0x3D0000 $name.spiffs $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment