Use autoexec.ash script with Xiaomi Yi 4k ???

mr_cg

New Member
Joined
Dec 14, 2015
Messages
16
Reaction score
3
Country
Germany
Dash Cam
Xiaomi Yi (rev 22)
I had Xiaomi Yi 1st version and have bought now Xiaomi Yi 4k.
Unfortunately my autoexec.ash scripts are not working on the Xiaomi Yi 4k.

1. How to use autoexec.ash script on Xiaomi Yi 4k
2. Is there any reference about commands for Xiaomi Yi 4k

Thx
 
Really nobody can help me here?

Thanks
 
This is precisely what I need as well!
 
Autoexec.ash scripts do work with the Yi4K, just not as well as they do for the original Yi

If you create a autoexec.ash file in the root of the sd card and switch on the camera it will execute the commands listed in the file on bootup.
Unfortunately there are not many documented commands and a lot of them either do not work or get overwritten when you use the camera.

So you can set the camera to automatically start recording video as soon as it has booted up by having the following command in the file:

t app key record

this will simule the record key being pressed and the camera will automatically start recording video on startup be careful though because if you are in a photo mode when you switched it off it will go a bit funny.
Another useful one is to start wifi automatically on bootup, this is great for the people that have cracked their lcd screen and cant manually turn the wifi on. The command is:

t app key start_wifi

to turn off wifi, you can use:

t app key stop_wifi

other t app key commands are:

key Usage: t app key <key>
Key list:
up
up_rel
down
down_rel
left
left_rel
right
right_rel
zoomin
zoomin_rel
zoomout
zoomout_re l
set
focus
focus_rel
shutter
shutter_rel
record
mode
menu
power
del
stop_wifi
start_wifi [ssid] [name] [5G/2.4G]
poweroff [time]
pc [help]
up_rel down down_r

If you edit any of the firmware.bin files you can sift through the entire file and find references, here are some I have pulled out.
I have tried a few and they either dont work or crash the camera, but here you go have a play and report back here if you get any luck :D


Stillrawcap Usage: t app test enc stillrawcap [Cmpr][DumpItuner] Cmpr:0 : Normal Raw, 1 : Compress Raw. DumpItuner: Enable dump ituner or not
videorawcap Usage: t app test videorawcap [RawCompress][Number][EnableFaseCapture][EnableYuv] RawCompress:0 : Normal Raw, 1 : Compress Raw. Number: Capture raw number. EnableFaseCapture: Enable fast capture or not EnableYuv: dump yuv or not

Usage: t app test enc<option>

Test option list:
stillrawcap
videorawcap

Video only AV photo preview video preview still chg_res ----vf----


t app test beep play <path>
t app test beep set_vol <vol>
t app test onoff [0/1] [time_to_poweroff] [time_to_wakeup]
t app test dual_stream [1|0]
t app test vf on
t app test vf sw

awb_setting [t_app] change awb mode to %d, modetype = %d chg_preview %s[t_app] you are now in %s
[t_app] change iso to %d [t_app] change shutter to %d scene_setting [t_app] mode : %d, change scene to %d crop_file [t_app] crop file %s: from %dms to %dms, output file: %s video_rot Just supply 180 rotation MCTF_off [t_app] turn %s MCTF sensor_flip [t_app] set sensor flip %s EIS_enable SS_enable [t_app] set SS %s OSD_rotate [t_app] set OSD rotate to %d degree single_ituner [t_app] %s dump iTuner file in SingleCapture b_shutter_setting [t_app] set b shutter to %f s, iso to %f max_shutter_setting [t_app] fix max shutter to %d enable_rawcap slow_motion enable_CFA set_EIS_range dewarp_support = %d eis_support = %d support_auto_low_light = %d video_rotated = %d show_temp dbg_dsp_event AmbaDSP_EventDbg = %d Usage: t app test dbg_dsp_event [0|1] sd_slow_write show_bs_buffer max_iso_setting [t_app] mode : %d, change iso index to %d dynamic_brc stream_id = %d
MaxBitRate = %d
AvgBitRate = %d
MinBitRate = %d

t app test dynamic_brc [0:pri | 1: sec] [MaxBitRate] [AvgBitRate] [MinBitRate]

