Camera WiFi in Client mode - WORKING .ash SCRIPT inside

tony123

New Member
Joined
Jul 1, 2015
Messages
1
Reaction score
0
Country
Slovenia
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...
 
OP
Andy_S

Andy_S

Active Member
Joined
May 5, 2015
Messages
621
Reaction score
191
Country
Czech Republic
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
}
 

4netk

New Member
Joined
Jun 24, 2015
Messages
16
Reaction score
1
Location
Ferrara
Country
Italy
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.
 
OP
Andy_S

Andy_S

Active Member
Joined
May 5, 2015
Messages
621
Reaction score
191
Country
Czech Republic
chec UNIX newline and if that does not help, show me your .ash & .sh scripts.
 

RamonRamonRamon

New Member
Joined
May 12, 2015
Messages
2
Reaction score
0
Country
Azerbaijan
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)
 
OP
Andy_S

Andy_S

Active Member
Joined
May 5, 2015
Messages
621
Reaction score
191
Country
Czech Republic
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.
 

Hombré

Active Member
Joined
Jan 16, 2015
Messages
785
Reaction score
181
Location
North East NSW
Country
Australia
Dash Cam
VIOFO A119 PRO VIOFO A119S - V2
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.
 

luckylz

Active Member
Joined
Apr 8, 2015
Messages
414
Reaction score
106
Country
China
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.
 
OP
Andy_S

Andy_S

Active Member
Joined
May 5, 2015
Messages
621
Reaction score
191
Country
Czech Republic
And what should this contraption do? It does not have any "action" defined.
 

luckylz

Active Member
Joined
Apr 8, 2015
Messages
414
Reaction score
106
Country
China
As I IRC with you, pls take a look in my codes. Thanks
 

Attachments

OP
Andy_S

Andy_S

Active Member
Joined
May 5, 2015
Messages
621
Reaction score
191
Country
Czech Republic
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.
 

vedranius

New Member
Joined
Aug 9, 2015
Messages
6
Reaction score
1
Country
Croatia
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!
 
OP
Andy_S

Andy_S

Active Member
Joined
May 5, 2015
Messages
621
Reaction score
191
Country
Czech Republic
nope, official app is hardcoded for default mode. You can however use desktop app ;)
 

kkaerr

New Member
Joined
Aug 13, 2015
Messages
5
Reaction score
2
Country
Austria
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
 

norcalm

New Member
Joined
Jul 29, 2015
Messages
2
Reaction score
0
Country
United States
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
 

kkaerr

New Member
Joined
Aug 13, 2015
Messages
5
Reaction score
2
Country
Austria
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.
 
OP
Andy_S

Andy_S

Active Member
Joined
May 5, 2015
Messages
621
Reaction score
191
Country
Czech Republic
You can also assign static IP right in the script if your router cannot do static leasing.
 

bstephens2002

New Member
Joined
Aug 10, 2015
Messages
10
Reaction score
1
Country
United States
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?
 

kkaerr

New Member
Joined
Aug 13, 2015
Messages
5
Reaction score
2
Country
Austria
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...
 

bstephens2002

New Member
Joined
Aug 10, 2015
Messages
10
Reaction score
1
Country
United States
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.
 

Similar threads


Top