alienatedsec / yi-hack-v5

Even newer Custom Firmware for Xiaomi Cameras based on Hi3518ev200 Chipset. It includes free RTSP, ONVIF and other improvements based on the work by roleoroleo
GNU General Public License v3.0
739 stars 87 forks source link

[REQ] WiFi Recovery Guide #350

Closed Hammerfest closed 1 week ago

Hammerfest commented 4 months ago

I could swear at one point there was a page for changing the WiFi info but I cannot seem to find it.

Can someone please post the instructions proper for yi-hack-v5 on how to change the WiFi info when a network change has occurred.

I tried to search through issues and discussions and found bits/pieces as well as conflicting information regarding directory structure placement and contents.

EDIT: now that I look, almost all the pages I recall seeing are gone

alienatedsec commented 4 months ago

Main page of the camera at the very bottom, but this only applies to a camera with current WiFi connection. If you need to connect manually, please follow this https://github.com/alienatedsec/yi-hack-v5/issues/193

image

Hammerfest commented 4 months ago

Yep, was trying to follow 193 but it did not work, tried putting the file in multiple places even.

alienatedsec commented 4 months ago

The file needs to be in /tmp/sd/recover/configure_wifi.cfg as per changes in the commit https://github.com/alienatedsec/yi-hack-v5/commit/98f3db1ca38dcb3a81526412ded8103d8c2eb43d

Hammerfest commented 4 months ago

Yep, I put it there as well

There was no folder called tmp so I made one and the subfolders There was also a recover folder on root so I threw it in there as well Also threw it in root as well

H:\configure_wifi.cfg H:\tmp\sd\recover\configure_wifi.cfg H:\recover\configure_wifi.cfg

The file only contained the 2 lines mentioned and tested with 2 different methods: wifi_ssid=Bacon wifi_psk=ExtraCrispy or wifi_ssid=[Bacon] wifi_psk=[ExtraCrispy]

like I said, didnt work, placed it multiple places, I factory reset one of them and wiped it as well to put the latest 4.1x on it

EDIT: now that I look at 193, I did not put it in: /tmp/sd/configure_wifi.cfg like mentioned in first post, that was the one directory i didn't try and I tried a few other tickets locations as well

alienatedsec commented 4 months ago

Did you restart after placing the configure_wifi.cfg file inside the /tmp/sd/recover folder?

The recover folder should be in the root folder of your SD card. /tmp/sd is the location mounted on your camera.

Hammerfest commented 4 months ago

The camera was powered down as it was not connectable due to wifi change, the sd card was removed and plugged into a PC

So the instructions I guess need to be to place the file in the recover folder located in the root of the drive, the instructions are unclear on source structure due to the whole linux mounting while connectable which is counter to changing wifi without access

Alas, it didn't work either and I have gone ahead and factory reset and installed latest

Instructions for anyone else who needs it:

WiFi Recovery Guide (when you cannot access it over the network) On your computer use Notepad or something similar, create a file named: configure_wifi.cfg

Inside this file paste the following lines and fill your information in as needed: wifi_ssid=[YourWiFiNetworkNameHere] wifi_psk=[YourWiFiPasswordHere]

With camera powered down, remove MicroSD from camera and plug into your PC Navigate with your file explorer to the MicroSD drive On the root/top level of the MicroSD you should see a folder labeled "recover" Copy the configure_wifi.cfg file into the recover folder Move the MicroSD back to the camera and power on

For me it did not work, but I will test next time I have to move the camera's to a different wifi network.

alienatedsec commented 4 months ago

Happy to accept any PRs and you contribute to the project :)

alienatedsec commented 4 months ago

@Hammerfest This bothered me for the rest of the night and I think I found the problem. When the file is manually created, it adds 0D 0A as hex values, a simple ENTER; however, UNIX will likely take 0D as another empty character; hence, it's not working when applied when edited under Windows (or any other system) and applied under Linux.

configure_wifi.zip

Please use and edit the attached, which ends each line with 0A and try again.

This investigation helped me fix another issue, so thanks :)

Hammerfest commented 4 months ago

