Skip to content

Releases: psolyca/Yi_4k_ROOTFS

Full RTMP connection customization and wifi signal checking

20 Dec 16:25
Compare
Choose a tag to compare

This release bring a complet rewrite of main wifi and RTMP scripts.
It is associate with a WebApp which permit to customize the RTMP connection and also be able to connect to a wifi station not in the wifi.conf file and without live stream.

By the way, this release comes with a huge work on the wifi.conf file which also have been rewrote, some settings are not needed anymore, some are left empty unless one want to force a value and some have change their name.
Default values for IP have changed Ethernet-over-USB is more customizable as it can be used as DHCP server to let computer in DHCP mode.
So please, update your wifi.conf with the one provided below.

Also, a new feature permit to reconnect in case the wifi signal is too low or the station is disconnected. This feature only work in station mode. If you do not want this, disable it in the wifi.conf file.

Currently the link to the WebApp is https://psolyca.ovh/, it is merged with the previous scripts for bitrates mod which have been redone.

Ethernet over USB and Static IP in STA mode

15 Jul 09:48
Compare
Choose a tag to compare

New features of this releas :

  • Thanks to @luckylz2git you can setup a static IP for the station mode as some people do not use a DHCP server. The new option is called STA_IP in wifi.conf.
  • More over, @luckylz2git add the ability to have a default wifi.conf configuration file outside of the firmware but not on the SDCard. This way if you have trouble with your SDCard or did not put it in, you can always have a connection.
    The wifi.conf has to be copied on /tmp/FL0 partition thus this could be done ONLY with a telnet access (yet, I will later add the ability to create it automatically).
  • A new driver has been added which permit to have access to the cam through USB, ethernet over USB. Yes, now you can have access to your cam without Wifi thus certainly reducing battery usage (did not bench the battery). Streaming to a computer through USB works (on my computer), you need the windows USB gadget driver (attached - try all).
    Streaming to a phone in host mode should work but it is not tested yet (I need to buy the cable or need a tester) and sould NOTwork with the official app.
    The wifi.conf file is the main configuration file for this driver. You have 3 options :
    • ETHER_MODE=yes|no
      To enable or disable the driver
    • KEEP_WIFI=yes|no
      To keep the wifi active with ethernet over USB or not
    • ETHER_IP=192.168.40.1
      The IP address

ATTENTION : There is a bug in Windows10 for RNDIS driver, one have to use the driver from Pwnagotchi here to be able to use the ethernet over USB feature (thanks to jorge borja on Discord)

Add boot scripts

07 Nov 13:47
Compare
Choose a tag to compare

The release add 2 ways of launching scripts at Yi start up.

With a script called "bootcmd.sh" on the root of the SDCard.
This script could be used to launch commands directly on the Linux OS.
With a script called "events_boot.py" in the folder events.
This script permit launch of event at boot to RTOS.

More over, custom firmwares have now a custom version number starting at 1.10.50.

Add events callback

13 Sep 16:12
Compare
Choose a tag to compare

The user has the ability to launch commands automaticaly through the remote API in response to cam events.

A folder named 'events' in the root of the SDCard should be created in order to trigger the function.
In this folder, a python script which name is the name of the event should be created (i.e. adapter_status.py for adapter_status event).

The file must contain the following function which return an arg dictionary (exemple for adapter_status.py) :

def cmd(_param):
    arg= {}
    if _param == "1":
        arg['setRecordMode']= 0
        arg['startRecording']= True
    else:
        arg['stopRecording']= True
    return arg

These events are (not implemented in italic):

  • start_video_record
    parameters of the video
  • video_record_complete
    path and name of the video
  • start_photo_capture
    parameters of the photo
  • photo_taken
    path and name of the photo
  • enter_album
  • exit_album
  • battery
    0-100 : battery percentage (discharging)
  • battery_status
    0 : adapter connected (or battery removed)
    1 : adapter disconnted (or battery inserted)
  • adapter
    0-100 : battery percentage (charging)
  • adapter_status
    0 : disconnected
    1 : connected
  • sdcard_format_done
  • setting_changed
    list of settings
  • switch_to_rec_mode
  • switch_to_cap_mode
  • sd_card_status
    insert
    remove

