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.


All times are GMT. The time now is 23:59.

vBulletin® Version 3.8.8