pb_zoom x = %d, y = %d, factor = %d Usage: t app test pb_zoom [x] [y] [factor] ZoomX should be 1 ~ n ZoomY should be 1 ~ n Usage: t app test dzoom [factorX] [factorY] [shiftX Pixel] [shiftY Pixel]

[t_app] Usage : t app test set_wb [video:0|still:1] [RGain] [GGain] [BGain]

Usage: t app test <option>

Test option list:
chg_res
chg_LCD
chg_mode
chg_app
graph [set_debug_level | set_debug_module]
save_osd
convclut
freq
extenc [on | off | set_freq | sw]
texttrack [on | off | sw]
wakeup [alarm time(sec)]
enc
video_tlapse [ 500 | 0 | 1 | 2 | 5 | 30 ]
gui_ani [start | set_dly]
beep [play | set_vol]
onoff [0/1] [time_to_poweroff] [time_to_wakeup]
vf [on | off | sw]
rtsp [on | off | show]
rec [av | v | show]
ps
idr
np
sharepv [init | en | dis]
ae_meter
awb_setting
iso_setting
shutter_setting
scene_setting
crop_file [input name] [output name] [start ms] [end ms]
video_rot [rotate index]
MCTF_off [0:enable MCTF |1:disable MCTF]
sensor_flip [1:flip |0:normal]
EIS_enable [1:eek:n |0:eek:ff]
SS_enable [1:eek:n |0:eek:ff]
OSD_rotate [degree:0, 90, 180, 270]
b_shutter_setting [shutter_time_s] [ISO/100]
max_shutter_setting [shutter_idx]
single_ituner [1|0]
dual_stream [1|0]
enable_rawcap [1|0]
slow_motion [2|4|8]
app_status
enable_CFA [1|0] [width] [height]
set_EIS_range [%]
show_temp [0|1|2] (0:disable, 1:show always 2:show only when over threshold)
dbg_dsp_event [0|1]
sd_slow_write [threshold in ms]
show_bs_buffer [threshold in MB]
max_iso_setting [video:0/still:1] [ISO value]
dynamic_brc [0:pri | 1: sec] [MaxBitRate] [AvgBitRate] [MinBitRate]
t app test cache_dbg [1|0]
t app test adj_custom [0~2]
audio_effect channel [0|1]
channel_config [config]
usb_host [1|0]
set_qv [1|0] [delayms]
dzoom [factorX] [factorY] [shiftX Pixel] [shiftY Pixel]
detail
 
Yes, thank you so much @hirsti99 for sharing this, as a starting point!

I'm a little over my head in trying to understand the details of what you're describing here, but if @hirsti99 or any more coding-competent users read this and want to troubleshoot/figure out an autoexec.ash script that defines shutter speed at a given setting (without crashing the camera, etc.), it would be amazing. As a matter of fact, I'm a poor grad student but I'd be willing to pay such a person something for their time...
 
Shutter speed isnt going to work, I have had a play and there are a few settings for shutter speed but if you set them two things happen, first of all if you select anything other than Auto, 0,2,5,10,20 or 60 then the camera will write an error in log saying the value isn't acceptable, this is kind of useless as you can set these shutter speeds already i nthe settings in camera. Secondly if you use one of the previously listed shutter settings, the camera sets it but immediately changes it to the settings you have configured in the camera, so if you have auto shutter set and you have a script setting shutter to 2 secs then it puts it back to auto. Although you can run these Autoexec.ash scripts there is not much you can do as the camera is locked down, the only available control are the test t app controls I listed and the majority of them either crashe the camera or dont work. Your best bet is to ask Michael Zhang (Yi firmware engineer) on the Yi Technology facebook page for a way to fix shutter speed or the introduction of a AEL lock.
 
Good news, Yi have said they are implementing the fixed shutter speed on the existing YI4K in a firmware update, coupled with fixed ISO you should be able to lock down the exposure you want.
 
Autoexec.ash scripts do work with the Yi4K, just not as well as they do for the original Yi

If you create a autoexec.ash file in the root of the sd card and switch on the camera it will execute the commands listed in the file on bootup.
Unfortunately there are not many documented commands and a lot of them either do not work or get overwritten when you use the camera.

So you can set the camera to automatically start recording video as soon as it has booted up by having the following command in the file:

t app key record

