Code Monkey home page Code Monkey logo

xiaomi_yi's Introduction

Xiaomi_Yi

Xiaomi Yi Camera Control&Configure GUI and via python scripts

Multiplatform, runs on Windows, Linux and Mac!

Control (Photo, Record, Live View), Configure & Manage files via PC & Wifi.

CC.exe is compiled - NO PYTHON INSTALLATION NEEDED

CC.pyw - for all systems capable of running python with Tkinter


Obsolete

For these scripts you need Python 2.7.x https://www.python.org/downloads/

Windows Notepad is derping about newline style, use something better than that, like Notepad++, PsPad, or even WordPad

Edit settings.py with your camera IP. No need to launch this script

  • Edit options.txt (un/comment lines as needed) and launch Camera_set.py to set uncommented options
  • Camera_all_options.py displays all possible options for all possible variables
  • Camera_get.py displays current settings from camera
  • Camera_photo.py captures single photo
  • Camera_record_start.py & Camera_record_stop.py starts / stops video recording respectively
  • Camera_video_stream.py enables streaming for RTSP capable player (for example VLC)

xiaomi_yi's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xiaomi_yi's Issues

Xiaomi Mijia Camera Mini 4K camera integration.

Hello, When I am trying to use software with this cam(Xiaomi Mijia Camera Mini 4K), it is showing connected and only able to get the sd card info. But after showing connected it is giving an error that connection failed. If the card info is accessible I guess we can work through any other options.
If I run vlc with rtsp://192.168.42.1:554/live it is showing output video but with 2sec delay.

Don't put builds in the git repo

Don't put the build .exe files etc. into the git repository, create a tag and upload the file to the tag in github. This prevents the repository to get huge (34 mb now for a few lines of code)

Only able to take 1 picture

First of all thank you for your amazing work!

The problem that I am experiencing, is after connecting to the camera I'm only able to take one picture, after that the camera becomes unresponsive.

I have tried with two different cameras, the problem is the same, also tried just using the command line with telnet 7878 and then sending the messages, also getting the same result.

telnet 172.20.10.13 7878
Trying 172.20.10.13...
Connected to 172.20.10.13.
Escape character is '^]'.
{"msg_id":257,"token":0}
{ "msg_id": 7, "type": "vf_stop" }{"msg_id":257, "param":2, "rval": 0 }{ "rval": 0, "msg_id": 257, "param": 1 }
{ "rval": 0, "msg_id": 257, "param": 2 }{ "msg_id": 7, "type": "battery" ,"param":"57"}{"msg_id":769,"token":2}
{"rval":0,"msg_id":769}{"msg_id":769,"token":2}
{"rval":-21,"msg_id":769}{"msg_id":257,"token":0}
{ "msg_id": 7, "type": "vf_stop" }{ "rval": 0, "msg_id": 257, "param": 2 }{"msg_id":769,"token":2}
{"rval":-21,"msg_id":769}{ "msg_id": 7, "type": "battery" ,"param":"56"}

this only resulted in one picture as well.

I think I am able to start recoding video (light starts flashing, but not able to stop it and also the camera becomes unresponsive)

Sometimes after sending the message to start recording the camera beeps loudly 3 times, and then resets.

Firmware 1.2+

Have you tried this with latest firmware? Doesn't seem to be accepting connections on port 7878 anymore.

Cannot connect - Windows 10

I have a Yi camera. I cloned this Github project and tried the python script CC.pyw/CC.exe on my Windows 10 pc, and when the UI comes up, it shows IP address, JSON port, etc. But after clicking the Connect C&C button, a window pops up that says "Cannot connect to the address specified".

Using python 3.5

Widows 10 cannot connect

hello, i am working on behalf of support for Yi Discovery, through C&C.

I have gone through so much trying to figure this out anyway possible,
my focus is on the PC environment and multi-camera set up,
if i can get past to "cannot connect to the address specified" then i'll figure out the rest
I've tried changing machines, operating systems (Win 10, Ubuntu 16 and even a Mac OSX 10.5 just for the sake of it)
The problem persisting is that the whole 6 of Yi Discovery's ( model:YDXJ2_V11YB ver: J22_1.3.33)
and 2 of Yi 4K (ver:1.3.0) cant connect to the CC.exe and get me a RTSP feed,
i tried rtsp://192.168.42.1/live with and without different ports to no avail on Yi Discovery's,
Yi4K has been a success on getting rtsp but no C&C support either.

I have 6 separate wireless lan cards on pc, and cant make the autoexec script work on changing IP's either so i am super stuck with a bunch of Yi's and we're drinking our sorrows away!

I can send a token on telnet on each camera, it responds but, that's it, no feed, no C&C, no hope.exe.
if i only could get past to C&C working then i'll be able to recover quickly and get it up to date with the today's support of Yi Cameras
since ive gone through every corner of this forum to find a glimpse.

