yi-hack-v5 icon indicating copy to clipboard operation
yi-hack-v5 copied to clipboard

[Feature Request] Updating wifi credentials via file on SD card root

Open iointerrupt opened this issue 2 years ago • 5 comments

Currently I believe the ability to change the wifi credentials exists via by either shelling into the camera via SSH/telnet or web ui.

Would it be possible to update the startup script to include a check for a "configure_wifi.cfg" on the root of the sd card or somewhere on the sd card to allow changing the wifi ssid/password that way? Obviously the script would also delete the configure_wifi.cfg afterwards to prevent a loop.

Justification: Sometimes the cams have to be reset to stock and yi home cam app has to be used to register the cam. My cams usually are on a locked down vlan with no internet access but to register, they have to have internet access. I have to first put them on my main network, register, updating firmware to yi-hack, login to yi-hack and change the wifi creds. Being able to do it via a file on the sd card would automate that process. Just a thought.

Edit: Just using the solutions already available perhaps an update to the system startup script /tmp/sd/yi-hack-v5/script/system.sh:

if [ -f /tmp/sd/configure_wifi.cfg ]; then
	mv /tmp/sd/configure_wifi.cfg /tmp/configure_wifi.cfg
	sync
	sh $YI_HACK_PREFIX/script/configure_wifi.sh
fi

iointerrupt avatar Sep 01 '22 17:09 iointerrupt

@iointerrupt thanks - noted

alienatedsec avatar Sep 17 '22 18:09 alienatedsec

@iointerrupt Can you reference any solutions already available?

alienatedsec avatar Sep 28 '22 19:09 alienatedsec

@iointerrupt Can you reference any solutions already available?

The original post above shows the piece of code added to the system.sh that could be a solution.

iointerrupt avatar Sep 29 '22 19:09 iointerrupt

@iointerrupt done

The format needs to be as follows: wifi_ssid=your_wifi_essid wifi_psk=your_wifi_password

I will release another version soon

[Edited] removed square brackets as it was misleading

alienatedsec avatar Sep 29 '22 20:09 alienatedsec

Done v0.3.4 released

alienatedsec avatar Sep 29 '22 23:09 alienatedsec

This issue continues in #350 and describes the problem in more detail.

In short:

  • the template file configure_wifi.zip needs to be edited with your WiFi details in the format as is, and no Enter's or lines should be added or removed.
  • copy over to your SD card /recover folder - this is /tmp/sd/recover when in the console on your camera
  • reboot

alienatedsec avatar Feb 19 '24 00:02 alienatedsec