Camera WiFi in Client mode - WORKING .ash SCRIPT inside

dm75

New Member
Joined
Jan 29, 2016
Messages
3
Reaction score
0
Country
Poland
Hello,
Thanks for great job. I'm new here, and sorry for my english in advance ;-)

I tested it with 1.2.13 firmware and watchdog including Delphir modification is working OK, but after every "network restart" it works for few seconds (3-4 pings) and then is down again, then watchdog start network again, and so on ....
So the problem in this firmware, with wifi client mode, is not resolved.

I made firmware downgrade to 1.2.0 version, reset settings ...and its still the same... after 2 seconds network is down ... The same is for free network, without setting security ...

I found similar solution at https://github.com/reaper7/XIAOMI_YI_WIFI_SWITCH
Has anyone used that scripts ?
 
Last edited:

Delphir

New Member
Joined
Sep 14, 2015
Messages
13
Reaction score
0
Country
United States
Hello,
Thanks for great job. I'm new here, and sorry for my english in advance ;-)

I tested it with 1.2.13 firmware and watchdog including Delphir modification is working OK, but after every "network restart" it works for few seconds (3-4 pings) and then is down again, then watchdog start network again, and so on ....
So the problem in this firmware, with wifi client mode, is not resolved.

I made firmware downgrade to 1.2.0 version, reset settings ...and its still the same... after 2 seconds network is down ... The same is for free network, without setting security ...

I found similar solution at https://github.com/reaper7/XIAOMI_YI_WIFI_SWITCH
Has anyone used that scripts ?
I actually also have this code in my watchdog, it is forcing wifi to activate on every loop (I added it for my own needs, but maybe it will help you too):

Code:
while [ 1 ]
  do

    WIFI_EN_GPIO=`cat /pref/wifi.conf | grep -Ev "^#" | grep WIFI_EN_GPIO | cut -c 14-`
    if [ "${WIFI_EN_GPIO}" != "" ]; then
        # activate wifi
        /usr/local/share/script/t_gpio.sh ${WIFI_EN_GPIO} 1
        # turn ON wifi LED
        /usr/local/share/script/t_gpio.sh 114 0
    fi

.. and there your ping code or whatever ..

done
Also change the watchdog line in autoexec.sh to this one:

Code:
lu_util exec '/tmp/fuse_d/wifi/watchdog.sh 2>&1 &'
actually I forgot to tell you about this autoexec change.. - it is the biggest bug in Andy`s code.
I`m sure after replacing it you will fix your problems. for me 1.2.13 is starting network on boot, then it goes down after a few seconds (something is killing it), then watchdog is recovering network back and after this it can work forever (I turned off my router multiple times, but YI is always getting connection back with no problems for several weeks).