timelapse saved on PC + streaming stops randomly

Hi all,

I am using the Yi Action Camera and am able to use your software to stream on VLC.
I have a 1GB memory card on the camera, and record everything on VLC directly to my PC.

I have two issues :

  • sometimes it stops after 30secondes, sometimes after 15minutes, no idea why, or how to reproduce. any ideas ?
  • is it possible to take pictures (timelapse) but having them saved on the PC ? if so, how ?

thanks for your help

Within the GUI; Unable to Change: Image Flip, WiFi SSID, WiFi Password

Title says all. On Fedora 30, and original sport version of Yiaomi Yi.

Also, just as in #19, certain ascii characters typed in the WiFi Password or SSID fields, navigate away from the settings/config' screen. HOWEVER even when using other characters, Image Flip for video recording, nor the WiFi Password, nor the SSID could be changed via the GUI. I have not had time to try and do so via a file, or cURL/JSON, et cetera, and some syntax snippets might help.

YiCam internal trigger settable & readonly

So far, I found out that the following will trigger the camera settings change to readonly status:

{"token": 1, "msg_id": 259, "param": "none_force"}
or
{"msg_id": 7, "type": "vf_start"}

Example:

{"token": 1, "msg_id": 9, "param": "video_standard"}

before:

{
"rval": 0, "msg_id": 9, 
"options": [
"NTSC", 
"PAL"
], 
"param": "video_standard", 
"permission": "settable"
}

after:

{
"rval": 0, "msg_id": 9, 
"options": [
"NTSC", 
"PAL"
], 
"param": "video_standard", 
"permission": "readonly"
}

My solution is to send 258 & 257 to renew the token. And futher, I also found out after vf_start, no need the send 259 to start the webport, which is already opened.

Make VLC path configurable

Path to VLC player is pointing to c:/Program Files/VideoLan/VLC/vlc.exe or c:/Program Files (x86)/VideoLan/VLC/vlc.exe. In case user has portable version or different drive installed it shows message "VLC Player not found".

Question: Can i use this somehow for another action cam?

I want to connect Lamax X8 Electra action cam via Wi-Fi to my PC and use it in OBS Studio software as a video live feed source. I found no solution. I think your code could be used in my case with just little changes, because these cheap action cams must work +- all the same way. Do you thing its possible?

Yi2 4k support

I just got a Yi2 4K camera and am excited to be able to use it with PC! The program looks like it will connect, and the camera beeps and doesn't connect, and won't go to the next screen (goes blank), though the bottom left status says connected.

Any chance this can be adapted to work with the Yi2?

[question] Support timestamp metadata in wifi stream

Hello,

thanks for this project first of all!

I ordered 2 4k+ cameras for stereo vision, unfortunately I cannot in the moment load SD card (firmware 1.0.4 620r), but hopefully will resolve that, if you know about supported sd card for this firmware I would love to hear :-) :
http://forum.xiaoyi.com/forum.php?mod=viewthread&tid=50515&extra=

Main point of my question is if there is available to extract from the images taken and streamed via Wifi timestamp. I would like to use it for synchronization of images from 2 cameras for stereo vision. Thanks for any hints about this. I read articles where Andy S user and others discussed using NTP protocol to sync time and trigger at same time recording.

Well, my approach is little bit different, I will also use NTP to sync hours, but using OpenCV and FFmpeg projects I would like to capture images in parallel from both and sync them in the software. To to this I will need at each image timestamp mark, resolution in miliseconds is just fine for me, of course if we can get better to nanoseconds, could be more accurate ....

Thanks for any comments on this.

"Within the GUI; Unable to Change: Image Flip, WiFi SSID, WiFi Password" Title says all. On Fedora 30, and original sport version of Yiaomi Yi. Also, just as in #19, certain ascii characters typed in the WiFi Password or SSID fields, navigate away from the settings/config' screen. **HOWEVER** even when using other characters, Image Flip for video recording, nor the WiFi Password, nor the SSID could be changed via the GUI. I have not had time to try and do so via a file, or cURL/JSON, et cetera, and some syntax snippets might help. "

Bug in def FileDownChunk()

def FileDownChunk(self, chunk_size=0, report_hook=None, FileTP=""):
...
    towrite = ""
...
    towrite += chunk
...
    filek.write(chunk)
...

You use the "towrite" to keep file data get from YiCam, but final only write the last chunk to the downloaded file. Will you still keep update this repo?

show image after shot

Dear deltaflyer,
thank you for sharing that amazing project with us. I currently use your code to connect my raspberry pi with my Xiaomi Yi cam. Works fine.
I try to extend your Camera_photo.py script.
My aim is to display the photo that has been taken via pygame.
I figured out that the cam send some status updates that contain the image path on the cam:
See: https://gist.github.com/SkewPL/f57e6cff7fa14601f6b256926aa33437
But I can't figure out how to listen to that status updates.
Till now I just get the "{"rval":0,"msg_id":769}" response via data = srv.recv(512).
Do you have any idea how I can listen to -> { "msg_id": 7, "type": "photo_taken" ,"param":"/tmp/fuse_d/DCIM/127MEDIA/YDXJ0373.jpg"}?
Thanks and best regards
Ben

