Page 1 of 1

Xiaomi Xiaofang 1S, not connecting to wifi

Posted: Saturday 25 August 2018 13:26
by hoeby
I have a Xiaomi Xiaofang S1, which i want to hack.

FIrst i tested it whit the Mi Home app. I can get it connected to the wifi and got its IP address, also made a reservation in de DHCP server.

Then i followed the steps for the bootloader, it seems to be OK.
Copied the files from the firmware folder to the sd and put it in de camera, after that i powered it.
The led went from purple to yellow back to purple. And 1 second later it jumps to blue.
Looked in my DHCP server, but no DHCP request.

Looked a the log file of the camera, it looks like it is not connecting to wifi.
I know the wifi is OK, because i tested it in the Mi Home app.
In the log it says it is looking for a directory it can't find.
Tried the simple version of the wpa_supplicant.conf, but whitout succes

Does somebody has an idea what i am doing wrong?

The wifi settings in wpa_supplicant.conf

Code: Select all

# For more configuration option please see:
# https://w1.fi/cgit/hostap/plain/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
ap_scan=1

network={
        ssid="CENSORED"
        # Uncomment to connect to Hidden SSIDs
        #scan_ssid=1 
        key_mgmt=WPA-PSK
        pairwise=CCMP TKIP
        group=CCMP TKIP WEP104 WEP40
        psk="CENSORED"
        priority=2
}
The log file it made on startup (changed the SSID name to CENSORED)

Code: Select all

==================================================
Starting the Dafang Hacks Custom Application Layer
==================================================
Loaded common functions
Created etc directory on sdcard
Bind mounted /system/sdcard/bin/busybox to /bin/busybox
Bind mounted /system/sdcard/root to /root
Bind mounted /system/sdcard/etc to /etc
Created cron directories and standard interval jobs
wpa_supplicant: wpa_supplicant v2.5
random: Trying to read entropy from /dev/random
Successfully initialized wpa_supplicant
Initializing interface 'wlan0' conf '/system/sdcard/config/wpa_supplicant.conf' driver 'default' ctrl_interface 'N/A' bridge 'N/A'
Configuration file '/system/sdcard/config/wpa_supplicant.conf' -> '/system/sdcard/config/wpa_supplicant.conf'
Reading configuration file '/system/sdcard/config/wpa_supplicant.conf'
ctrl_interface='/var/run/wpa_supplicant'
ctrl_interface_group='0'
ap_scan=1
Priority group 2
   id=0 ssid='CENSORED'
nl80211: Could not add multicast membership for vendor events: -2 (No such file or directory)
rfkill: Cannot open RFKILL control device
nl80211: RFKILL status not available
Could not read interface wlan0 flags: No such device
nl80211: Driver does not support authentication/association or connect commands
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
nl80211: Remove monitor interface: refcount=0
netlink: Operstate: ifindex=0 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)
Could not read interface wlan0 flags: No such device
nl80211: Set mode ifindex 0 iftype 2 (STATION)
nl80211: Failed to set interface 0 to mode 2: -19 (No such device)
wlan0: Failed to initialize driver interface
Failed to add interface wlan0
wlan0: Cancelling scan request
wlan0: Cancelling authentication timeout
udhcpc: 
Initialized gpios
Determined image sensor model as 
dropbear: 
bftpd: 
Created new certificate for webserver
lighttpd: 
Startup finished!

Re: Xiaomi Xiaofang 1S, not connecting to wifi

Posted: Saturday 25 August 2018 14:17
by hoeby
i already found the problem.

in domoticz wiki of the xiaomi camera, they say to use the dafang hack. therefor i used the boatloader for dafang, but i needed the xiaofang bootloader.

after that it worked.
only thing is the fps. the settings says 25fps. but it is 1fps when looking at the stream. need to search why it is doing this

Re: Xiaomi Xiaofang 1S, not connecting to wifi

Posted: Saturday 25 August 2018 14:46
by Daylights
You will probably get more input opening an issue on https://github.com/EliasKotlyar/Xiaomi- ... cks/issues, since they have more detailed expertise on this over there. But I am using the Dafang hack on my 1S as well, and I have to say it works pretty well. The preview on the admin portal is indeed about 1fps, but using it as a RTSP stream in for instance VLC or Zoneminder, it will give you 25fps, depending on the resolution you set. Almost all 1S's have just 64Mb of mem, which only allows for 720P to be stable. I have no idea how 1080p works in the stock firmware, since I do not live in Asia and I have not been able to successfully bypass the region lock on that firmware.

Re: Xiaomi Xiaofang 1S, not connecting to wifi

Posted: Saturday 25 August 2018 22:02
by hoeby
I want to use the camera in my own designed dashboard which is HTML based.
That's why i am not looking for the RTSP stream.

Found the settings in index.html.js, the image ID is refreshed to 30fps
Only need to figger out how to refresh the ID in de browser (automatic).
I have some thoughed, but that is for tomorrow