roleoroleo / yi-hack-Allwinner-v2

Custom firmware for Yi 1080p camera based on Allwinner platform
MIT License
753 stars 90 forks source link

Y623US Yi Pro 2K Home - wont connect without pairing with app #814

Open barcley opened 5 months ago

barcley commented 5 months ago

Hi, I'm having trouble getting things working with the Yi Pro 2K Home camera.

Here's the details:

Y623US Yi Pro 2K Home YFUS 12.0.51.01_202303091901 Camera is fresh out of the box

Extracted release 0.3.1 to a sdcard FAT32 Format / 4096 byte allocation size / GPT

Modified the wifi settings in /Factory/configure_wifi.cfg.ori and renamed the file to /Factory/configure_wifi.cfg

Inserted the sd card into the camera and after a short time it clicks then says 'welcome to yi home camera' then with a flashing yellow light it says 'waiting to connect' and that just keeps going on forever.

Powered down the camera and checked the contents of the sdcard and the /Factory folder is now named /Factory.done as well as a backup folder and a mtdblock7.bin file, so it seems like the hack is doing something, but it doesn't seem to want to connect.

I searched through the issues and found a similar problem with another camera, issue 734

So i tried following this guide https://github.com/roleoroleo/yi-hack-Allwinner-v2/wiki/Change-WiFi-credentials-(deprecated) edited the configure_wifi.cfg file with my network settings, put the sd card back in the camera and tried again.

Now the camera doesn't say anything when it starts up and the blue light is flashing, no attempts to connect to the wireless network that I can see and the camera just stays like this forever.

I was finally able to get it to connect and everything seems to be working, but I had to first pair the camera with the yi app and set the wifi settings in the app and use the qr code scan to set it on the camera.

I'd prefer to not have to use the app at all, is there anything in the above steps I could do different to get that happening?

roleoroleo commented 5 months ago

After the 1st pairinig you shouldn't need to use the app again. I don't understand why configure_wifi method doesn't work. Does your SSID or password contain strange chars?

barcley commented 5 months ago

That is the behavior is see, once its paired I no longer need the app and can turn off cloud services and access the camera entirely through the web interface or ssh/ftp, so I've got a way forward I was just hoping to cut out the app entirely, but it's not show stopping.

I'm unsure why the configure_wifi isn't working, there doesn't seem to be any clues I could find on the sd card or by monitoring the network, the SSID and password are only a-z all lowercase so no special characters there.

does the wifi_psk=password$ line in the configure_wifi.cfg require the trailing $ maybe?

pultars commented 5 months ago

I have an IFUS/y211ga/9.0.36.02_202105081647 camera that I have been having trouble with the wifi credentials 'not sticking' since the 0.3.1 upgrade. After each reboot, the camera wants to pair with the app to be able to get wifi crendentials (waiting to connect, etc.). I have tried using the webui, the deprecated method (https://github.com/roleoroleo/yi-hack-Allwinner-v2/wiki/Change-WiFi-credentials-(deprecated)) and running the configure_wifi.sh script in the /tmp/sd/yi-hack/scripts folder, but none of them work.

When I run the script in the /tmp/sd/yi-hack/scripts folder, i get the following output, which leads me to believe that the wifi credentials are being stored one byte too early, and thus at startup the camera doesn't retrieve the full credentials and is unable to connect to wifi.

Screenshot from 2024-02-01 12-06-11

However, I am having a hard time convincing myself that this is the root of the problem since I had not had a problem with wifi before this upgrade (0.3.0 -> 0.3.1) and that the code for this doesn't seemed to be changed in quite a while.

roleoroleo commented 5 months ago

does the wifi_psk=password$ line in the configure_wifi.cfg require the trailing $ maybe?

$ is just an example. It's not needed. If you want to continue with the analysis, you could dump mtdblock7 and check the SSID and the PASSWORD starting at address 28. Then you could try to set them from the web gui and dump again the block. Finally compare the files and check if SSID and PASSWORD are the same.

To restore the previous data you can restore the 1st block.

roleoroleo commented 5 months ago

@pultars Did you change the fw version? I mean Yi fw. From what byte is it starting? SSID should start from 28 and PASSWORD from 92.

pultars commented 5 months ago

@pultars Did you change the fw version? I mean Yi fw. From what byte is it starting? SSID should start from 28 and PASSWORD from 92.

Not recently. I might have when I first got the camera but I don't remember.

Here is what I found out: Once the camera cannot find the correct ssid and passwd, it forces me to pair with the yi app. When I do, the ssid and passwd are stored with the first letters of both truncated in location 29 and 93 respectively. Here is a screenshot:

Screenshot from 2024-02-05 12-58-53

Needless to say, but the camera doesn't connect to wifi after a reboot and forces to re-pair with the app. After re-pair and connecting, this takes me to where I started.

Once I run configure-wifi.sh, ssid and passwd are store in 28 and 92 correctly. Here is a screenshot:

Screenshot from 2024-02-05 12-59-19

It gets interesting after this. Once rebooted, the camera connects to wifi without a problem, BUT, when I dump /dev/mtdblock7, I see that the first letter of ssid gets truncated and thus starts from 29, but passwd stays intact. Here is a screenshot:

Screenshot from 2024-02-05 13-00-02

Again, the camera is not able to reconnect to wifi if rebooted once more and forces to re-pair with the app.

So, it looks like it is not a yi-hack/script/configure-wifi.sh problem. Seems like the mtdblock7 is being overwritten/updated at boot time, but AFTER the information is read to connect to wifi. Does yi-hack update this file at boot? (the reason I ask is that I have not tested without the hack)

roleoroleo commented 5 months ago

Does yi-hack update this file at boot? (the reason I ask is that I have not tested without the hack)

No, the hack updates this file only during the hack (the 1st start) and when to click "Save configuration" in the wifi webpage.

I never seen a problem like this. The only thing I can think of is that there is a Yi process that writes the flash. Is there an available fw update from Yi?

pultars commented 4 months ago

Is there an available fw update from Yi?

I am happy to report that the fw update fixed my issue. Thank you for your help.

roleoroleo commented 4 months ago

Good news!

robbinjanssen commented 3 months ago

Unfortunately there is no firmware update for me and I'm facing similar problems with the Yi Dome U 2K. Any suggestions on what I could do or help you debug this?

Edit: using file: h51ga and firmware: 9.0.21.13_202109101104

github-actions[bot] commented 20 hours ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.