HausnerR / esphome-door-lock

IoT door lock based on Wemos D1 mini and RC522 RFID module
MIT License
42 stars 18 forks source link

Failed to open users list file! (rfid_users_list.db) #7

Closed AshrafMikhael closed 1 year ago

AshrafMikhael commented 1 year ago

Hello Thanks for your great esphome-door-look. Everything is working fine, except that error of opening users list file and I receive the below error. Where should I put this file.

[0;35m[C][switch.gpio:011]: Setting up GPIO Switch 'Door lock'... [D][switch:017]: 'Door lock' Turning OFF. [D][switch:037]: 'Door lock': Sending state OFF [D][switch:017]: 'Door lock' Turning OFF. [D][rfid:062]: Loading users list from file... [E][rfid:066]: Failed to open users list file!

Thanks Ashraf

BartEngelen commented 1 year ago

Did you send the users list with Home Assistant service Upload Users?

AshrafMikhael commented 1 year ago

Yes, and I got error

[0;36m[D][rfid:100]: Saving users list to file... [1;31m[E][rfid:104]: Failed to open users list file!

I think the error due to the users list file "rfid_users_list.db" is not uploaded to esp8266. how can i upload this file? Thanks

BartEngelen commented 1 year ago

That's strange did you use the following structure to upload the users: (Services: RFID_UPLOAD_USERS_LIST) [ "XX:XX:XX:XX=Example 1", "XX:XX:XX:XX=Example 2" ]

AshrafMikhael commented 1 year ago

Sure, I use this structure. I call the service from HA Service "ESPHome: door_lock_upload_users_list"

I am using HA ESPhome to compile and install the code on ESP8266 MCU.

I uploaded the file "rfid_users_list.db" to HA under "/config/esphome" folder, is this the correct location for this file?

Also I tried to upload it directly to esp8266 using arduino IDE DATA Upload tool but no clue.

Thanks

AshrafMikhael commented 1 year ago

Sorry, I was missing that the SPIFFS.open("/rfid_users_list.db", "w") function will create the file when calling the service "ESPHome: door_lock_upload_users_list". So, May there is a problem with esp8266 mcu itself. Thanks

AshrafMikhael commented 1 year ago

It is Working now. I used ESP32 MCU and changed the file system from SPIFFS to LittleFS. Thanks Ashraf