Xiaomi Yi Camera: GUI Control & Configure from PC (Win/Lin/Mac)

ecqu

New Member
Joined
May 2, 2015
Messages
16
Reaction score
22
Country
Estonia
gui-jpg.13280


Download: https://github.com/deltaflyer4747/Xiaomi_Yi
Changelog : https://github.com/deltaflyer4747/Xiaomi_Yi/commits/master

Simply, connect to your Yi-s wifi with default password 1234567890

Credits:
Resources:

Old post:
What you need:

Usage:
  • Connect to Yi-s wifi, default password is 1234567890
  • Uncomment (remove #) lines in options.txt to push to camera with Camera_set.py
  • Run Camera_get.py to view current settings
  • Run Camera_video_stream.py to view stream with VLC
  • Run Camera_photo.py/Camera_record_start.py to record to SD card


Tested with 1.0.9 firmware, Windows XP, 8.1, Python 2.7.9


camera_get.png
 
Last edited:
This is a very useful work. I have a major bug with Samsung S7580 and original android application which prevents me using it. I look forward to UI version. Thanks for a good job.
 
Hi, @ecqu ! Any chance to decode the bluetooth option in the Yi Cam?
 
Hi @luckylz, what exactly would you expect from the bluetooth connection?

BTW camera's Wifi is capable of connecting to your network (it can do 3 modes - SoftAP as it is now, Client and P2P = Adhoc), but since i don't have the camera at hand (working on the sw remotely over at ecqu's place), it is kinda next-to-impossible to figure out proper config for that, since one mistake and i am disconnected & have to wait for him to reboot the camera to its original setting...

Yesterday i didn't have much time for any progress, so only thing i got working is some "fancy" colors on buttons and the fact that all 3 buttons are working as expected...

gui.jpg
 
Last edited by a moderator:
Hi @luckylz, what exactly would you expect from the bluetooth connection?

BTW camera's Wifi is capable of connecting to your network (it can do 3 modes - SoftAP as it is now, Client and P2P = Adhoc), but since i don't have the camera at hand (working on the sw remotely over at ecqu's place), it is kinda next-to-impossible to figure out proper config for that, since one mistake and i am disconnected & have to wait for him to reboot the camera to its original setting...

Yesterday i didn't have much time for any progress, so only thing i got working is some "fancy" colors on buttons and the fact that all 3 buttons are working as expected...

View attachment 13280

Hi, @Andy_S, look forward to see your program released. (what kind of development tools you are using ? maybe I can help to test too.)
Xiaomi says the bluetooth RC maybe can control multiple cameras, as GoPro wireless RC can remote multiple cameras at the same time.
So I wonder if this can be done by the PC GUI or not?
And you mentioned (SoftAP, Client and P2P) for Yi Cam, how can we switch between these 3 mode ?
 
Last edited by a moderator:
The switch of wifi modes can be made only (to my knowledge) by configuring the linux system inside.
Bluetooth remote triggering other cameras ... hmm... since i have none, i cannot verify that :(

All i'm using PsPad ("fancier" notepad) :D it is written in python and the remote access i have to ecqu's camera is enough for the software. Actualy i wrote these scripts that are on github without connecting to the camera once, ecqu did the testing, i made some minor tweaks and it just works :) Camera controlling is not that difficult ;)
 
The switch of wifi modes can be made only (to my knowledge) by configuring the linux system inside.
Bluetooth remote triggering other cameras ... hmm... since i have none, i cannot verify that :(

All i'm using PsPad ("fancier" notepad) :D it is written in python and the remote access i have to ecqu's camera is enough for the software. Actualy i wrote these scripts that are on github without connecting to the camera once, ecqu did the testing, i made some minor tweaks and it just works :) Camera controlling is not that difficult ;)

Hi, @Andy_S !
Today, I tested the python script, works great !
But I can't find out how to get the status of battery percentage & the storage card usage.
Could you give me some more advice ?
Thanks a lot !
 
Hi, it is not in scripts, i added it to the GUI only... sadly i didn't have much time last few days, so no progress.

SOOOOOoooooooooo... as of this moment, I pre-released GUI on the Github AS IS.
All 3 available buttons should be working as intended. :)
 
