maximkulkin / esp32-homekit-camera

Firmware for esp32-camera module to act as Apple Homekit IP camera
MIT License
395 stars 79 forks source link

HomeKit: Failed to write accessory ID to flash #10

Closed 01matrix01 closed 5 years ago

01matrix01 commented 5 years ago

Hello Maxim, I'm testing this board: ESP32-CAM https://loboris.eu/ESP32/ESP32-CAM%20Product%20Specification.pdf

I edit esp-idf/components/partition_table/partitions_singleapp.csv with factory, app, factory, , 2M, from 0x1F0000

I'm getting this error:

make -C esp32-homekit-camera/ monitor make: ingresso nella directory "/home/pi/Camera/esp32-homekit-camera" Toolchain path: /home/pi/esp32-elf/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc Toolchain version: crosstool-ng-1.22.0-80-g6c4433a Compiler version: 5.2.0 Python requirements from /home/pi/esp-idf/requirements.txt are satisfied. MONITOR --- idf_monitor on /dev/ttyUSB0 115200 --- --- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --- I (804) wifi: new:<3,0>, old:<1,0>, ap:<255,255>, sta:<3,0>, prof:1 I (1784) wifi: state: init -> auth (b0) I (2784) wifi: state: auth -> init (200) I (2784) wifi: new:<3,0>, old:<3,0>, ap:<255,255>, sta:<3,0>, prof:1 STA disconnected STA disconnected I (4964) wifi: new:<3,0>, old:<3,0>, ap:<255,255>, sta:<3,0>, prof:1 I (4964) wifi: state: init -> auth (b0) I (4964) wifi: state: auth -> assoc (0) I (4984) wifi: state: assoc -> run (10) I (6004) wifi: connected with MYWIFI-12345678, channel 3, bssid = xx:xx:xx:xx:xx:xx I (6004) wifi: pm start, type: 1

I (14214) event: sta ip: 192.168.1.11, mask: 255.255.255.0, gw: 192.168.1.1 WiFI ready I (14214) esp32_camera: Free heap: 230784 I (14214) gpio: GPIO[13]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 I (14224) gpio: GPIO[14]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 I (14234) gpio: GPIO[32]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (14334) gpio: GPIO[35]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 I (14334) gpio: GPIO[34]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 I (14344) gpio: GPIO[39]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 I (14354) gpio: GPIO[36]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 I (14364) gpio: GPIO[21]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 I (14374) gpio: GPIO[19]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 I (14384) gpio: GPIO[18]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 I (14394) gpio: GPIO[5]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 I (14404) gpio: GPIO[25]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 I (14414) gpio: GPIO[23]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 I (14414) gpio: GPIO[22]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 I (14434) camera: Allocating 2 frame buffers (75 KB total) I (14434) camera: Allocating 37 KB frame buffer in OnBoard RAM I (14444) camera: Allocating 37 KB frame buffer in OnBoard RAM E (14444) gpio: gpio_install_isr_service(394): GPIO isr service already installed

HomeKit: Starting server HomeKit: Formatting flash at 0x200000 !!! HomeKit: Failed to erase flash HomeKit: Generated new accessory ID: DA:C5:53:9F:E0:E2 !!! HomeKit: Failed to write accessory ID to flash HomeKit: Generated new accessory key !!! HomeKit: Failed to write accessory key to flash HomeKit: Configuring mDNS HomeKit: Got new client connection: 55 HomeKit: [Client 55] Pair Setup Step 1/3 HomeKit: [Client 55] Pair Setup Step 2/3 HomeKit: [Client 55] Pair Setup Step 3/3 !!! HomeKit: Failed to write pairing info to flash !!! HomeKit: [Client 55] Failed to store pairing (code -1) HomeKit: [Client 55] Closing client connection

Thanks for your reply

maximkulkin commented 5 years ago

You need to move base address for HomeKit settings storage since your change now makes it overlap with code app partition. In menuconfig (make menuconfig), go to Component config -> HomeKit -> SPI flash address for storing HomeKit data and change it from 0x200000 to 0x201000 (or 0x202000). That should be enough to unblock it.