Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQ] WiFi Recovery Guide #350

Closed
Hammerfest opened this issue Feb 18, 2024 · 30 comments
Closed

[REQ] WiFi Recovery Guide #350

Hammerfest opened this issue Feb 18, 2024 · 30 comments
Labels
documentation Improvements or additions to documentation issue-stale

Comments

@Hammerfest
Copy link

Hammerfest commented Feb 18, 2024

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
Copy link
Owner

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 #193

image

@Hammerfest
Copy link
Author

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

@alienatedsec
Copy link
Owner

The file needs to be in /tmp/sd/recover/configure_wifi.cfg as per changes in the commit 98f3db1

@Hammerfest
Copy link
Author

Hammerfest commented Feb 18, 2024

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
Copy link
Owner

alienatedsec commented Feb 18, 2024

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
Copy link
Author

Hammerfest commented Feb 18, 2024

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
Copy link
Owner

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

@alienatedsec
Copy link
Owner

@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 :)

@alienatedsec alienatedsec pinned this issue Feb 19, 2024
@Hammerfest
Copy link
Author

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.

Copy link

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

@rikkistylz
Copy link

rikkistylz commented Mar 25, 2024

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
Copy link
Contributor

fidesachates commented Apr 4, 2024

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
Copy link
Owner

alienatedsec commented Apr 4, 2024

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
Copy link
Contributor

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
Copy link
Owner

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

# Upgrade wpa_supplicant modules - after 0.4.1 baseline
if [ -f $YI_HACK_PREFIX/wpa/wpa_supplicant_upgrade ]; then
ifconfig wlan0 up
echo "---backing up wpa---"
cp /home/base/tools/wpa_supplicant $YI_HACK_PREFIX/wpa/wpa_supplicant_backup
cp /home/base/tools/wpa_cli $YI_HACK_PREFIX/wpa/wpa_cli_backup
cp /home/base/tools/wpa_passphrase $YI_HACK_PREFIX/wpa/wpa_passphrase_backup
killall watch_process
killall wpa*
mv /tmp/sd/yi-hack-v5/wpa/*.so* /home/lib/
mv /tmp/sd/yi-hack-v5/wpa/wpa_supplicant /home/base/tools/
mv /tmp/sd/yi-hack-v5/wpa/wpa_cli /home/base/tools/
mv /tmp/sd/yi-hack-v5/wpa/wpa_passphrase /home/base/tools/
rm $YI_HACK_PREFIX/wpa/wpa_supplicant_upgrade
reboot

@fidesachates
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Owner

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
Copy link
Contributor

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
Copy link
Owner

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
Copy link
Contributor

Ah apologies. I have the Yi 1080P Dome

@bzzlghtyr
Copy link

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
Copy link
Owner

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

#350 (comment) have you tried this?

@realealessio
Copy link

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

@jseabaugh
Copy link

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.

Copy link

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

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 26, 2024
@jseabaugh
Copy link

Still only able to run 0.3.8. I get stuck in a boot loop (#390 ?) when trying to move to 0.4.1. Now I am running into the same issue as #312. Only way to resolve was to flash to an older version and then back to 0.3.8.

@alienatedsec
Copy link
Owner

I plan to release a patch/reverse fix for those having problems with their WiFi connections after upgrading to 0.4.1. I can't do it now as I am away for at least the next two weeks.

@DayBit
Copy link

DayBit commented Aug 7, 2024

Hi,

I have a 'Yi Dome' camera. For me, the latest version without the wifi problem is 0.4.1b. So, I think that there is a change in 0.4.1c that breaks wifi on some cameras.

I have switched to this software because the latest versions of the Yi app send ads as... motion detection notifications!!!!!. I was about to throw my three cameras in the trash and buy Tapo (TPLink). Now I am using this software in privacy mode :^) and a server that converts MQTT events to telegram messages. Thank you all very much!

@alienatedsec
Copy link
Owner

Hi,

I have a 'Yi Dome' camera. For me, the latest version without the wifi problem is 0.4.1b. So, I think that there is a change in 0.4.1c that breaks wifi on some cameras.

I have switched to this software because the latest versions of the Yi app send ads as... motion detection notifications!!!!!. I was about to throw my three cameras in the trash and buy Tapo (TPLink). Now I am using this software in privacy mode :^) and a server that converts MQTT events to telegram messages. Thank you all very much!

Thanks @DayBit

I do realise it is about time to reverse the WPA upgrade I did, so people have options for their cameras to function properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation issue-stale
Projects
None yet
Development

No branches or pull requests

8 participants