Btw, I also made my own independent camera controller tool, which can do everything what you can do from a regular YI-app, but automatically with ANY complex rules/switching between modes/settings/intervals/etc and it is running on the camera itself (you don`t need a phone or whatever - camera is doing all this internally).
 

dm75

New Member
Joined
Jan 29, 2016
Messages
3
Reaction score
0
Country
Poland
I still have the problem ... i think Yours watchdog modification is OK, but the problem is network in client mode ... something bring them down after few seconds after every start.
I tried it on 1.2.0 and 1.2.13 firmwares - I have the same problem.
Maybe problem appears with new hardware version - what version are You using ? My HW is Z23L. I'll try another router too...

What about : https://github.com/reaper7/XIAOMI_YI_WIFI_SWITCH ? - I tried it and it works, but at the moment in DHCP mode only.
 

Attachments

Last edited:

Delphir

New Member
Joined
Sep 14, 2015
Messages
13
Reaction score
0
Country
United States
... something bring them down after few seconds after every start
every power ON of the camera or every network recovery-start ?
What will happen if you turn ON camera and will not touch it for 5 minutes? network WILL go down after a minute , but it must came back after a short time and will work forever.
I`l using the same 23L hw.
Don`t know anything about your wifi-switch solution. I`m not using it.
 

dm75

New Member
Joined
Jan 29, 2016
Messages
3
Reaction score
0
Country
Poland
every power ON of the camera or every network recovery-start ?
What will happen if you turn ON camera and will not touch it for 5 minutes? network WILL go down after a minute , but it must came back after a short time and will work forever.
I`l using the same 23L hw.
Don`t know anything about your wifi-switch solution. I`m not using it.
Network never works for more than few seconds in client mode. After start camera (with scripts at SD card) network starts and working for few seconds and goes down. Next, watchdog, starts it again, and after few seconds is go down again, next watchdog starts it ... and so on ... I can see it on router (appears and dissapears) and check with ping tool - for a while is connected, for while disconected, connected, disconnected.... Something like driver was killed after every network (not camera) start - not only first time as You wrote. I have no idea what's wrong ...

At the moment I try reaper7's wifi switch solution, it's very similar but we can choose STA/client mode or default Xiaomi wifi mode when we power on camera (pressing or not shutter button at start).
 

Hdez

New Member
Joined
Jan 29, 2016
Messages
2
Reaction score
0
Country
United States
@unamontez - please check my scripts from github
I use it on my 23L fv:1.2.13
reaper7,

Your script works well! I have successfully tried the STA mode with the 221, 22L, and 23L models. The client-server communication is OK and I already tested the standalone and multi-trigger scripts for camera capture. I just need to set up a static ip address for each camera to complete a multi-camera system.

Thank you
 

reaper7

New Member
Joined
Nov 26, 2015
Messages
18
Reaction score
6
Country
Poland
Dash Cam
XiaomiYi(23L)
@Hdez - STA mode with static IP is not available, and at this moment I do not plan to add this. Sorry.
Script wifi_set.sh is started at top of autoexec.ash and executed in a single pass "set mode & exit", without any loop which wait when user switch on wifi(or not).

But You can add Your own bash script which, in loop, check if wlan interface is up, and when up then set static ip via command:
Code:
ifconfig wlan0 192.168.xxx.xxx netmask 255.255.255.0
and optionally kill dhcp client (udhcpc)


This script You can executed from wifi_set.sh eg. add at the end:
Code:
if [ ${MODESET} -eq 0 ]; then
/path/to/your/script.sh &
fi
 

lts-x

New Member
Joined
Feb 18, 2016
Messages
4
Reaction score
2
Country
Australia
@reaper7 - I've tried to use the script and pressing the shutter button on start up but it keeps going into AP mode.

Should I be holding down on the shutter button when I press the on button? Do I have to press the shutter button within 3 seconds of turning the camera on to get it to STA mode?

Right now, I'm only running the camera in STA mode by using the second part of the autoexec.sh script
 

reaper7

New Member
Joined
Nov 26, 2015
Messages
18
Reaction score
6
Country
Poland
Dash Cam
XiaomiYi(23L)
@reaper7 - I've tried to use the script and pressing the shutter button on start up but it keeps going into AP mode.

Should I be holding down on the shutter button when I press the on button? Do I have to press the shutter button within 3 seconds of turning the camera on to get it to STA mode?

Right now, I'm only running the camera in STA mode by using the second part of the autoexec.sh script
Yes, press shutter button and hold down...when selected mode is set then red shutter led blinks TWO TIMES for sta mode, after these flashes You can release button.
 

Marco Soave

New Member
Joined
Feb 9, 2016
Messages
4
Reaction score
0
Country
Italy
Hi,
I'm working on a 12 camera 3d panoramic rig and, as in all these multi-cam set-up, the STA mode is incredibly useful for checking cam modes and trigger video recording. I spent many hours trying to accomplish the STA mod on the cams ( 1.2.13 firmware, V22 ), tried many combination of static IP and dynamic, as well different firmware and many card formats but the best result I achieved so far is only a short connection to my androidAP net, lost after few second. Connecting to my home router seems impossible at all. I tried also the watchdog script with no results. The cams are turning on as expected, after some seconds a really short bet, a few seconds after a longer beep but no connection.
As far as i read I'm not the only one in this situation; does anybody found a solution to this problem?

Many thanks is advice, Marco
 

StfLA

Member
Joined
Aug 6, 2015
Messages
71
Reaction score
3
Country
France
I spent many hours too, and know it works with the Andy script. But if I can let dhcp enable when I connect the Yi to my home router, I must use fixed IP with the androidAP.
 

Marco Soave

New Member
Joined
Feb 9, 2016
Messages
4
Reaction score
0
Country
Italy
Thx for you comment StfLA!
Can you provide me additional detail about the version of the Andy script and the firmware and HW version of the cam you are using. Also the model of the router and android phone can help me.
Thx in advice, Marco
 

StfLA

Member
Joined
Aug 6, 2015
Messages
71
Reaction score
3
Country
France
Thx for you comment StfLA!
Can you provide me additional detail about the version of the Andy script and the firmware and HW version of the cam you are using. Also the model of the router and android phone can help me.
Thx in advice, Marco
It's the version you can find in the first message :
https://dashcamtalk.com/forum/threads/camera-wifi-in-client-mode-working-ash-script-inside.12239/
It works with this one too :
http://bluestudios.co.uk/Brahma/ (direct link)

Tested with my Z22 and Z23 Yi, firmware 1.2.13
Phone : MotoX (first rev, 2103) on android 5
Router : It won't help you, it's the modem/router from my Internet Service Provider

I don't have to enable watchdog.
But be sure to :
- check all the settings in wpa_supplicant.conf and sta.sh. It's easy to forget one, and think that it doesn't work.
- put the Yi near the wifi access point

And if you try to use the FoxFi app to create the access point on an android device, like in the brahma video, and don't understand why you can't see anything when a device is connected, it's because this feature is included only in this addon.
 

EinsteinXXL

New Member
Joined
Feb 18, 2016
Messages
5
Reaction score
0
Country
Germany
How can I connect via Yi App to camera when I use the wifi client script?
 
Last edited:

Adrian Fischer

New Member
Joined
Feb 23, 2016
Messages
15
Reaction score
0
Country
Australia
OK I must be doing something really simple wrong. I download the scripts. I modify the wa-supplicant to reflect my home network and password. I upload to the sd card (I upload the whole folder called wifi correct?) I press the on button, light turns blue but nothing happens. I cant see it on my home network nor on any of my android devices. Nothing seems to have changed. Of course if I press the wifi button and enable it I can see the yi on my android but that using its default IP address and that doesnt help me. So can someone hold my hand and step me through the process in very simple english (I should point out I am not a complete newby, I have spent a good few years coding perl,html and mysql. Different I know but you get what I mean.)
 

Armdromeda

New Member
Joined
Dec 12, 2015
Messages
27
Reaction score
6
Country
Australia
Anyone clever enough to turn off wifi via sh script?

It would help with battery life after settings have been made! Wifi drains the battery pretty good ;)
 

reaper7

New Member
Joined
Nov 26, 2015
Messages
18
Reaction score
6
Country
Poland
Dash Cam
XiaomiYi(23L)
Anyone clever enough to turn off wifi via sh script?

It would help with battery life after settings have been made! Wifi drains the battery pretty good ;)
this does not work properly?
Code:
/usr/local/share/script/wifi_stop.sh
 

Similar threads


Top