nuki_hub
nuki_hub copied to clipboard
M5Stack Atom S3 Lite not working
Hi all,
First of all: Apologies if this issue should be reported somewhere else. If so, please let me know.
I'm quite newbie on this ESP32/IoT stuff but recently received a Nuki Opener and I wanted to integrate it into Home Assistant without Nuki Bridge using your solution. I read M5Stack Atom Lite was recommended so I bought it... sort of, because the one I bought by mistake (I wasn't aware of differences) was the S3 one (https://docs.m5stack.com/en/core/AtomS3%20Lite) and... I'm struggling trying to install Nuki Hub on it. I'm not even sure if it is compatible at all :-(
From web installer I get this:
So I tried using espressif_download_tool. I have no errors
But the ESP32 AP doesn't appear so I just wonder if maybe this ESP32S3 is supported.
From 8.24 release notes I can see "Arduino Core for ESP32 to version 2.09" which is the latest and, appartently ESP32S3 are supported (https://docs.espressif.com/projects/arduino-esp32/en/latest/getting_started.html#supported-soc-s) so I guess it should work with nuki_hub and just maybe something should be tweaked at flashing process?
I will really appreciate if confirmation can be provided about this and, if it is not supported I will be glad to provide the information I can to help to test it.
UPDATE: I've been reading and finally tried the esptool method to deploy the files. It seems to confirm ESP32-S3 is not being supported. Is it planned to support it in the future?
C:\Temp\nukihub_8.24>python -m esptool --chip esp32s3 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xe000 boot_app0.bin 0x1000 bootloader_qio_80m.bin 0x10000 nuki_hub.bin 0x8000 nuki_hub.partitions.bin
esptool.py v4.6.2
Found 1 serial ports
Serial port COM4
Connecting...
Chip is ESP32-S3 (revision v0.1)
Features: WiFi, BLE
Crystal is 40MHz
MAC: [redacted]
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 8MB
Unexpected chip id in image. Expected 9 but value was 0. Is this image for a different chip model?
A fatal error occurred: bootloader_qio_80m.bin is not an ESP32-S3 image. Use --force to flash anyway.
Hi,
The binary doesn't work with the S3 variant. It's possible though to compile NUKI Hub for the S3, I have to see how I can release binaries for multiple variants. The regular non-S3 atom does work though,
Thank you @technyon for confirming ESP-S3 is not expected to work at the moment. Please, let me know if I should close this issue.
In the meantime, I will try to compile it, although I don't see a .no file for Arduino IDE so I guess the way to do that (compile for ESP-S3) is using the Development VM you shared, am I right?
Thank you for your support and work
It's unfortunately a little more complicated than that. It's a cmake based project, there's a virtual machine that is setup to compile the firmware ... see the readme at the bottom.
Thank you @technyon. It was definitely beyond my skills so I bought a M5Stack Atom Lite (no S3 version) and it is working. Only a very minor issue I've found (I'll raise another topic for that). Congrats for this project!!
To bad I didn't see this issue before buying my ESP.
I tried to use the M5STACK M5Stamp S3 - ESP32-S3 Development Board and ran into the same issue:
Unexpected chip id in image. Expected 9 but value was 0. Is this image for a different chip model?
A fatal error occurred: bootloader_qio_80m.bin is not an ESP32-S3 image. Use --force to flash anyway
Unfortunately the webinstaller didn't gave me the "not supported" notification as mentioned in this issue. So it took me a time to find out. Espresiff download tool just installed, but nothing worked. Finally noticed the notification when using esptool.
@technyon are you still planning to make the ESP32-S3 supported?
Hi,
yes I'm planning to look into it. I don't have an S3 for testing at the moment unfortunately.
I purchased the M5Stack Atom Lite because you recommended it, only to find out that the s3 model (which is the more current one IIUC) isn't yet supported by the existing firmware..
Concretely:
- Can we reopen this issue to track support of ESP32-S3 chips?
- Consider updating the line in the main readme.md recommending the M5 Atom Lite s.t. it mentions not to purchase the S3 model (until it's supported, that is).
I've tried to compile the firmware for S3, but I never got it to boot correctly. I think it would be great if we could manage this, because I've used them successfully with ESPresense and it appears their antenna (or the S3) chip is much more sensitive (far better RSSI).
Hi,
I see there's demand for the S3, so I think it makes sense to provide binaries for both chips in the future. Unfortunately I don't have access ton an S3 at the moment. Could you check if the archive below works on your S3?
Since this topic seems to have gained traction, I am reopening the case. I'll try to test that file (thanks @technyon ) too and revert asap
I have an https://github.com/Xinyuan-LilyGO/T-Dongle-S3 and will try the nukihub_s3_8.27-pre-1.zip image.
It can be flashed:
esptool.py --chip esp32s3 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x1000 bootloader-tinyuf2.bin 0x8000 nuki_hub.partitions.bin 0xe000 boot_app0.bin 0x10000 nuki_hub.bin
esptool.py v4.6.2
Serial port /dev/ttyACM0
Connecting...
Chip is ESP32-S3 (revision v0.1)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 34:85:18:58:a7:90
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00006fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00180fff...
Compressed 22624 bytes to 14245...
Wrote 22624 bytes (14245 compressed) at 0x00001000 in 0.4 seconds (effective 432.4 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 146...
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.1 seconds (effective 408.7 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 547.5 kbit/s)...
Hash of data verified.
Compressed 1509408 bytes to 963346...
Wrote 1509408 bytes (963346 compressed) at 0x00010000 in 13.0 seconds (effective 927.8 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
Unfortunately i don't see the wireless network it should start.
Do you have serial logs after flashing? Baud rate is 115200
Same as @werty1st: M5Stack Atom S3 Lite (https://docs.m5stack.com/en/core/AtomS3%20Lite) flashed apparently fine (baud 115200) but I can't see wireless network.
@technyon: What do you mean by "serial logs"?
C:\Temp\nukihub_s3_8.27-pre-1>python -m esptool --chip esp32s3 --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x1000 bootloader-tinyuf2.bin 0x8000 nuki_hub.partitions.bin 0xe000 boot_app0.bin 0x10000 nuki_hub.bin
esptool.py v4.6.2
Found 1 serial ports
Serial port COM3
Connecting...
Chip is ESP32-S3 (revision v0.1)
Features: WiFi, BLE
Crystal is 40MHz
MAC: [redacted]
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00006fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00180fff...
Compressed 22624 bytes to 14245...
Wrote 22624 bytes (14245 compressed) at 0x00001000 in 0.3 seconds (effective 653.1 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 146...
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.1 seconds (effective 202.0 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 642.8 kbit/s)...
Hash of data verified.
Compressed 1509408 bytes to 963346...
Wrote 1509408 bytes (963346 compressed) at 0x00010000 in 9.9 seconds (effective 1224.7 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
The logs you posted here from the flash process. When the firmware runs, it outputs debug messages to the serial bus. You can read them by using some terminal program like HTERM, setting the baud rate to 115200.
Thanks, got it!!
Not sure if it helps but it seems it only prints a bunch of "invalid header" messages. At the end, the connection is closed automatically (it feels like the device restarts itself)
invalid header: 0xffffffff
invalid header: 0xffffffff
(...)
invalid header: 0xffffffff
invalid header: 0xffffffff
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x7 (TG0WDT_SYS_RST),boot:0x28 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40049b21
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
(...)
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xfESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x7 (TG0WDT_SYS_RST),boot:0x28 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40048839
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
(...)
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
Broken firmware :)
I'll order an S3 and have a look.
Sounds like a similar issue I had when I tried to compile the S3 version myself.
I did get it working before, need to check what's wrong. But I need an S3 first.
Edit: scratch that. When I try to update the config (with the mqtt broker, etc.) it saves the config and then resets back to initial-setup mode (publishes a wifi network).
Just found a workaround for making it boot with the nukihub firmware -- note, I haven't tested the full functionality of nukihub but I at least managed to get the Atom S3 to boot (with the nukihub firmware). YMMV.
Steps:
- Put the S3 in BOOT mode
- Install some other s3-compatible esp32 firmware; I install ESPHome via the web installer.
- Go to the web server of the chip, and upload the
nuki_hub.binfile (I used the one from 8.27-pre-1 uploaded on this issue) via the OTA mechanism. - Reboot the esp32, see that it publishes its wifi, set it up, rejoice!
@technyon sorry if this is too hacky, but maybe the firmware itself is perfectly fine but only one of the other parts (bootloader, etc.) are broken..? Could be an easier fix. Just thinking out loud here.
Hi,
yes I agree it's most likely the wrong bootloader. I ordered an S3, but it's still being shipped. Estimated delivery date is 14th December, I'll try to figure out the correct bootloader then.
Maybe this helps https://github.com/platformio/platform-espressif32/blob/develop/boards/m5stack-atoms3.json tell me if you still need an S3 board i have a couple laying around.
Hi,
thanks I have an S3 now but unfortunately I wasn's successful so far. I'll have to do research about the bootloaders that are available.
ok the topic is definitively outside of my skill. esphome is talking about some binary preparation. https://esphome.github.io/esp-web-tools/ but I think you are already aware about it.
any update on s3 support?