this will simule the record key being pressed and the camera will automatically start recording video on startup be careful though because if you are in a photo mode when you switched it off it will go a bit funny.
Another useful one is to start wifi automatically on bootup, this is great for the people that have cracked their lcd screen and cant manually turn the wifi on. The command is:

t app key start_wifi

to turn off wifi, you can use:

t app key stop_wifi

other t app key commands are:

key Usage: t app key <key>
Key list:
up
up_rel
down
down_rel
left
left_rel
right
right_rel
zoomin
zoomin_rel
zoomout
zoomout_re l
set
focus
focus_rel
shutter
shutter_rel
record
mode
menu
power
del
stop_wifi
start_wifi [ssid] [name] [5G/2.4G]
poweroff [time]
pc [help]
up_rel down down_r

If you edit any of the firmware.bin files you can sift through the entire file and find references, here are some I have pulled out.
I have tried a few and they either dont work or crash the camera, but here you go have a play and report back here if you get any luck :D


Stillrawcap Usage: t app test enc stillrawcap [Cmpr][DumpItuner] Cmpr:0 : Normal Raw, 1 : Compress Raw. DumpItuner: Enable dump ituner or not
videorawcap Usage: t app test videorawcap [RawCompress][Number][EnableFaseCapture][EnableYuv] RawCompress:0 : Normal Raw, 1 : Compress Raw. Number: Capture raw number. EnableFaseCapture: Enable fast capture or not EnableYuv: dump yuv or not

Usage: t app test enc<option>

Test option list:
stillrawcap
videorawcap

Video only AV photo preview video preview still chg_res ----vf----


t app test beep play <path>
t app test beep set_vol <vol>
t app test onoff [0/1] [time_to_poweroff] [time_to_wakeup]
t app test dual_stream [1|0]
t app test vf on
t app test vf sw

awb_setting [t_app] change awb mode to %d, modetype = %d chg_preview %s[t_app] you are now in %s
[t_app] change iso to %d [t_app] change shutter to %d scene_setting [t_app] mode : %d, change scene to %d crop_file [t_app] crop file %s: from %dms to %dms, output file: %s video_rot Just supply 180 rotation MCTF_off [t_app] turn %s MCTF sensor_flip [t_app] set sensor flip %s EIS_enable SS_enable [t_app] set SS %s OSD_rotate [t_app] set OSD rotate to %d degree single_ituner [t_app] %s dump iTuner file in SingleCapture b_shutter_setting [t_app] set b shutter to %f s, iso to %f max_shutter_setting [t_app] fix max shutter to %d enable_rawcap slow_motion enable_CFA set_EIS_range dewarp_support = %d eis_support = %d support_auto_low_light = %d video_rotated = %d show_temp dbg_dsp_event AmbaDSP_EventDbg = %d Usage: t app test dbg_dsp_event [0|1] sd_slow_write show_bs_buffer max_iso_setting [t_app] mode : %d, change iso index to %d dynamic_brc stream_id = %d
MaxBitRate = %d
AvgBitRate = %d
MinBitRate = %d

t app test dynamic_brc [0:pri | 1: sec] [MaxBitRate] [AvgBitRate] [MinBitRate]

pb_zoom x = %d, y = %d, factor = %d Usage: t app test pb_zoom [x] [y] [factor] ZoomX should be 1 ~ n ZoomY should be 1 ~ n Usage: t app test dzoom [factorX] [factorY] [shiftX Pixel] [shiftY Pixel]

[t_app] Usage : t app test set_wb [video:0|still:1] [RGain] [GGain] [BGain]

Usage: t app test <option>