Sorry if bothered you enough for the evening! Glad either way it helped fix something else however!

Doesn't shock me, also with your example looks like I was correct the first time with removing the [ ] instead of just putting the text inside

Currently using them for a bit of work for a bit but in a few weeks I should be able to do more testing and force a need to network swap.

github-actions[bot] commented 3 months ago

This issue has been stale for 30 days - it will be closed within the next 7 days if not updated

rikkistylz commented 3 months ago

Hi so the camera blinked yellow and then turned blue but didn't connect back to the internet... And I tried resetting the cam and now I after scanning the QR code it won't connect to the internet again( yi outdoor)

fidesachates commented 3 months ago

I've run into this now and need help. I tried to use this process and it didn't work. I then reflashed it with the original firmware from Yi and successfully reset and re-paired it using the Yi Home app.

When I then go to flash it with this hack the 0.4.1 version by copying all the files into the root of my sd card, the camera flashes with the yellow light and then the blue light starts flashing indicating it's not connected to wifi. When I put the sd card back with the original firmware, it flashes and immediately connects to wifi without having to re-pair or reset. I can see the stream on the Yi Home app. No matter how often I flash the hack, it never connects, but the original firmware immediately connects. Any help please?

P.S. when I try the configure_wifi.cfg, my sd card didn't have a recover folder so I manually created one. After reboot and the fail wifi connection, the file has disappeared from the recover folder.

Prior to all this, I was on 0.4.1 and it was connected just fine.

alienatedsec commented 3 months ago

P.S. when I try the configure_wifi.cfg, my sd card didn't have a recover folder so I manually created one. After reboot and the fail wifi connection, the file has disappeared from the recover folder.

@fidesachates The files disappear as it has served its purpose. The hack will try applying the setting on each boot if the file stays in the folder.

Prior to all this, I was on 0.4.1 and it was connected just fine.

Are you sure the above is correct? did you mean a previous version to 0.4.1? Also, what are specifics of your WiFi network? WPA3, WPA2 or any mixed modes?

fidesachates commented 3 months ago

P.S. when I try the configure_wifi.cfg, my sd card didn't have a recover folder so I manually created one. After reboot and the fail wifi connection, the file has disappeared from the recover folder.

@fidesachates

The files disappear as it has served its purpose. The hack will try applying the setting on each boot if the file stays in the folder.

Yea I figured as much. Also I can hear the camera switch to night mode and on boot up it goes to my first bookmark position so I assume from all this that the camera is functioning; only the WiFi isn't working.

Prior to all this, I was on 0.4.1 and it was connected just fine.

Are you sure the above is correct? did you mean a previous version to 0.4.1?

Yes, I'm sure about this for two reasons. When is that I keep a detailed wiki for myself of my home network and my notes have 0.4.1 listed as the existing version. The second reason I'm certain that I was on 0.41 is this is the first version that I contributed to, so I remember upgrading.

Also, what are specifics of your WiFi network? WPA3, WPA2 or any mixed modes?

I have a Ubiquiti U7 Pro. The 2.4 GHz SSI ID is broken out from the others and is a mix of WPA2 and WPA3. I have two other YI Home hacks that are still connecting fine. Only the camera where I tried to change the Wi-Fi connection is broken.

What do you make of the fact that on the original firmware the Wi-Fi connects but not on the hack firmware?

alienatedsec commented 3 months ago

What do you make of the fact that on the original firmware the Wi-Fi connects but not on the hack firmware?

@fidesachates do me a favour and extract the folder onto the yi-hack-v5 folder of a WiFi-troublesome camera. Boot the camera and wait a few minutes until you either see the camera is connected or keep doing the same. It has to take a few minutes before you turn it off.

wpa.zip

The hack will kick the following script https://github.com/alienatedsec/yi-hack-v5/blob/d1997ae29ddeaf7d39d4d42c6da85901b7e56bcd/src/static/static/home/yi-hack-v5/script/system.sh#L31-L45

fidesachates commented 3 months ago

What do you make of the fact that on the original firmware the Wi-Fi connects but not on the hack firmware?

