Skip to content

Commit

Permalink
Merge pull request #6 from fhessel/feature/board-t-beam
Browse files Browse the repository at this point in the history
Add support for LILYGO T-Beam
  • Loading branch information
fhessel authored Dec 2, 2022
2 parents 2e13e83 + 42d037e commit ef9d997
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
15 changes: 15 additions & 0 deletions chirpotle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion node/remote-modules/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
py_ubjson==0.13.0
pyserial==3.4
esptool==2.8
esptool==3.0
5 changes: 3 additions & 2 deletions scripts/conf-editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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?",
Expand Down
1 change: 1 addition & 0 deletions scripts/list-used-firmwares.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit ef9d997

Please sign in to comment.