Button Combination Mode Switching (via *.ash scripts)

luckylz

Active Member
Joined
Apr 8, 2015
Messages
414
Reaction score
107
Country
China
First of all, thanks @Andy_S ! He shares many many good script examples in python, linux shell, autoexec.ash, So I can finally make scripts in this thread. And also I need to thank many other guys who share their experiences on Yi Cam --- sorry I can't name them all here.

What's mean "Button Combination - Mode Switching" ? I explain it via my scripts.

Updated scripts for firmware version 1.2.10
customode(fw ver 1.2.10).zip

No.1 [Custom Mode] (beta version 0.0.2)
Code:
[Normal Mode]
---> with wifi on
---> take 3 pictures
---> turn off wifi
---> auto reboot
---> change to [Advanced Mode]
[Advanced Mode]
---> with wifi on
---> take 3 pictures
---> turn off wifi
---> auto reboot
---> change to [Normal Mode]
[Normal Mode]
...
and so on
...

In this way, when you go outside without laptop or mobile phone, you can still access to the [Advanced Mode] which you have already setup at home.

In my example, the [Advanced Mode] (fw 1.2.6 only) means: Video mode(1296p @30fps 35Mbps) & Photo mode(RAW+jpg)

[How to install]
Just download the zip file and unzip to the root of SD Card, rename the [install.ash] to [autoexec.ash], then power on Yi Cam with this SD Card inserted. If Yi Cam boots with a 2-seconds long beep, means install successfully.

[How to uninstall]
Rename the [uninstall.ash] to [autoexec.ash], then power on Yi Cam with this SD Card inserted. . If Yi Cam boots with a 2-seconds long beep, means uninstall successfully.

[Mode Status]
[Normal Mode] - Yi Cam normally power on without special beep, enter to this mode;
[Advaned Mode] - Yi Cam normally power on with 3 times 1-second beep, enter to this mode.

[Importance]
I only tested with my Yi Cam, to use this with your own decision.

I CAN NOT GUARANTEE IT WILL DAMAGE YOUR CAMERA OR NOT !
 

Attachments

  • customode(beta0.0.2).zip
    1.9 KB · Views: 125
Last edited:
OP
luckylz

luckylz

Active Member
Joined
Apr 8, 2015
Messages
414
Reaction score
107
Country
China
Updated scripts for firmware version 1.2.10
wifimode(fw ver 1.2.10).zip

No.2 [WiFi Mode] (beta version 0.0.1)

Code:
[AP Mode]
---> with wifi on
---> take 3 pictures
---> turn off wifi
---> auto reboot
---> change to [Station Mode]
[Station Mode]
---> power on with wifi
---> turn off wifi
---> auto reboot
---> change to [AP Mode]
[AP Mode]
...
and so on
...

I think this one is much more useful than the [Custom Mode].
For example, when you go out, you can switch to [AP Mode] --- Yi Cam act as router; and when you go back home, you can switch to [Station Mode] --- Yi Cam will connect to your home wifi router.
And because Station Mode relies on the wifi is on. So if you turn off wifi, it means you don't wants the Station Mode any more. Then Yi Cam will switch back to AP Mode.

[Settings before install]
Just download the zip file and unzip to the root of SD Card.
[ipaddress.txt]
Change the gateway & ipaddress in this file for your own config.
Code:
# Please Set Gateway and IP Address
GATE="192.168.1.1"
# Fixed IP or DHCP
IPAD="192.168.1.123"
# IPAD="DHCP"
If you want to have DHCP work, just change the lines as the following:
Code:
# IPAD="192.168.1.123"
IPAD="DHCP"

[ssid.txt]
Change the setting in this file, lines: ssid & psk, if your wifi has password.
Code:
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="YourWifiRouterName"
key_mgmt=WPA-PSK
proto=WPA2 WPA
pairwise=CCMP TKIP
psk="YourWifiPassword"
}
[ssid_no_password.txt]
If your wifi has no password, just keep this file, no need to do anthing.

[How to install]
WiFi has password:
Rename the [install.ash] to [autoexec.ash], then power on Yi Cam with this SD Card inserted. If Yi Cam boots with a 2-seconds long beep, means install successfully.
WiFi has no password:
Rename the [install_no_password.ash] to [autoexec.ash], then power on Yi Cam with this SD Card inserted. If Yi Cam boots with a 2-seconds long beep, means install successfully.

[How to uninstall]
Rename the [uninstall.ash] to [autoexec.ash], then power on Yi Cam with this SD Card inserted. . If Yi Cam boots with a 2-seconds long beep, means uninstall successfully.

[Mode Status]
[AP Mode] - Yi Cam normally power on with 3 times 1-second beep, enter to this mode;
[Station Mode] - Yi Cam normally power on about 30 second, 1-second beep, and then wait for another 1-second beep after 15 seconds, enter to this mode.
Both modes are Video mode(1296p @30fps 35Mbps) & Photo mode(RAW+jpg)

[Importance]

I only tested with my Yi Cam, to use this with your own decision.

I CAN NOT GUARANTEE IT WILL DAMAGE YOUR CAMERA OR NOT !
 