@fidesachates do me a favour and extract the folder onto the yi-hack-v5 folder of a WiFi-troublesome camera. Boot the camera and wait a few minutes until you either see the camera is connected or keep doing the same. It has to take a few minutes before you turn it off.

It didn't seem to make a difference. I waited over 15 minutes and the blue light was still blinking. I did see that the wpa folder was gone and just the backups remained as per your script.

Just a question, your script is moving .so but your zip folder didn't have any libs.

fidesachates commented 3 months ago

Update:

After trying your suggestion with the wpa.zip, I retried this again to no avail. I then flashed myself back to 0.3.8 and this to my surprise brought the camera back online. I upgraded to 4.0 and things kept working. I tried to copy the 0.4.1 files to the sd card and that caused the camera again to not connect to wifi.

At this point, I'd be tempted to tell you that you were right in suspecting I lied about the 0.4.1 working before I tried to switch my wifi network. However, I found in my wiki a note ( besides the version that is marked as 0.4.1) that says (The default port is 80, but I uploaded previous configs that moved it to 8080) which if I'm not mistaken was a 0.4.1 change.

However, if you want to proceed with debugging under the assumption that something is wrong with 0.4.1, I'd still be willing to help test out other debug steps you want. I feel like my camera broke due to one of these two reasons

  1. The wifi change procedure
  2. My new Ubiquity U7 Pro AP (again, the 2.5ghz is on a separate ssid).

Both those two changes were made at the same time when the camera no longer connected.

alienatedsec commented 3 months ago

Just a question, your script is moving .so but your zip folder didn't have any libs.

Libraries have not changed, so there is no need to upgrade. @fidesachates We can try downgrading wpa_supplicant but I need the model number to extract the original files.

fidesachates commented 3 months ago

Just a question, your script is moving .so but your zip folder didn't have any libs.

Libraries have not changed, so there is no need to upgrade. @fidesachates We can try downgrading wpa_supplicant but I need the model number to extract the original files.

Is this what you're looking for? 65US

alienatedsec commented 2 months ago

Is this what you're looking for? 65US

Which model

Camera rootfs partition home partition Base Firmware Remarks
Yi Home rootfs_y18 home_y18 1.8.7.0F_201809191400 Firmware files required for the Yi Home camera.
Yi 1080p Home rootfs_y20 home_y20 2.1.0.0E_201809191630 Firmware files required for the Yi 1080p Home camera.
Yi Dome rootfs_v201 home_v201 1.9.1.0J_201809191135 Firmware files required for the Yi Dome camera.
Yi 1080p Dome rootfs_h20 home_h20 1.9.2.0I_201812141405 Firmware files required for the Yi 1080p Dome camera.
Yi 1080p Cloud Dome rootfs_y19 home_y19 1.9.3.0E_201812141519 Firmware files required for the Yi 1080p Cloud Dome camera.
Yi Outdoor rootfs_h30 home_h30 3.0.0.0D_201809111054 Firmware files required for the Yi Outdoor camera.
fidesachates commented 2 months ago

Ah apologies. I have the Yi 1080P Dome

bzzlghtyr commented 2 months ago

i'm interested in this as well. I have the Yi Home and am experiencing very similar issues where 3.8 works, but i get the loop of not connecting when I update to 4.1

alienatedsec commented 2 months ago

i'm interested in this as well. I have the Yi Home and am experiencing very similar issues where 3.8 works, but i get the loop of not connecting when I update to 4.1

https://github.com/alienatedsec/yi-hack-v5/issues/350#issuecomment-2037218326 have you tried this?

realealessio commented 2 months ago

I have the same issue with the Yi Dome camera (v201).. Cannot connect to WIFI (WiFi password incorrect fake error)

jseabaugh commented 1 month ago

Having the same issues with 0.4.1 with a 1080p home (48US). Tried both configure_wifi and wpa solutions in this thread (seperately and together) without success. Went back to 3.8 and it works.

github-actions[bot] commented 2 weeks ago

This issue has been stale for 30 days - it will be closed within the next 7 days if not updated