Test option list:
chg_res
chg_LCD
chg_mode
chg_app
graph [set_debug_level | set_debug_module]
save_osd
convclut
freq
extenc [on | off | set_freq | sw]
texttrack [on | off | sw]
wakeup [alarm time(sec)]
enc
video_tlapse [ 500 | 0 | 1 | 2 | 5 | 30 ]
gui_ani [start | set_dly]
beep [play | set_vol]
onoff [0/1] [time_to_poweroff] [time_to_wakeup]
vf [on | off | sw]
rtsp [on | off | show]
rec [av | v | show]
ps
idr
np
sharepv [init | en | dis]
ae_meter
awb_setting
iso_setting
shutter_setting
scene_setting
crop_file [input name] [output name] [start ms] [end ms]
video_rot [rotate index]
MCTF_off [0:enable MCTF |1:disable MCTF]
sensor_flip [1:flip |0:normal]
EIS_enable [1:eek:n |0:eek:ff]
SS_enable [1:eek:n |0:eek:ff]
OSD_rotate [degree:0, 90, 180, 270]
b_shutter_setting [shutter_time_s] [ISO/100]
max_shutter_setting [shutter_idx]
single_ituner [1|0]
dual_stream [1|0]
enable_rawcap [1|0]
slow_motion [2|4|8]
app_status
enable_CFA [1|0] [width] [height]
set_EIS_range [%]
show_temp [0|1|2] (0:disable, 1:show always 2:show only when over threshold)
dbg_dsp_event [0|1]
sd_slow_write [threshold in ms]
show_bs_buffer [threshold in MB]
max_iso_setting [video:0/still:1] [ISO value]
dynamic_brc [0:pri | 1: sec] [MaxBitRate] [AvgBitRate] [MinBitRate]
t app test cache_dbg [1|0]
t app test adj_custom [0~2]
audio_effect channel [0|1]
channel_config [config]
usb_host [1|0]
set_qv [1|0] [delayms]
dzoom [factorX] [factorY] [shiftX Pixel] [shiftY Pixel]
detail

"t app key start_wifi" doesnt work for me (in autoexec.ash - unix)... yi4k firmware 1.4.23 ;/ To bad.

I have broken screen and can't change anything - any solution ?

Any control app via usb cable maybe ?
 
"t app key start_wifi" doesnt work for me (in autoexec.ash - unix)... yi4k firmware 1.4.23 ;/ To bad.

I have broken screen and can't change anything - any solution ?

Any control app via usb cable maybe ?
Same too, any script to enable wifi?
 
Autoexec.ash scripts do work with the Yi4K, just not as well as they do for the original Yi

If you create a autoexec.ash file in the root of the sd card and switch on the camera it will execute the commands listed in the file on bootup.
Unfortunately there are not many documented commands and a lot of them either do not work or get overwritten when you use the camera.

So you can set the camera to automatically start recording video as soon as it has booted up by having the following command in the file:

t app key record

this will simule the record key being pressed and the camera will automatically start recording video on startup be careful though because if you are in a photo mode when you switched it off it will go a bit funny.
Another useful one is to start wifi automatically on bootup, this is great for the people that have cracked their lcd screen and cant manually turn the wifi on. The command is:

t app key start_wifi

to turn off wifi, you can use:

t app key stop_wifi

other t app key commands are:

key Usage: t app key <key>
Key list:
up
up_rel
down
down_rel
left
left_rel
right
right_rel
zoomin
zoomin_rel
zoomout
zoomout_re l
set
focus
focus_rel
shutter
shutter_rel
record
mode
menu
power
del
stop_wifi
start_wifi [ssid] [name] [5G/2.4G]
poweroff [time]
pc [help]
up_rel down down_r

If you edit any of the firmware.bin files you can sift through the entire file and find references, here are some I have pulled out.
I have tried a few and they either dont work or crash the camera, but here you go have a play and report back here if you get any luck :D


Stillrawcap Usage: t app test enc stillrawcap [Cmpr][DumpItuner] Cmpr:0 : Normal Raw, 1 : Compress Raw. DumpItuner: Enable dump ituner or not
videorawcap Usage: t app test videorawcap [RawCompress][Number][EnableFaseCapture][EnableYuv] RawCompress:0 : Normal Raw, 1 : Compress Raw. Number: Capture raw number. EnableFaseCapture: Enable fast capture or not EnableYuv: dump yuv or not

Usage: t app test enc<option>

Test option list:
stillrawcap
videorawcap

Video only AV photo preview video preview still chg_res ----vf----


t app test beep play <path>
t app test beep set_vol <vol>
t app test onoff [0/1] [time_to_poweroff] [time_to_wakeup]
t app test dual_stream [1|0]
t app test vf on
t app test vf sw

