maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   Python script for Xiaomi Yi on Sailfish (https://talk.maemo.org/showthread.php?t=98585)

claustn 2016-12-19 19:52

Python script for Xiaomi Yi on Sailfish
 
Hi to everyone,
I have a Xiaomi YI camera and a Nexus 5 with Sailfish.
There is an android app to control the camera but on sfdroid doesn't work (can't connect even if it is connected to the camera with wifi in Sailfish).
There is also a Windows client (written in Python) that can do the same things.

Now the question: i have the Python script of that ( https://github.com/deltaflyer4747/Xiaomi_Yi ) , but how can i run it on Sailfish?

Thanks in advance.

Merienth 2016-12-19 22:15

Re: Python script for Xiaomi Yi on Sailfish
 
There are multiple hickups here. If you are surre that SFOS doesn't need any special driver, and you can connect generally, then You need to set the GUI right as well.

Script uses Tkinter for GUI. I don't know if usable in SFOS at all. If no (somebody please tell) Then you need to purge the GUI part as well and use it from terminal or cerate a SFOS gui yourself.

Anyway a good coding excecise, but I personally can't say if threre could be any blockers.

I have thr feeling that even if you could connect the Camera to be usable via SFOS, you would need to rewrite py scripts to be used with GUI.

claustn 2016-12-20 07:59

Re: Python script for Xiaomi Yi on Sailfish
 
even only some terminal command to mamage the basic settings it will be nice. It connects via wifi, so maybe i can telnet something :)

BluesLee 2016-12-20 08:34

Re: Python script for Xiaomi Yi on Sailfish
 
Quote:

Originally Posted by claustn (Post 1520805)
even only some terminal command to mamage the basic settings it will be nice. It connects via wifi, so maybe i can telnet something :)

I don't know what you're talking about Python Gui's for Yi software, just connect to the Yi via wifi, telnet to the device and run well known shell scripts to configure the Yi. Search for it ..

claustn 2016-12-20 16:59

Re: Python script for Xiaomi Yi on Sailfish
 
I tried to use telnet with success, but it is used to modify only settings that will be charged after a reboot.
The Python application can modify settings in real time, as video quality, decide what type of photo mode to use (time lapse, burst and so on), things that with telnet I can't do. Maybe there is a method but is not used yet.

BluesLee 2016-12-20 17:10

Re: Python script for Xiaomi Yi on Sailfish
 
Quote:

Originally Posted by claustn (Post 1520828)
I tried to use telnet with success, but it is used to modify only settings that will be charged after a reboot.
The Python application can modify settings in real time, as video quality, decide what type of photo mode to use (time lapse, burst and so on), things that with telnet I can't do. Maybe there is a method but is not used yet.

Regarding reboots you might be right, can't check now, but to be sure we are talking about the same script https://github.com/alex-agency/XYC/b...ster/README.md has all the goodies...

claustn 2016-12-20 17:53

Re: Python script for Xiaomi Yi on Sailfish
 
yes, it's the same code i tried.
Is it possible to access the memory card via telnet/ftp? if I try common commands like cd, ls, dir after connecting in telnet nothing happens.

edit: it is a bit confusing the use of both the settings of the official app and the ones added using the script charged on boot.
For example, if i set time lapse from the official app and the with the script too i obtain: first (official) time lapse + 2nd time lapse and then takes the photo, causing a loop of time lapse photos that never ends :eek:
only deleting the configuration file solve it.

velox 2018-08-14 07:59

Re: Python script for Xiaomi Yi on Sailfish
 
This is quite a late reply (necromancing a bit here) and, to be honest, I don't know how much of the original "YI Action Camera" will work but perhaps the following sneak peek might be interesting for you: https://www.youtube.com/watch?v=bkWT_YpaP_s

It's going to be a bare bones python/qml yi cam controller app for Sailfish OS I finally started making after a bit of motivation and with a good amount of debugging/reverse engineering/testing help from Nokius. The first "YI 4k Action Camera" is the only one I have, so it's obviously optimized for that at this point, but we're trying to enable at least some features for the YI Discovery, as well.

You might find its source (or a build that may or may not be current) if you search the net a bit, but it's not ready for broad release, so I won't put a link here yet to not dissappoint anyone trying it.

If anyone has another Yi action cam, a bit of technical expertise and time and interest in testing, please PM me to help debugging weird behaviour, because some of those cameras APIs seem to react really differently than the 4k.

cheers!

claustn 2018-08-14 09:03

Re: Python script for Xiaomi Yi on Sailfish
 
Thanks for sharing! However, my YI wifi stopped working more than 6 months ago...now, thanks to some modded settings loaded at boot, I can change mode by pressing two times the power button, without the need of any app. Even better than before :)

Kabouik 2018-08-15 10:24

Re: Python script for Xiaomi Yi on Sailfish
 
The video is really exciting. Are you planning on putting that on Openrepos when it's ready? I have a Yi 2 too, and I think I got it working with the Android application with Alien (haven't tried in months though), but it would be so much better to do the same with a native application.

velox 2018-08-15 12:17

Re: Python script for Xiaomi Yi on Sailfish
 
Quote:

Originally Posted by Kabouik (Post 1547189)
The video is really exciting. Are you planning on putting that on Openrepos when it's ready? I have a Yi 2 too, and I think I got it working with the Android application with Alien (haven't tried in months though), but it would be so much better to do the same with a native application.

A release on openrepos is definitely the goal.

Also It'd be good to know if at least some of it is working on a Yi 2 before doing that.

Would you be able to try out a list of things I'd write together for you if I'd send you an .rpm?
Ideally, I'd then prepare a version with loads of debug output for the things not working to start via terminal (or, easier to copy, ssh) for you to test again and send me the output. It would be great if we'd do that on github, but if you don't have an account that's fine for me, as well.

This may bring me some information to make at least some necessary adjustments and may result in the app being actually useful for you and other Yi 2 owners. :)

Kabouik 2018-08-15 16:03

Re: Python script for Xiaomi Yi on Sailfish
 
Sure, I would be happy to test but I'm not sure when I'll be able to provide the feedback since I'm having issues with Gstreamer at the moment, and little time to fix them (but I'm trying!).

I have a Github account with the same nickname as here.

Kabouik 2018-08-18 15:46

Re: Python script for Xiaomi Yi on Sailfish
 
Gstreamer fixed, I'm ready to test amd break everything again, Velox! :D

claustn 2018-08-18 22:41

Re: Python script for Xiaomi Yi on Sailfish
 
The wifi of my YI first edition works for around 1 minute and then disconnets, if you want I can still try to see if it connects with your app!

velox 2018-10-07 15:18

Re: Python script for Xiaomi Yi on Sailfish
 
Hi all!

Sorry for the huge delay, there were some things that needed my attention,
also Nokius and me didn't have the success we'd hoped for regarding the Yi Discovery yet, so I've postponed further action again and again.

But now I have uploaded a build on Github for you guys to test on and created an issue for Yi 2 feedback:
Build: https://github.com/jgibbon/yikes/releases/tag/0.1-1
Yi 2 issue: https://github.com/jgibbon/yikes/issues/15

I may have to put in even more debug output if things don't work, but we'll see.

@claustn do you have a github account?
If so, I'll create another issue for the first Yi – otherwise I'm sure we can manage here.


Thank you so much, folks!

Edit:
Does not look much different than the video further up, but perhaps someone would like to see some screen shots:
Photo mode:
https://i.imgur.com/1TqqsIZ.png
Video mode:
https://i.imgur.com/iOF1TFK.png


All times are GMT. The time now is 10:35.

vBulletin® Version 3.8.8