markqvist / rnodeconfigutil

MIT License
25 stars 11 forks source link

Could not download EEPROM from device, error after rnodeconf --autoinstall #10

Closed josephbu closed 2 years ago

josephbu commented 2 years ago

Hi Mark, I'm getting this error after trying to use autoinstall, I've attempted the autoinstall against a T-Beam and also a lora32 device.

Before doing the install, T-Beam contained a different firmware:

pi@raspberrypi:~/rnode_installs $ rnodeconf --info /dev/ttyACM0
[2022-03-31 21:25:04] Opening serial port /dev/ttyACM0...
[2022-03-31 21:25:07] Serial port opened, but RNode did not respond. Is a valid firmware installed?
Got invalid response while detecting device

Then I ran rnodeconf --autoinstall selected the device and frequency etc The install appeared to run through ok, however after the install receiving the error Is a valid firmware installed?.

pi@raspberrypi:~/rnode_installs $ rnodeconf --autoinstall

Hello!

This guide will help you install the RNode firmware on supported
and homebrew devices. Please connect the device you wish to set
up now. Hit enter when it is connected.

Detected serial ports:
  [1] /dev/ttyAMA0 (None, None)
  [2] /dev/ttyACM0 (USB Single Serial, 5426006063)

What serial port is your device connected to? 2

Ok, using device on /dev/ttyACM0 (USB Single Serial, 5426006063)

Probing device...
[2022-03-31 21:25:40] No answer from device

It looks like this is a fresh device with no RNode firmware.
What kind of device is this?

[1] Original RNode
[2] Homebrew RNode
[3] LilyGO T-Beam
[4] LilyGO LoRa32 v2.0
[5] LilyGO LoRa32 v2.1

? 3

---------------------------------------------------------------------------
Important! Using RNode firmware on T-Beam devices should currently be
considered experimental. It is not intended for production or critical use.
The currently supplied firmware is provided AS-IS as a courtesey to those
who would like to experiment with it. If you want any degree of reliability,
please use an actual RNode from unsigned.io. Hit enter to continue.
---------------------------------------------------------------------------

What band is this T-Beam for?

[1] 433 MHz
[2] 868 MHz
[3] 915 MHz
[4] 923 MHz

? 1

Ok, that should be all the information we need. Please confirm the following
summary before proceeding. In the next step, the device will be flashed and
provisioned, so make that you are satisfied with your choices.

Serial port     : /dev/ttyACM0
Device type     : LilyGO T-Beam 420 - 520 MHz
Platform        : ESP32
Device MCU      : Espressif Systems ESP32
Firmware file   : rnode_firmware_latest_tbeam.zip

Is the above correct? [y/N] y
[2022-03-31 21:26:25] Downloading latest frimware from GitHub...
[2022-03-31 21:26:26] Firmware download completed
[2022-03-31 21:26:26] Generating a new signing key...
[2022-03-31 21:26:30] Extracting firmware...
Archive:  ./update/rnode_firmware_latest_tbeam.zip
  inflating: ./update/rnode_firmware_latest_tbeam.boot_app0  
  inflating: ./update/rnode_firmware_latest_tbeam.bin  
  inflating: ./update/rnode_firmware_latest_tbeam.bootloader  
  inflating: ./update/rnode_firmware_latest_tbeam.partitions  
  inflating: ./update/esptool.py     
[2022-03-31 21:26:30] Firmware extracted
[2022-03-31 21:26:30] Flashing RNode firmware to device on /dev/ttyACM0
esptool.py v3.1
Serial port /dev/ttyACM0
Connecting.....
Chip is ESP32-D0WDQ6-V3 (revision 3)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 30:c6:f7:1f:08:7c
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00010000 to 0x00055fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Compressed 8192 bytes to 47...
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 485.6 kbit/s)...
Hash of data verified.
Compressed 17104 bytes to 11804...
Wrote 17104 bytes (11804 compressed) at 0x00001000 in 0.6 seconds (effective 211.7 kbit/s)...
Hash of data verified.
Compressed 283792 bytes to 158251...
Wrote 283792 bytes (158251 compressed) at 0x00010000 in 4.8 seconds (effective 474.8 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.1 seconds (effective 337.9 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
[2022-03-31 21:26:41] Done flashing
[2022-03-31 21:26:41] Waiting for ESP32 reset...
[2022-03-31 21:26:46] Opening serial port /dev/ttyACM0...
[2022-03-31 21:26:48] Device connected
[2022-03-31 21:26:48] Current firmware version: 1.27
[2022-03-31 21:26:48] Reading EEPROM...
[2022-03-31 21:26:49] Could not download EEPROM from device. Is a valid firmware installed?

Thoughts on how best to proceed with this one? Is there any further information that I can provide?

markqvist commented 2 years ago

That's odd. I don't think that it should be any problem if you had another firmware on there in the first place, since the installer sets up it's own partition map for flash, bootloader, EEPROM and such. Can you share the following details:

Thanks!

josephbu commented 2 years ago

Given that I see the same on both devices, I suspect it might have something to do with the host. I'll try to sort out another machine to test an install from.

markqvist commented 2 years ago

Hmm, interesting. Hold on a minute, I'll compile a version of rnodeconf with longer wait times for EEPROM download and see if that solves anything.

You don't have anything else running on there that could be probing the serial ports? Octoprint or something similar?

markqvist commented 2 years ago

rnodeconf-1.2.1.debug.zip

Here is a debug build. Unzip the file and you can install it with:

pip install ./rnodeconf-1.2.1.debug-py3-none-any.whl

Can you let me know if that works?

I increased the timeouts for EEPROM download significantly.

josephbu commented 2 years ago

Just confirming that hardware is Raspberry Pi Model B Rev 2 so very old, and no other serial devices were attached.

I installed the debug build and it worked perfectly fine, I was able to install rnode and verify the install, thanks so much! Now to the next part!

pi@raspberrypi:~/rnode_installs $ rnodeconf --info /dev/ttyACM0
[2022-04-02 08:07:13] Opening serial port /dev/ttyACM0...
[2022-04-02 08:07:16] Device connected
[2022-04-02 08:07:16] Current firmware version: 1.27
[2022-04-02 08:07:16] Reading EEPROM...
[2022-04-02 08:07:20] EEPROM checksum correct
[2022-04-02 08:07:20] Device signature validated
[2022-04-02 08:07:20] 
[2022-04-02 08:07:20] Device info:
[2022-04-02 08:07:20]   Product            : LilyGO T-Beam 420 - 520 MHz (e0:e4:33)
[2022-04-02 08:07:20]   Device signature   : Validated - Local signature
[2022-04-02 08:07:20]   Firmware version   : 1.27
[2022-04-02 08:07:20]   Hardware revision  : 1
[2022-04-02 08:07:20]   Serial number      : 00:00:00:01
[2022-04-02 08:07:20]   Frequency range    : 420.0 MHz - 520.0 MHz
[2022-04-02 08:07:20]   Max TX power       : 14 dBm
[2022-04-02 08:07:20]   Manufactured       : 2022-04-02 08:06:53
[2022-04-02 08:07:20]   Device mode        : Normal (host-controlled)
markqvist commented 2 years ago

Closing this since it is resolved. Next version of rnodeconf will include longer timeouts for ESP32-based devices to accommodate for possible longer EEPROM download times on older Pi hardware.