awb_setting [t_app] change awb mode to %d, modetype = %d chg_preview %s[t_app] you are now in %s
[t_app] change iso to %d [t_app] change shutter to %d scene_setting [t_app] mode : %d, change scene to %d crop_file [t_app] crop file %s: from %dms to %dms, output file: %s video_rot Just supply 180 rotation MCTF_off [t_app] turn %s MCTF sensor_flip [t_app] set sensor flip %s EIS_enable SS_enable [t_app] set SS %s OSD_rotate [t_app] set OSD rotate to %d degree single_ituner [t_app] %s dump iTuner file in SingleCapture b_shutter_setting [t_app] set b shutter to %f s, iso to %f max_shutter_setting [t_app] fix max shutter to %d enable_rawcap slow_motion enable_CFA set_EIS_range dewarp_support = %d eis_support = %d support_auto_low_light = %d video_rotated = %d show_temp dbg_dsp_event AmbaDSP_EventDbg = %d Usage: t app test dbg_dsp_event [0|1] sd_slow_write show_bs_buffer max_iso_setting [t_app] mode : %d, change iso index to %d dynamic_brc stream_id = %d
MaxBitRate = %d
AvgBitRate = %d
MinBitRate = %d

t app test dynamic_brc [0:pri | 1: sec] [MaxBitRate] [AvgBitRate] [MinBitRate]

pb_zoom x = %d, y = %d, factor = %d Usage: t app test pb_zoom [x] [y] [factor] ZoomX should be 1 ~ n ZoomY should be 1 ~ n Usage: t app test dzoom [factorX] [factorY] [shiftX Pixel] [shiftY Pixel]

[t_app] Usage : t app test set_wb [video:0|still:1] [RGain] [GGain] [BGain]

Usage: t app test <option>

Test option list:
chg_res
chg_LCD
chg_mode
chg_app
graph [set_debug_level | set_debug_module]
save_osd
convclut
freq
extenc [on | off | set_freq | sw]
texttrack [on | off | sw]
wakeup [alarm time(sec)]
enc
video_tlapse [ 500 | 0 | 1 | 2 | 5 | 30 ]
gui_ani [start | set_dly]
beep [play | set_vol]
onoff [0/1] [time_to_poweroff] [time_to_wakeup]
vf [on | off | sw]
rtsp [on | off | show]
rec [av | v | show]
ps
idr
np
sharepv [init | en | dis]
ae_meter
awb_setting
iso_setting
shutter_setting
scene_setting
crop_file [input name] [output name] [start ms] [end ms]
video_rot [rotate index]
MCTF_off [0:enable MCTF |1:disable MCTF]
sensor_flip [1:flip |0:normal]
EIS_enable [1:eek:n |0:eek:ff]
SS_enable [1:eek:n |0:eek:ff]
OSD_rotate [degree:0, 90, 180, 270]
b_shutter_setting [shutter_time_s] [ISO/100]
max_shutter_setting [shutter_idx]
single_ituner [1|0]
dual_stream [1|0]
enable_rawcap [1|0]
slow_motion [2|4|8]
app_status
enable_CFA [1|0] [width] [height]
set_EIS_range [%]
show_temp [0|1|2] (0:disable, 1:show always 2:show only when over threshold)
dbg_dsp_event [0|1]
sd_slow_write [threshold in ms]
show_bs_buffer [threshold in MB]
max_iso_setting [video:0/still:1] [ISO value]
dynamic_brc [0:pri | 1: sec] [MaxBitRate] [AvgBitRate] [MinBitRate]
t app test cache_dbg [1|0]
t app test adj_custom [0~2]
audio_effect channel [0|1]
channel_config [config]
usb_host [1|0]
set_qv [1|0] [delayms]
dzoom [factorX] [factorY] [shiftX Pixel] [shiftY Pixel]
detail



Can you share autoexec code for wifi on in yi 4k?
Many thanks before
 
Hi, I have my screen broken and this script worked for me

t wi-fi restart

After I had upgraded my firmware to the lastest version (in order to try and put my new bluetooth shutter) , it appears now a wizard and Wifi does not start.

Does anyone has this problem also ? Can anyone help ?
 
Hello. tell me, is it possible to set the start time for a script? I need to put the camera in a remote location. I can supply it from a dispatcher, but it's time to start when it's just overflowing SD
 
onoff [0/1] [time_to_poweroff] [time_to_wakeup]
in what format should time be written?
 
Back
Top