Attachments

  • wifimode(beta0.0.1).zip
    3.8 KB · Views: 30
  • wifimode(fw ver 1.2.10).zip
    3.8 KB · Views: 38
Last edited:

itzik

Member
Joined
May 5, 2015
Messages
67
Reaction score
5
Country
Israel
does this mean like change between modes without a need of a mobile?
and how do you decide if it turns on in ap or station mode?
 
OP
luckylz

luckylz

Active Member
Joined
Apr 8, 2015
Messages
414
Reaction score
107
Country
China
Yes, my scripts are targeting mode-switching without mobile phone.

if starts in AP mode, Yi Cam will beep 3 times 1-second; if starts in Station Mode, Yi Cam will beep 1-second, and 15s later, will beep 1-second again.
 

itzik

Member
Joined
May 5, 2015
Messages
67
Reaction score
5
Country
Israel
i mean how do you chose between what mode will it turn on?
 
OP
luckylz

luckylz

Active Member
Joined
Apr 8, 2015
Messages
414
Reaction score
107
Country
China
Sorry, I don't really get your point, just let me guess what you want to know...

If you don't use the combination keys, and turn off Yi Cam directly, it will still keep last time boot-up wifi mode.

Use the combination keys, the wifi mode will switch to another one.
 

itzik

Member
Joined
May 5, 2015
Messages
67
Reaction score
5
Country
Israel
ohh i think i understand now..

when wifi is on, i take 3 pictures and turn off wifi and then the camera will auto reboot in normall mode?
and to go to advanced mode i need to make sure wifi is on, take 3 pictures, turn the wifi off and it will auto reboot to advanced mode?
is that the button combination that changes the mode?
 
OP
luckylz

luckylz

Active Member
Joined
Apr 8, 2015
Messages
414
Reaction score
107
Country
China
almost like that, but [Custom Mode] & [WiFi Mode] the combination has a little difference.
 

itzik

Member
Joined
May 5, 2015
Messages
67
Reaction score
5
Country
Israel
il just wait for more people to comment hehe since i didnt understand how to swich mode. but this is GREAT! finaly i can switch between 1080 and 720 120fps while im the water!
 
OP
luckylz

luckylz

Active Member
Joined
Apr 8, 2015
Messages
414
Reaction score
107
Country
China
of course, with little change you can set the modes between 1080p/60fps and 720p/120fps.
 

palarran

Member
Joined
Jun 23, 2015
Messages
42
Reaction score
5
Country
Italy
Very good news!! Thank you luckylz!
But I didn't understand how to change mode...
As itzik I also want to use different fps (or ISO/shutter speed) in the two modes... I know how to edit an .ash file to create a normal script but (in the advanced script) what the "sleep 1" part does?
 

nklh

New Member
Joined
Jul 18, 2015
Messages
23
Reaction score
5
Country
France
Just quickly readed the scripts (normal/advanced) and so the cam goes ON with wifi On if no beep your on normal mode and the number of jpeg is logged whatever the mode.
then you turn wifi off it make an other count of jpeg if you only taken 3 pictures with no video or else it will switch the active file/mode and then autoreboot into the other mode.
pretty clever.

SO to resume :
0-switch on the camera (with wifi On)
1-Startup Beep let you know witch mode is active.
2-Just stricly take 3 pictures then switch wifi to off.
3-The camera automatically reboot in the other mode.​
with some improvment could choose between more than 2 modes.
 

thorroid

Member
Joined
Apr 16, 2015
Messages
31
Reaction score
0
Country
Czech Republic
These are very useful scripts for swapping settings without a phone. Thanks. Would be possible to change video modes without enabling a camera wifi? I have a problem with interference from another 2.4GHz device which must run at the same time.
 
OP
luckylz

luckylz

Active Member
Joined
Apr 8, 2015
Messages
414
Reaction score
107
Country
China
with some improvment could choose between more than 2 modes.

Yeah,actually many modes will do. But considering user-friendly,if more than 2 modes, it's difficult for uses to remember how to switch
 

thorroid

Member
Joined
Apr 16, 2015
Messages
31
Reaction score
0
Country
Czech Republic
I will try it. The camera has too few buttons for an easy and comfortable mode switching and in addition to that, using a wifi button is risky for my purpose.
 

itzik

Member
Joined
May 5, 2015
Messages
67
Reaction score
5
Country
Israel
how about long presses? is that possible? if i press "down arrow" on the side for 10 seconds it changes mode?
or is it possible if i press 2 button in same time?
 

Andy_S

Active Member
Joined
May 5, 2015
Messages
621
Reaction score
193
Country
Czech Republic
there is no down arrow, there are only 3 buttons - Wireless, Power & Shutter.
 

itzik

Member
Joined
May 5, 2015
Messages
67
Reaction score
5
Country
Israel
lol confused with sj4000.... so clickig twice the shutter button can do so? (if click twice in less then 1 second for exampe)
 

itzik

Member
Joined
May 5, 2015
Messages
67
Reaction score
5
Country
Israel
i dont understand why this thread isnt the most alive one on the forum.. its like the best thing!

anyway, what lines do i need to change so the "normall mode" and "station mode" change between 120fps 720 to 1080 30fps?
 
Top