diff --git a/README.md b/README.md index 9c83c7d..e6a1c81 100644 --- a/README.md +++ b/README.md @@ -240,6 +240,7 @@ Currently supported hardware: * Raspberry Pi with [Dragino LoRa GPS HAT](https://wiki.dragino.com/index.php?title=Lora/GPS_HAT) * [Pycom LoPy 4](https://pycom.io/product/lopy4/) with external USB-to-Serial converter ([Documentation](docs/board_lopy4.md)) * [Adafruit Feather M0 LoRa](https://www.adafruit.com/product/3178) +* [LILYGO T-Beam](https://github.com/Xinyuan-LilyGO/LilyGo-LoRa-Series), v1.1 ## Development diff --git a/chirpotle.sh b/chirpotle.sh index 0993a61..e19213e 100755 --- a/chirpotle.sh +++ b/chirpotle.sh @@ -339,6 +339,21 @@ function chirpotle_deploy { fi fi + # Build T-Beam (UART mode) + if [[ "$USED_FIRMWARES" =~ " t-beam-uart " ]] || [[ $BUILD_ALL == 1 ]]; then + PRECONF=t-beam-uart make -C "$APPDIR" clean all preflash + if [[ "$?" != "0" ]]; then + echo "Building the companion application failed for (T-Beam, uart)." >&2 + exit 1 + fi + (mkdir -p "$APPDIR/dist/t-beam-uart" && cp "$REPODIR/submodules/RIOT/cpu/esp32/bin/bootloader.bin" \ + "$APPDIR/bin/esp32-wroom-32/partitions.csv" "$APPDIR/bin/esp32-wroom-32"/*.bin "$APPDIR/dist/t-beam-uart/") + if [[ "$?" != "0" ]]; then + echo "Creating distribution of companion application failed for (T-Beam, uart)." >&2 + exit 1 + fi + fi + # Build Feather M0 (UART mode) if [[ "$USED_FIRMWARES" =~ " lora-feather-m0 " ]] || [[ $BUILD_ALL == 1 ]]; then PRECONF=lora-feather-m0 make -C "$APPDIR" clean all diff --git a/node/companion-app/riot-apps/chirpotle-companion/Makefile.preconf b/node/companion-app/riot-apps/chirpotle-companion/Makefile.preconf index b831235..f31d20b 100644 --- a/node/companion-app/riot-apps/chirpotle-companion/Makefile.preconf +++ b/node/companion-app/riot-apps/chirpotle-companion/Makefile.preconf @@ -240,7 +240,38 @@ ifeq ($(PRECONF),lopy4-uart) endif # ------------------------------------------------------------------------------ -# esp32-generic: Generic ESP32 board manually wired to a transceiver +# t-beam: TTGO/LILYGO T-Beam ESP32 board manually wired to a transceiver +# ------------------------------------------------------------------------------ +# The TTGO/LILYGO T-Beam is an ESP32-based board with GPS and LoRa module on it. +# The following configuration is based on the LILYGO variant, Rev 1.1: +# - https://github.com/Xinyuan-LilyGO/LilyGo-LoRa-Series/blob/master/assets/image/t-beam_v1.1_pinmap.jpg +# - https://github.com/Xinyuan-LilyGO/LilyGo-LoRa-Series/blob/master/schematic/LilyGo_TBeam_V1.1.pdf +# +# Sadly, DIO3 is not connected on these boards. +ifeq ($(PRECONF),t-beam-uart) + # Use the generic wroom-32 board as basis + BOARD = esp32-wroom-32 + + # For simplicity: Same SPI pins as for the ESP32 + LORA_SPI_BUS ?= "SPI_DEV(0)" + CFLAGS += -DSPI0_SCK=GPIO5 + CFLAGS += -DSPI0_MISO=GPIO19 + CFLAGS += -DSPI0_MOSI=GPIO27 + LORA_SPI_CS ?= GPIO18 + LORA_GPIO_RESET ?= GPIO23 + + LORA_GPIO_DIO0 ?= GPIO26 + + # Jam on button press + LORA_GPIO_JAMMER ?= GPIO38 + + # We use the TCP interface over WiFi + INTERFACE ?= uart + +endif + +# ------------------------------------------------------------------------------ +# esp32-generic: Generic ESP32 board with LoRa and GPS, v1.1 # ------------------------------------------------------------------------------ # Setup is very similar to the LoPy, but you can use any ESP32 DevBoard and # connect a LoRa Transceiver to it, like the [Dragino LoRa Bee](https://wiki.dragino.com/index.php?title=Lora_BEE) diff --git a/node/remote-modules/requirements.txt b/node/remote-modules/requirements.txt index 42d3576..6c6b6b1 100644 --- a/node/remote-modules/requirements.txt +++ b/node/remote-modules/requirements.txt @@ -1,3 +1,3 @@ py_ubjson==0.13.0 pyserial==3.4 -esptool==2.8 +esptool==3.0 diff --git a/scripts/conf-editor.py b/scripts/conf-editor.py index 56f1d12..2041973 100755 --- a/scripts/conf-editor.py +++ b/scripts/conf-editor.py @@ -366,8 +366,9 @@ def prompt_conntype(): "None". ''') firmwares = { - "LoPy 4 via UART": "lopy4-uart", - "LoRa Feather M0": "lora-feather-m0", + "Pycom LoPy 4 via UART": "lopy4-uart", + "Adafruit LoRa Feather M0": "lora-feather-m0", + "LILYGO T-Beam v1.1 via UART": "t-beam-uart", } firmware = Bullet( prompt="Which firmware should be flashed to the MCU?", diff --git a/scripts/list-used-firmwares.py b/scripts/list-used-firmwares.py index 47eb77c..c0c388b 100755 --- a/scripts/list-used-firmwares.py +++ b/scripts/list-used-firmwares.py @@ -50,6 +50,7 @@ def conf_path_to_obj(d): "lora-feather-m0": "arm_none", "lopy4-uart": "esp32", "lopy4": "esp32", + "t-beam-uart": "esp32", "native-raspi": "arm_linux", } used_platforms = set()