Camera WiFi in Client mode - WORKING .ash SCRIPT inside

Andy thanks for all the hard work, Xiaomi should really hire you or at last send you some of their promotional stuff (cams, powerbanks, etc...). One question - is it possible to connect yi to an open (non-secured) wifi. I tried leaving password empty "", but it wouldnt connect...
 
you would need to modify wpa_supplicant.conf like this (don't forget about mandatory UNIX newline formatting!):
Code:
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="YourUnsecuredNetworkName"
key_mgmt=NONE
}
 
a quick fyi - either I have configured the Watchdog part wrong or combining the autoexec with the increased bitrate lines is doing something unexpected. Turned camera on and tried to record video (manual, CC or multitrigger, all do the same) camera freezes, no way of recording videos. Re-commented the watchdog-part - everything runs fine.
 
chec UNIX newline and if that does not help, show me your .ash & .sh scripts.
 
This is noobish,
but I am able to connect my xiaomi yi to my wlan, I can see its ip address, but I just can't move forward from there. I can't see any video, I've already configured my router to enable ports on my xiaomi. I've tried using my browser and writing (ip address) 192.168.1.71:80, nothing happens, neither using port 8080. Can't connect using VLC media player. IP Camera Tool software doesn't detect my camera.
Perhaps this script doesn't allow me to do what I thought it could do (use yi as an ip camera)
 
you have to connect the cam to the wifi, then use "Camera_video_stream.py" from standalone scripts to enable rtsp stream.

You can also use my C&C to connect to the camera. Official app cannot connect to the camera connected to your network.
 
Andy thanks for all the hard work, Xiaomi should really hire you or at last send you some of their promotional stuff (cams, powerbanks, etc...)

Good point but you know how it is.......... Greed is pathetic and acknowledgment for individual brilliance is often ignored for commercial reasons.
 
Hi @Andy_S, it looks like if I set the loop in the watchdog.sh file, and power-on Yi Cam, it will die:
Code:
while [ 1 ]
  do
    ...
  done

the following is my test code:

autoexec.ash
Code:
#watchdog mode
sleep 3
lu_util exec '/tmp/fuse_d/watchdog.sh'

watchdog.sh
Code:
#!/bin/sh

HOST="192.168.42.1"
COUNT=10
PERCENT=70
WAIT=3

while [ 1 ]
  do
    count=$(ping -W $WAIT -c $COUNT $HOST | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }')
    if [ $count -lt $(( $COUNT * $PERCENT / 100 )) ]; then
      echo 'Connection Percentage: ' $count
    fi
  done

before time, I also tested many times, if the while loop in autoexec.ash, it works, but in *.sh does not.
 
And what should this contraption do? It does not have any "action" defined.
 
As I IRC with you, pls take a look in my codes. Thanks
 

Attachments

  • customode.zip
    1.9 KB · Views: 32
As i already told you this is WRONG way that cannot work. You cannot use ping to detect if the network is down or up if there is no network.

You should use GPIO for that.
 
Great work Andy_S!
I'm trying to connect to my wifi, but what I'm concerned is, will Android app still work with this change? And will it find the camera? As I'm trying it right now, and my smartphone can't find it...
Thanks!
 
nope, official app is hardcoded for default mode. You can however use desktop app ;)
 
Hey,
I've worked on the official Xiaomi App a bit and managed to control the camera in client mode.
Although you can connect to any available wi-fi network, however, as of now,
it is only possible to connect to
a hardcoded ip-adress (I specified it to http://192.168.0.130).
So if you assign your Xiaomi yi actioncam with the mentioned static ip you can use the official application.
Latency is increased but far from unusable imo.
I will try to work on a dynamic ip definition.

https://www.dropbox.com/s/aexdt8f523f4ikx/xiaomiyi_2015_08_13.apk?dl=0
 
Interesting! Can you describe how to change the hardcoded IP-Address? For example if I'm on a 10.0.1.X subnet or 192.168.160.X subnet?

Hey,
I've worked on the official Xiaomi App a bit and managed to control the camera in client mode.
Although you can connect to any available wi-fi network, however, as of now,
it is only possible to connect to
a hardcoded ip-adress (I specified it to http://192.168.0.130).
So if you assign your Xiaomi yi actioncam with the mentioned static ip you can use the official application.
Latency is increased but far from unusable imo.
I will try to work on a dynamic ip definition.

https://www.dropbox.com/s/aexdt8f523f4ikx/xiaomiyi_2015_08_13.apk?dl=0
 
I've changed the standard ip-adress (192.168.42.1) to the the one my router gave to the camera via dhcp automatically.
So as of now you will have to assign a static adress in your router for the actioncam.
But i try to make the process dynamic.
 
You can also assign static IP right in the script if your router cannot do static leasing.
 
After reading through all of the different options on the forum, I still cannot come up with an ideal solution for simply triggering 6 Yi's for a 360 vr rig in the field unless I want to carry a laptop with me as a remote. The Xiaomi_Yi-master that @Andy_S DOES work on multiple cams using MultiTrigger.exe. However for some reason I could only get it to trigger photos on my firmware 1.2.6 cams but I am guessing that is a minor fix. The cameras would look as if they were recording but then I could not get them to stop recording, so I am thinking by forcing the cameras off in the middle of recording I lose the file. Anyway in trying to set up the mobile option (Ponerine) I realized that my galaxy s4 says I can only tether 5 devices. I need to connect 6 cameras though. So that seems like a show stopper there. What would be great is some sort of Master/Slave setup within the cameras. Where one camera is the master and the other 5 are slaves or where they all somehow piggyback off each other. Push a button on the master and the other cameras get sent a command. Then there are 2 more options to explore: physically wiring buttons together from all cameras or physically wiring 6 bluetooth remotes together. So my question is has anyone in this world set up 6 Yi's to start and stop video and photos using a cellphone or some other device other than a PC?
 
I guess you could do it with a modded version of the official app.
You would just need to add 6 ip-addresses to the Camera control part.
Maybe I will figure that out too after the dynamic adjustment...
 
Hey,
I've worked on the official Xiaomi App a bit and managed to control the camera in client mode.
Although you can connect to any available wi-fi network, however, as of now,
it is only possible to connect to
a hardcoded ip-adress (I specified it to http://192.168.0.130).
So if you assign your Xiaomi yi actioncam with the mentioned static ip you can use the official application.
Latency is increased but far from unusable imo.
I will try to work on a dynamic ip definition.

https://www.dropbox.com/s/aexdt8f523f4ikx/xiaomiyi_2015_08_13.apk?dl=0
This sounds very interesting, especially if you could add a way to add more cameras and control them all with at least a shutter button command. I really wanted to see this app with the camera working in client mode. I did try to install this apk on my S4 but got a error saying "There is a problem parsing this package" normally I can install development apk's but something seems to be wrong with this one.
 
Back
Top