Yi Camera Night Vision support

1.) Is the new Night Vision Edition supported?
2.) How does one setup the camera initially (e.g. what Wifi it connects to)?

Enhancement: linux mouse wheel

I suggest the following for linux users wanting to use their mouse wheel in CC.pyw config
Tested on raspberry pi raspbian only.

under
    def MenuConfig_WheelScroll(self, event):
remove Windows statement
        self.controlcanvas.yview_scroll(-1*(event.delta/120), "units")
add Linux and Windows statements
        if event.num == 5: # linux scroll down
            self.controlcanvas.yview_scroll(1, "units")
        elif event.num == 4: # linux scroll up
            self.controlcanvas.yview_scroll(-1, "units")
        else: # windows scroll event
            self.controlcanvas.yview_scroll(-1*(event.delta/120), "units")

under
        self.controlcanvas = Canvas(self.controlselect)
        self.controlcanvas.bind_all("<MouseWheel>", self.MenuConfig_WheelScroll)
add for use with Linux OS
        self.controlcanvas.bind_all("<Button-4>", self.MenuConfig_WheelScroll)
        self.controlcanvas.bind_all("<Button-5>", self.MenuConfig_WheelScroll)


under
    def UnbindAll(self):
        self.master.unbind_all("<MouseWheel>")
add 
        self.master.unbind_all("<Button-4>")
        self.master.unbind_all("<Button-5>")

Configuration window is blank

Since upgrading the camera firmware to 1.2.10 the configuration window in CC does not show any settings.

The following error message is shown:

Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1535, in __call__
    return self.func(*args)
  File "./CC.pyw", line 869, in MenuConfig
    ValueBox = OptionMenu(ThisFrame, ThisValue, *self.camsettableconfig[ThisOption])
TypeError: __init__() takes at least 4 arguments (3 given)

Which Yi Camera is this intended for ?

There seems to be some quite confused people, judging by some of the other questions.

Is this intended for the Yi Action Camera, the GoPro like device , or the Yi Home Camera ?

OS X Yosemite Python 2.7.x

Hi, thanks for this app. I used it in VM ware machine and works perfectly.

My problem is in the Mac when I run the CC.pyw it does not open the app.
Any tips what i m doing wrong?

Thanks
Jose

Cannot connect - Mac OS

Hi,

I have a Yi camera. I cloned this Github project and tried the python script CC.pyw on my MacBook Pro, and when the UI comes up, it shows IP address, JSON port, etc. But after clicking the Connect C&C button, a window pops up that says "Cannot connect to the address specified".

Is the problem of my Yi camera or the Python script itself?

I also tried to enable telnet and shell console access to the camera (following instructions on https://forum.dashcamtalk.com/threads/xiaomi-console-access.11198/) without any success. I wonder if the problem is related.

Basically, I want to find a way to set its timezone to be something that's different from the Beijing Time.

Thanks for any suggestion!
Alex

Some issue reports and suggestions

Found some issues:

  1. When I press "f" key on wifi_password or wifi_ssid textbox, it always open the Files page. I think it's caused by "Files" button alt shortcut which is set to "f". Same thing happened too when I press "l" key, it will open "Control" page.

  2. It's often happened that when switching from "Files" page to "Configure" page, the program will hang/freeze.

Suggestions:

  1. Display error message if saving configuration failed.
    I tried to set new wifi password which contains special character, after I click apply and switch forth and back to "Configure" page, I saw the wifi_password still displays the old password. Turns out the wifi password can't contain special character after I checked with andriod yi action app. The android app will give you error message if you try to set password with special character. I expect the program should behave same too by showing errror message if the operation is not successful.

  2. Is it possible to remember last folder path in "Files" page?
    The program always load the "/var/www/DCIM/.thumbnails" folder when switching to Files page. Is it possible to load the last opened folder instead?

  3. Add "Disconnect" button.
    I would like to be able to disconnect the wifi and return to initial dialog page (where you have ip address and own vlc path field) rather than to quit and relaunch the program.

  4. Switch back from expert mode to simple mode.
    It's strange that I can enable expert mode menu, but can't disable it.

  5. Add some documentation about how to use the program on the readme.md.
    Few thing about the UI are not obvious like "own vlc path" field. I thought it needs to be set with VLC folder path, but turns out it's vlc.exe file path.

(Question) Full docunemtation

Good day!
Is there any documentation on commands I can send to this camera? How have you found those commands, that are used in the script? Is is possible to connect the camera to my home WiFi? Thank you in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.