yi-hack-MStar
yi-hack-MStar copied to clipboard
Changing WiFi SSID
Hi, I'm trying to connect the camera to the new router. When I go to wifi confirmation page on the top there is "loading..." and the list of SSID is empty.
Is there a way to provide new SSID and password for the wifi using SSH?
BR
Yes, you can use the configure_wifi.sh script.
Create a file /tmp/configure_wifi.cfg with this content:
# Don't use backslash char \
# Don't use double quote " around ssid and psk
# Space chars are allowed
wifi_ssid=My AP 2.4GHz
wifi_psk=password$
Change "My AP 2.4GHz" with your SSID and "password$" with your password. Run /home/yi-hack/script/configure_wifi.sh and reboot the cam.
I'm having the same problem. The ajax call returns but then the browser complains that the return value is not valid json. "SyntaxError: JSON.parse: bad control character in string literal at line 3 column 8 of the JSON data". It think line 3 column 8 is the 0x0A (line feed character). Perhaps something goes wrong in the script that returns that value?
if you change this line in /home/yi-hack/www/cgi-bin/wifi.sh
:
LIST=`$YI_HACK_PREFIX/bin/iwlist wlan0 scan | grep "ESSID:" | cut -d : -f 2,3,4,5,6,7,8 | grep -v -e '^$'`
to
LIST=`$YI_HACK_PREFIX/bin/iwlist wlan0 scan | grep "ESSID:" | cut -d : -f 2 | grep -v -e '^$'`
then the dropdown list gets populated.
Please, try this command:
LIST=`$YI_HACK_PREFIX/bin/iwlist wlan0 scan | grep "ESSID:" | sed 's/^[ \t]*ESSID://g' | grep -v -e '^$'`
Please, try this command:
LIST=`$YI_HACK_PREFIX/bin/iwlist wlan0 scan | grep "ESSID:" | sed 's/^[ \t]*ESSID://g' | grep -v -e '^$'`
Yes, in my setup that gives a LIST value identical to my suggestion. (Checked visually and also compared output with md5sum.)
Ok, I prefer this solution to avoid problems parsing the essid when it contains special chars.
Ok, I updated the pull request for your convenience. Thanks for all the excellent work in active development on this firmware!
Thank you for your pr.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.