From e6277be9e67b24d950077dc3ac2ba94b1076da14 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 25 Feb 2025 11:29:29 +0100 Subject: [PATCH] Release section Makefile cleaned up, HOWTO updated. --- Boards.h | 2 +- ...firmware-and-compile-it_MeesElectronics.md | 55 ++++++++++++++++++- Makefile | 21 +++---- 3 files changed, 66 insertions(+), 12 deletions(-) diff --git a/Boards.h b/Boards.h index 60becf8..9bc7c04 100644 --- a/Boards.h +++ b/Boards.h @@ -1044,7 +1044,7 @@ const int pin_btn_usr1 = 0; - #define HAS_NP true + #define HAS_NP false const int pin_np = 21; #if HAS_NP == false #if defined(EXTERNAL_LEDS) diff --git a/Documentation/HOWTO-change-firmware-and-compile-it_MeesElectronics.md b/Documentation/HOWTO-change-firmware-and-compile-it_MeesElectronics.md index fda4ca2..1a1dc5c 100644 --- a/Documentation/HOWTO-change-firmware-and-compile-it_MeesElectronics.md +++ b/Documentation/HOWTO-change-firmware-and-compile-it_MeesElectronics.md @@ -228,7 +228,60 @@ This will end with error 'This device has not been provisioned yet, cannot set f ### Migrating to a other system -When the rnode is flashed, it is signed with a key. If you conect the rnode to another system, this key cannot be validated. It is possible to write a new key to the rnode by erasing the eeprom and writing the local key to it. +When the rnode is flashed, it is signed with a key. If you connect the rnode to another system, this key cannot be validated. It is possible to write a new key to the rnode by erasing the eeprom and writing the local key to it. $ rnodeconf /dev/ttyACM0 --eeprom-wipe $ rnodeconf /dev/ttyACM0 -r --platform ESP32 --model a4 --product f0 --hwrev 3 + +### And then it did not work... + +After I had successfully flashed the board I started reticulum: + + $ rnsd -vvv + +It found the rnode, but it could not initialize the radio. It gave the following error: + + [2025-02-25 10:00:56] [Notice] Serial port /dev/ttyACM0 is now open + [2025-02-25 10:00:56] [Verbose] Configuring RNode interface... + [2025-02-25 10:00:56] [Verbose] Waiting for radio configuration validation for RNodeInterface[RNode LoRa Interface]... + [2025-02-25 10:00:56] [Debug] RNodeInterface[RNode LoRa Interface] Radio reporting frequency is 434.5 MHz + [2025-02-25 10:00:56] [Debug] RNodeInterface[RNode LoRa Interface] Radio reporting bandwidth is 250.0 KHz + [2025-02-25 10:00:56] [Debug] RNodeInterface[RNode LoRa Interface] Radio reporting TX power is 0 dBm + [2025-02-25 10:00:56] [Debug] RNodeInterface[RNode LoRa Interface] Radio reporting spreading factor is 10 + [2025-02-25 10:00:56] [Debug] RNodeInterface[RNode LoRa Interface] Radio reporting coding rate is 8 + [2025-02-25 10:00:56] [Verbose] RNodeInterface[RNode LoRa Interface] On-air bitrate is now 1.22 kbps + [2025-02-25 10:00:56] [Debug] RNodeInterface[RNode LoRa Interface] Radio reporting state is offline + [2025-02-25 10:00:56] [Error] TX power mismatch + [2025-02-25 10:00:56] [Error] Radio state mismatch + [2025-02-25 10:00:56] [Error] After configuring RNodeInterface[RNode LoRa Interface], the reported radio parameters did not match your configuration. + [2025-02-25 10:00:56] [Error] Make sure that your hardware actually supports the parameters specified in the configuration + [2025-02-25 10:00:56] [Error] Aborting RNode startup + +I checked the SPI communication with an oscilloscope and that all seemed to be working. I could find the problem. Than I remembered the second serial interface on the Waveshare board. This interface was available on the USB port via the onboard USB hub. Maybe the rnode spits out some sort of debug information. So I installed *screen* on my pc and started it: + + $ screen /dev/ttyACM1 115200 + +And sure enough, I saw som useful information scrolling across my screen: + + ESP-ROM:esp32s3-20210327 + Build:Mar 27 2021 + rst:0x1 (POWERON),boot:0x2b (SPI_FAST_FLASH_BOOT) + SPIWP:0xee + mode:DIO, clock div:1 + load:0x3fce3808,len:0x4bc + load:0x403c9700,len:0xbd8 + load:0x403cc700,len:0x2a0c + entry 0x403c98d0 + E (309) gpio: gpio_set_level(227): GPIO output gpio_num error + ESP-ROM:esp32s3-20210327 + Build:Mar 27 2021 + rst:0xc (RTC_SW_CPU_RST),boot:0x2b (SPI_FAST_FLASH_BOOT) + Saved PC:0x420f917e + SPIWP:0xee + mode:DIO, clock div:1 + load:0x3fce3808,len:0x4bc + load:0x403c9700,len:0xbd8 + load:0x403cc700,len:0x2a0c + entry 0x403c98d0 + E (309) gpio: gpio_set_level(227): GPIO output gpio_num error + diff --git a/Makefile b/Makefile index 9b4b626..afc31fb 100644 --- a/Makefile +++ b/Makefile @@ -153,7 +153,7 @@ firmware-heltec_t114: # Added board from Mees Electronics firmware-waveshare-esp32-s3-pico: check_bt_buffers - arduino-cli compile --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" $(COMMON_BUILD_FLAGS) --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x61\"" + arduino-cli compile --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" $(COMMON_BUILD_FLAGS) --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x61\" \"-DEXTERNAL_LEDS=true\"" upload-tbeam: arduino-cli upload -p $(or $(port), /dev/ttyACM0) --fqbn esp32:esp32:t-beam @@ -270,11 +270,11 @@ upload-techo: # Added board from Mees Electronics upload-waveshare-esp32-s3-pico: - arduino-cli upload -p $(or $(port), /dev/ttyACM0) --fqbn esp32:esp32:esp32s3 + arduino-cli upload -p $(or $(port), /dev/ttyACM1) --fqbn esp32:esp32:esp32s3 @sleep 1 - rnodeconf $(or $(port), /dev/ttyACM0) --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware_CE.ino.bin) + python3 ./Release/esptool/esptool.py --port $(or $(port), /dev/ttyACM1) --chip esp32-s3 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin @sleep 3 - python3 ./Release/esptool/esptool.py --port $(or $(port), /dev/ttyACM0) --chip esp32-s3 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin + rnodeconf $(or $(port), /dev/ttyACM0) --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware_CE.ino.bin) release: console-site spiffs-image $(shell grep ^release- Makefile | cut -d: -f1) @@ -519,10 +519,11 @@ release-heltec_t114: # Added by Mees Electronics release-waveshare-esp32-s3-pico: check_bt_buffers - arduino-cli compile --fqbn esp32:esp32:ttgo-lora32 $(COMMON_BUILD_FLAGS) --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x61\"" - cp ~/.arduino15/packages/esp32/hardware/esp32/$(ARDUINO_ESP_CORE_VER)/tools/partitions/boot_app0.bin build/rnode_firmware_lora32v21.boot_app0 - cp build/esp32.esp32.ttgo-lora32/RNode_Firmware_CE.ino.bin build/rnode_firmware_lora32v21.bin - cp build/esp32.esp32.ttgo-lora32/RNode_Firmware_CE.ino.bootloader.bin build/rnode_firmware_lora32v21.bootloader - cp build/esp32.esp32.ttgo-lora32/RNode_Firmware_CE.ino.partitions.bin build/rnode_firmware_lora32v21.partitions - zip --junk-paths ./Release/rnode_firmware_lora32v21.zip ./Release/esptool/esptool.py ./Release/console_image.bin build/rnode_firmware_lora32v21.boot_app0 build/rnode_firmware_lora32v21.bin build/rnode_firmware_lora32v21.bootloader build/rnode_firmware_lora32v21.partitions + arduino-cli compile --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" $(COMMON_BUILD_FLAGS) --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x61\" \"-DEXTERNAL_LEDS=true\"" + + cp ~/.arduino15/packages/esp32/hardware/esp32/$(ARDUINO_ESP_CORE_VER)/tools/partitions/boot_app0.bin build/ rnode_firmware_waveshare-esp32-s3-pico.boot_app0 + cp build/esp32.esp32.esp32s3/RNode_Firmware_CE.ino.bin build/ rnode_firmware_waveshare-esp32-s3-pico.bin + cp build/esp32.esp32.esp32s3/RNode_Firmware_CE.ino.bootloader.bin build/ rnode_firmware_waveshare-esp32-s3-pico.bootloader + cp build/esp32.esp32.esp32s3/RNode_Firmware_CE.ino.partitions.bin build/ rnode_firmware_waveshare-esp32-s3-pico.partitions + zip --junk-paths ./Release/ rnode_firmware_waveshare-esp32-s3-pico.zip ./Release/esptool/esptool.py ./Release/console_image.bin build/ rnode_firmware_waveshare-esp32-s3-pico.boot_app0 build/ rnode_firmware_waveshare-esp32-s3-pico.bin build/ rnode_firmware_waveshare-esp32-s3-pico.bootloader build/ rnode_firmware_waveshare-esp32-s3-pico.partitions rm -r build