Commands are the following :

  • startRecording
  • stopRecording
  • capturePhoto
  • getFileList GETFILELIST
  • deleteFile DELETEFILE
  • startViewFinder
  • stopViewFinder
  • getSettings
  • setDateTime "yyyy-MM-dd HH:mm:ss" SETDATETIME "YYYY_MM_DD HH:MM:SS"
  • setSystemMode {0,1}
    0: 'capture'
    1: 'record'
  • getVideoResolution
  • setVideoResolution {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
    0: '3840x2160 30P 16:9'
    1: '3840x2160 30P 16:9 super'
    2: '2560x1920 30P 4:3'
    3: '1920x1440 60P 4:3'
    4: '1920x1440 30P 4:3'
    5: '1920x1080 120P 16:9'
    6: '1920x1080 120P 16:9 super'
    7: '1920x1080 60P 16:9'
    8: '1920x1080 60P 16:9 super'
    9: '1920x1080 30P 16:9'
    10: '1920x1080 30P 16:9 super'
    11: '1280x960 120P 4:3'
    12: '1280x960 60P 4:3'
    13: '1280x720 240P 16:9'
    14: '1280x720 120P 16:9 super'
    15: '1280x720 60P 16:9 super'
    16: '840x480 240P 16:9'
  • getPhotoResolution
  • setPhotoResolution {0,1,2,3,4}
    0: '12MP (4000x3000 4:3) fov:w'
    1: '7MP (3008x2256 4:3) fov:w'
    2: '7MP (3008x2256 4:3) fov:m'
    3: '5MP (2560x1920 4:3) fov:m'
    4: '8MP (3840x2160 16:9) fov:w'
  • getPhotoWhiteBalance
  • setPhotoWhiteBalance {0,1,2,3,4}
    0: 'auto'
    1: 'native'
    2: '3000k'
    3: '5500k'
    4: '6500k'
  • getVideoWhiteBalance
  • setVideoWhiteBalance {0,1,2,3,4}
    0: 'auto'
    1: 'native'
    2: '3000k'
    3: '5500k'
    4: '6500k'
  • getPhotoISO
  • setPhotoISO {0,1,2,3,4,5,6}
    0: 'auto'
    1: '100'
    2: '200'
    3: '400'
    4: '800'
    5: '1600'
    6: '6400'
  • getVideoISO
  • setVideoISO {0,1,2,3,4,5,6}
    0: 'auto'
    1: '100'
    2: '200'
    3: '400'
    4: '800'
    5: '1600'
    6: '6400'
  • getPhotoExposureValue
  • setPhotoExposureValue {0,1,2,3,4,5,6,7,8}
    0: '-2.0'
    1: '-1.5'
    2: '-1.0'
    3: '-0.5'
    4: '0',
    5: '+0.5'
    6: '+1.0'
    7: '+1.5'
    8: '+2.0'
  • getVideoExposureValue
  • setVideoExposureValue {0,1,2,3,4,5,6,7,8}
    0: '-2.0'
    1: '-1.5'
    2: '-1.0'
    3: '-0.5'
    4: '0',
    5: '+0.5'
    6: '+1.0'
    7: '+1.5'
    8: '+2.0'
  • getPhotoShutterTime
  • setPhotoShutterTime {0,1,2,3,4,5}
    0: 'auto'
    1: '2s'
    2: '5s'
    3: '10s'
    4: '20s'
    5: '30s'
  • getVideoSharpness
  • setVideoSharpness {0,1,2}
    0: 'low'
    1: 'medium'
    2: 'high'
  • getPhotoSharpness
  • setPhotoSharpness {0,1,2}
    0: 'low'
    1: 'medium'
    2: 'high'
  • getVideoFieldOfView
  • setVideoFieldOfView {0,1,2}
    0: 'wide'
    1: 'medium'
    2: 'narrow'
  • getRecordMode
  • setRecordMode {0,1,2,3,4}
    0: 'record'
    1: 'record_timelapse'
    2: 'record_slow_motion'
    3: 'record_loop'
    4: 'record_photo'
  • getCaptureMode
  • setCaptureMode {0,1,2,3}
    0: 'precise quality'
    1: 'precise self quality'
    2: 'burst quality'
    3: 'precise quality cont.'
  • getMeteringMode
  • setMeteringMode {0,1,2}
    0: 'center'
    1: 'average'
    2: 'spot'
  • getVideoQuality
  • setVideoQuality {0,1,2}
    0: 'S.Fine'
    1: 'Fine'
    2: 'Normal'
  • getVideoColorMode
  • setVideoColorMode {0,1}
    0: 'yi'
    1: 'flat'
  • getPhotoColorMode
  • setPhotoColorMode {0,1}
    0: 'yi'
    1: 'flat'
  • getElectronicImageStabilizationState
  • setElectronicImageStabilizationState {0,1}
    0: 'on'
    1: 'off'
  • getAdjustLensDistortionState
  • setAdjustLensDistortionState {0,1}
    0: 'on'
    1: 'off'
  • getVideoMuteState
  • setVideoMuteState {0,1}
    0: 'on'
    1: 'off'
  • getVideoTimestamp
  • setVideoTimestamp {0,1,2,3}
    0: 'off'
    1: 'time'
    2: 'date'
    3: 'date/time'
  • getPhotoTimestamp
  • setPhotoTimestamp {0,1,2,3}
    0: 'off'
    1: 'time'
    2: 'date'
    3: 'date/time'
  • getLEDMode
  • setLEDMode {0,1,2}
    0: 'all enable'
    1: 'all disable'
    2: 'status enable'
  • getVideoStandard
  • setVideoStandard {0,1}
    0: 'PAL'
    1: 'NTSC'
  • getTimeLapseVideoInterval
  • setTimeLapseVideoInterval {0,1,2,3,4,5,6}
    0: '0.5'
    1: '1'
    2: '2'
    3: '5'
    4: '10'
    5: '30',
    6: '60'
  • getTimeLapsePhotoInterval
  • setTimeLapsePhotoInterval {0,1,2,3,4,5,6,7,8,9,10,11,12}
    0: 'continue'
    1: '0.5 sec'
    2: '1.0 sec'
    3: '2.0 sec'
    4: '5.0 sec'
    5: '10.0 sec'
    6: '30.0 sec'
    7: '60.0 sec'
    8: '2.0 min'
    9: '5.0 min'
    10: '10.0 min'
    11: '30.0 min'
    12: '60.0 min'
  • getTimeLapseVideoDuration
  • setTimeLapseVideoDuration {0,1,2,3,4,5,6,7}
    0: 'off'
    1: '6s'
    2: '8s'
    3: '10s'
    4: '20s'
    5: '30s'
    6: '60s'
    7: '120s'
  • getScreenAutoLock
  • setScreenAutoLock {0,1,2,3}
    0: 'never'
    1: '30s'
    2: '60s'
    3: '120s'
  • getAutoPowerOff
  • setAutoPowerOff {0,1,2,3}
    0: 'off'
    1: '3 minutes'
    2: '5 minutes'
    3: '10 minutes'
  • getVideoRotateMode
  • setVideoRotateMode {0,1,2}
    0: 'off'
    1: 'on'
    2: 'auto'
  • getBuzzerVolume
  • setBuzzerVolume {0,1,2}
    0: 'high'
    1: 'low'
    2: 'mute'
  • getLoopDuration
  • setLoopDuration {0,1,2,3,4}
    0: '5 minutes'
    1: '20 minutes'
    2: '60 minutes'
    3: '120 minutes'
    4: 'max'

WiFi must be activate as AP or STA
Remote app on phone should be avoided if event active or the cam shuld be rebooted in order to be activate again.

Fix EOL for configuration files on the SDCard

25 Aug 21:50
Compare
Choose a tag to compare

When a user create a wifi.conf file, the EOL could be CRLF (windows format) thus parameters are wrong as a CR is added at the and of parameters.
As dos2unix is present in the firmware, it is used.
BTW, files could not be converted directly on the SDCard, freeze everytime, so files are copied on /tmp folder if needed.

Fix station mode when no AP

07 Aug 21:05
Compare
Choose a tag to compare

When in station mode and the needed AP is not present, the cam do not stop searching for the AP and the cam is busy.
So the cam is connected to a AP named 'FAKE'.
This able a manual switch off of the wifi.

1.10.9 wifi station mode debugged

31 Jul 07:15
Compare
Choose a tag to compare

Values passed by the cam during configuration of wifi are used instead of the value in both default wifi.conf and wifi.conf file on the SDCard.

Values passed are :

  • WIFI_MODE (from wifi menu)
  • AP_CHANNEL_5G (from wifi menu)
  • AP_COUNTRY (from localisation menu)
  • WIFI_MAC (from internal)
  • CHIP_TYPE (from internal)
    So these parameters need to be hidden in the wifi.conf file on the SDCard unless you want to force them.
##### Wifi configuration file ##########################################
## Empty lines and lines starting with # are ignored
# ap: SoftAP mode
# sta: Station mode
# p2p: Enable Wifi Direct Support for peer-to-peer connectivity (not implemented)
#WIFI_MODE=ap
# GPIO pin to enable or disable WiFi
#WIFI_EN_GPIO=124
# GPIO physical button that user can turn WiFi ON/OFF
#WIFI_SWITCH_GPIO=43
#WIFI MAC addr
#WIFI_MAC=58:70:C6:00:00:00
##### STA mode configuration ##########################################
# SSID
ESSID=yourstationessid
# Passphrase. Leave empty at no security mode; please edit wpa_supplicant.conf when your AP cannot be detected
PASSWORD=yourstationpassword
# Device Name for AMBA Discovery Protocol (optional)
STA_DEVICE_NAME=whatyouwant
# Do not detect SSID setting changes, use previous scanned results (not implemented)
STA_SKIP_SCAN=yes

##### Wifi Direct configuration ##########################################
# Find devices with correct name prefix and automatically connect at startup
#P2P_AUTO_CONNECT=no
# Auto-connect with devices if the name prefix matches
#P2P_CONNECT_PREFIX=amba
## Do not enable this optional field unless you are certain
# please provide a unique name amoung multiple devices to prevent confusion
#P2P_DEVICE_NAME=amba-1
## Do not enable this optional field unless you are certain
# Set the default P2P GO Intent
#P2P_GO_INTENT=0
## Do not enable this optional field unless you are certain
# Specify P2P operating channel
#P2P_OPER_CHANNEL=1
## Do not enable this optional field unless you are certain
# Default mode for HT40 enable when operating as GO
#P2P_GO_HT40=0

##### SoftAP configuration ##########################################
# SSID (1 ~ 32 characters)
AP_SSID=YDXJ_AP
# IP address
LOCAL_IP=192.168.42.1
# IP subnet mask
LOCAL_NETMASK=255.255.255.0
# IP pool starting address of DHCP server
DHCP_IP_START=192.168.42.2
# IP pool end address of DHCP server
DHCP_IP_END=192.168.42.6
# Wifi channel number, set 0 to use Auto Channel Selection
AP_CHANNEL=0
# Wifi channel 5G/2.4G, set 0 to use 2.4G Channel/set 1 to use 5G
#AP_CHANNEL_5G=0
# Maximum number of stations allowed in station table
AP_MAXSTA=5
# If you say yes here, all WPA/WEP settings will be ignored
AP_PUBLIC=no
# WPA Passphrase (8 ~ 63 characters)
AP_PASSWD=yourAPpassword
#AP_COUNTRY=CN
#CHIP TYPE
#CHIP_TYPE=43340

Values to change :

  • For station mode :
    • ESSID
    • PASSWORD
    • STA_DEVICE_NAME
  • For AP mode :
    • AP_SSID (if the AP SSID is still YDXJ_AP, random number are choosen after, default behaviour)
    • AP_PASSWD

DO NOT FORGET TO STOP WIFI before switching modes otherwise, you need to reboot.

Wifi configuration enhancement

30 Jul 09:39
Compare
Choose a tag to compare

This firmware is based on 1.10.7.

Values passed by the cam during configuration of wifi are used instead of the value in both default wifi.conf and wifi.conf file on the SDCard.

Values passed are :

  • WIFI_MODE (from wifi menu)
  • AP_CHANNEL_5G (from wifi menu)
  • AP_COUNTRY (from localisation menu)
  • WIFI_MAC (from internal)
  • CHIP_TYPE (from internal)
    So these parameters need to be hidden in the wifi.conf file on the SDCard unless you want to force them.
##### Wifi configuration file ##########################################
## Empty lines and lines starting with # are ignored
# ap: SoftAP mode
# sta: Station mode
# p2p: Enable Wifi Direct Support for peer-to-peer connectivity (not implemented)
#WIFI_MODE=ap
# GPIO pin to enable or disable WiFi
#WIFI_EN_GPIO=124
# GPIO physical button that user can turn WiFi ON/OFF
#WIFI_SWITCH_GPIO=43
#WIFI MAC addr
#WIFI_MAC=58:70:C6:00:00:00
##### STA mode configuration ##########################################
# SSID
ESSID=yourstationessid
# Passphrase. Leave empty at no security mode; please edit wpa_supplicant.conf when your AP cannot be detected
PASSWORD=yourstationpassword
# Device Name for AMBA Discovery Protocol (optional)
STA_DEVICE_NAME=whatyouwant
# Do not detect SSID setting changes, use previous scanned results (not implemented)
STA_SKIP_SCAN=yes

##### Wifi Direct configuration ##########################################
# Find devices with correct name prefix and automatically connect at startup
#P2P_AUTO_CONNECT=no
# Auto-connect with devices if the name prefix matches
#P2P_CONNECT_PREFIX=amba
## Do not enable this optional field unless you are certain
# please provide a unique name amoung multiple devices to prevent confusion
#P2P_DEVICE_NAME=amba-1
## Do not enable this optional field unless you are certain
# Set the default P2P GO Intent
#P2P_GO_INTENT=0
## Do not enable this optional field unless you are certain
# Specify P2P operating channel
#P2P_OPER_CHANNEL=1
## Do not enable this optional field unless you are certain
# Default mode for HT40 enable when operating as GO
#P2P_GO_HT40=0

##### SoftAP configuration ##########################################
# SSID (1 ~ 32 characters)
AP_SSID=YDXJ_AP
# IP address
LOCAL_IP=192.168.42.1
# IP subnet mask
LOCAL_NETMASK=255.255.255.0
# IP pool starting address of DHCP server
DHCP_IP_START=192.168.42.2
# IP pool end address of DHCP server
DHCP_IP_END=192.168.42.6
# Wifi channel number, set 0 to use Auto Channel Selection
AP_CHANNEL=0
# Wifi channel 5G/2.4G, set 0 to use 2.4G Channel/set 1 to use 5G
#AP_CHANNEL_5G=0
# Maximum number of stations allowed in station table
AP_MAXSTA=5
# If you say yes here, all WPA/WEP settings will be ignored
AP_PUBLIC=no
# WPA Passphrase (8 ~ 63 characters)
AP_PASSWD=yourAPpassword
#AP_COUNTRY=CN
#CHIP TYPE
#CHIP_TYPE=43340

Values to change :

  • For station mode :
    • ESSID
    • PASSWORD
    • STA_DEVICE_NAME
  • For AP mode :
    • AP_SSID (if the AP SSID is still YDXJ_AP, random number are choosen after, default behaviour)
    • AP_PASSWD

DO NOT FORGET TO STOP WIFI before switching modes otherwise, you need to reboot.

Wifi station mode enable

29 Jul 21:27
Compare
Choose a tag to compare

This firmware is based on 1.10.7.

It enables wifi modes has they should be.
Now, the wifi menu on the cam enable either AP or station.
Only one file wifi.conf is needed on the SDCard, no sta.conf file.

##### Wifi configuration file ##########################################
## Empty lines and lines starting with # are ignored
# ap: SoftAP mode
# sta: Station mode
# p2p: Enable Wifi Direct Support for peer-to-peer connectibity
#WIFI_MODE=ap
# GPIO pin to enable or disable WiFi
WIFI_EN_GPIO=124
# GPIO physical button that user can turn WiFi ON/OFF
#WIFI_SWITCH_GPIO=43
#WIFI MAC addr
WIFI_MAC=58:70:C6:00:00:00
##### STA mode configuration ##########################################
# SSID
ESSID=yourstationessid
# Passphrase. Leave empty at no security mode; please edit wpa_supplicant.conf when your AP cannot be detected
PASSWORD=yourstationpassword
# Device Name for AMBA Discovery Protocol (optional)
STA_DEVICE_NAME=whatyouwant
# Do not detect SSID setting changes, use previous scanned results (not active)
STA_SKIP_SCAN=yes

##### Wifi Direct configuration ##########################################
# Find devices with correct name prefix and automatically connect at startup
P2P_AUTO_CONNECT=no
# Auto-connect with devices if the name prefix matches
P2P_CONNECT_PREFIX=amba
## Do not enable this optional field unless you are certain
# please provide a unique name amoung multiple devices to prevent confusion
#P2P_DEVICE_NAME=amba-1
## Do not enable this optional field unless you are certain
# Set the default P2P GO Intent
#P2P_GO_INTENT=0
## Do not enable this optional field unless you are certain
# Specify P2P operating channel
#P2P_OPER_CHANNEL=1
## Do not enable this optional field unless you are certain
# Default mode for HT40 enable when operating as GO
#P2P_GO_HT40=0

##### SoftAP configuration ##########################################
# SSID (1 ~ 32 characters)
AP_SSID=YDXJ_AP
# IP address
LOCAL_IP=192.168.42.1
# IP subnet mask
LOCAL_NETMASK=255.255.255.0
# IP pool starting address of DHCP server
DHCP_IP_START=192.168.42.2
# IP pool end address of DHCP server
DHCP_IP_END=192.168.42.6
# Wifi channel number, set 0 to use Auto Channel Selection
AP_CHANNEL=0
# Wifi channel 5G/2.4G, set 0 to use 2.4G Channel/set 1 to use 5G
AP_CHANNEL_5G=0
# Maximum number of stations allowed in station table
AP_MAXSTA=5
# If you say yes here, all WPA/WEP settings will be ignored
AP_PUBLIC=no
# WPA Passphrase (8 ~ 63 characters)
AP_PASSWD=yourAPpassword
AP_COUNTRY=yourcountry
#CHIP TYPE
CHIP_TYPE=43340

Values to change :

  • For station mode :
    • ESSID
    • PASSWORD
    • STA_DEVICE_NAME
    • AP_COUNTRY (used for station and AP mode)
  • For AP mode :
    • AP_SSID (if the AP SSID is still YDXJ_AP, random number are choosen after, default behaviour)
    • AP_PASSWD
    • AP_COUNTRY (used for station and AP mode)

DO NOT FORGET TO STOP WIFI before switching modes otherwise, you need to reboot.