Hi, it is not in scripts, i added it to the GUI only... sadly i didn't have much time last few days, so no progress.

SOOOOOoooooooooo... as of this moment, I pre-released GUI on the Github AS IS.
All 3 available buttons should be working as intended. :)

Check your code and understood ! Thanks again !
 
i also added semi-compiled version of gui into gui.zip so no python installation is needed.
 
Hi, how to emulate telnet commands in linux?
I tried something like:
Code:
# cat < /dev/urandom > /dev/tcp/$target_host/$port
but this doesn't work. I was able to telnet to 23 port and login with root to cam. So looking how to do it from inside.
 
you want to do telnet from camera? Hmm... nc, netcat, telnet, screen... just from top of my head. What are you trying to do?
 
you want to do telnet from camera? Hmm... nc, netcat, telnet, screen... just from top of my head. What are you trying to do?
Here is the thing, I was trying to telnet from my laptop to the cam by 7878 port with no success and occasionally I did telnet without the port number and get inside camera system. What I'm trying to do now I'd like to replicate telnet commands (on a low level) that allows to change camera setting from camera OS.
 
you have to auth to the JSON port (7878). But my scripts are doing just that - they are sending these configurations for you, so you don't need to do it manualy. And when i'm done with the gui, configuration will be in the gui as well.
 
The problem that I'm not able to telnet to 7878 JSON port.
Here what netcat - nap is showing:
Code:
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:7878            0.0.0.0:*               LISTEN      745/network_message
tcp        0      0 0.0.0.0:554             0.0.0.0:*               LISTEN      939/AmbaOnDemandRTS
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      923/cherokee-worker
tcp        0      0 0.0.0.0:8787            0.0.0.0:*               LISTEN      745/network_message
tcp        0      0 0.0.0.0:53              0.0.0.0:*               LISTEN      849/dnsmasq
tcp        0      0 0.0.0.0:23              0.0.0.0:*               LISTEN      742/telnetd
tcp        0      0 192.168.42.1:23         192.168.42.2:22832      ESTABLISHED 742/telnetd
tcp        0      0 192.168.42.1:7878       192.168.42.5:57231      ESTABLISHED 745/network_message
tcp        0      0 127.0.0.1:7878          127.0.0.1:58506         ESTABLISHED 745/network_message
tcp        0    157 192.168.42.1:23         192.168.42.2:24967      ESTABLISHED 742/telnetd
tcp       15      0 127.0.0.1:58506         127.0.0.1:7878          ESTABLISHED 759/cgiBridge
netstat: /proc/net/tcp6: No such file or directory
udp        0      0 0.0.0.0:53              0.0.0.0:*                           849/dnsmasq
udp        0      0 0.0.0.0:67              0.0.0.0:*                           849/dnsmasq
udp        0      0 0.0.0.0:7877            0.0.0.0:*                           745/network_message
netstat: /proc/net/udp6: No such file or directory
netstat: /proc/net/raw6: No such file or directory
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node PID/Program name    Path
unix  2      [ ACC ]     STREAM     LISTENING        511 759/cgiBridge       /tmp/cgiskt
unix  2      [ ]         DGRAM                       835 849/dnsmasq
 
tcp 0 0 0.0.0.0:7878 0.0.0.0:* LISTEN 745/network_message

this lien tells you, that 7878 is open. So you have to be able to connect to it from another device. thus from windows

telnet 192.168.42.1 7878

and send this

{"msg_id":257,"token":0}

unless you do, camera will not respond at all.
 
telnet 192.168.42.1 7878
Yes I get that that it is LISTENING state but this command did not return anything, just hangs (firmware 1.0.9). If press any key after some time it returns {"result": -7}.
 
that means you are connected. As i said, you have to authenticate and then you will be able to send similar JSON commands.

Try Camera_get.py - does it work for you?
 
I will try to run Camera_get.py as I get home. What is authentication process is? If it is connected then how could I send command if on start typing it returns -7 code.
 
Back
Top