irungentoo / Xiaomi_Yi_4k_Camera

Stuff for the xiaomi yi 4k (and 4k+) cameras.
265 stars 91 forks source link

Automatically Start Wifi on Yi4K+ #67

Closed somacoder closed 6 years ago

somacoder commented 6 years ago

Is this possible? If wifi is off, or the power was killed previously, resetting the wifi setting, it will not start automatically. Previously I have used the command 'CustomPref.wifi_auto_start=0x01' in the system.pref.upload file, but that no longer works on the latest firmware Yi 4K+ firmware (1.4.12).

somacoder commented 6 years ago

Strange. It appears that if you kill power while the wifi icon is flashing, then wifi will not start automatically on the next startup, but if you kill the power outside of that, then it will always autostart. still doesn't solve my problem so happy to hear other possible ways to get around this.

The difference between this and the 4K is that the 4K had the option 'CustomPref.wifi_auto_start=0x01', so if it found a diff at startup, it would restart the camera with these settings. So a lack of this option is what's causing it so I need a workaround.

Perhaps a way through autoexec.ash?

irungentoo commented 6 years ago

try: t wi-fi restart in autoexec.ash

somacoder commented 6 years ago

It works! (see follow up comment)

For the record t ipc rpc clnt exec1 'sh /usr/local/share/network/restart.sh' does not appear to work.

Thanks irungentoo.

somacoder commented 6 years ago

OKay some follow up on this. It looks like it is starting some script, but it is not engaging the wi-fi in the correct way outside of flashing the wifi icon. Going to investigate more.

somacoder commented 6 years ago

Hmmm. Now t wi-fi restart is no longer working for me. Strange. Still investigating.

somacoder commented 6 years ago

Alright, phew, figured it out. Couple of things. It appears:

  1. You need a line return at the end of the autoexec.ash script to register the command.
  2. You need to sleep a little first, 10 seconds, perhaps less, for the command to go through successfully.

The wi-fi symbol will not be visible but the network will still be active. I should also note that I am using my own start.sh file on my sd card so that may be influencing this in some way, though I don't think so.