|
|
3 | | # start ap (last 30 minites) | | 3 | | # start ap (keep 30 minites for release, keep 5 min for debug) |
4 | | # version 0.0.3 | | 4 | | # version 0.0.4 |
|
|
|
2 skipped lines |
|
|
|
| | 13 | | CHANNEL=6 |
|
14 | | 15 | | LOG_FILE=/data/log/wifi.log |
|
|
15 skipped lines |
|
|
|
| | 35 | | # wifi light flash slowly in ap mode |
| | 36 | | if [ "$NEW_LIGHT_DISPLAY" == "yes" ]; then |
| | 37 | | set_wifi_light.sh flash |
| | 38 | | else |
| | 39 | | set_wifi_light.sh flash_slow |
| | 40 | | fi |
| | 41 | | avacmd clb '{"type":"clb","cmd":"report_network_connect_mode","mode":0}' & |
34 | | wifi_setup.sh ap | | 42 | | CHANNEL="${CHANNEL}" wifi_setup.sh ap |
35 | | 43 | | # we should start ble after wifi-ap |
|
|
37 | | 45 | | # +++ We should empty IOT_FLAG before restart iot_sdk, this will make sure all iot sdk will be start. |
|
19 skipped lines |
|
58 | | 66 | | echo `date` "start station mode" >> ${LOG_FILE} |
|
59 | | 67 | | rm -f ${AP_FLAG} && sync |
|
| | 68 | | # wifi flash_fastlight flash fast in ap mode |
| | 69 | | if [ "$NEW_LIGHT_DISPLAY" == "yes" ]; then |
| | 70 | | set_wifi_light.sh flash |
| | 71 | | else |
| | 72 | | set_wifi_light.sh flash_fast |
| | 73 | | fi |
60 | | 74 | | wifi_setup.sh sta 20 |
|
61 | | 75 | | echo -n "INIT" > ${CONFIGNET_FLAG} |
|
62 | | 76 | | elif [[ _"${RET}" == _"AP" ]] |
|
4 skipped lines |
67 | | 81 | | elif [[ _"${RET}" != _"INIT" ]] |
|
|
69 | | 83 | | echo `date` "get ret=\"${RET}\"" >> ${LOG_FILE} |
|
70 | | echo -n "INIT" > ${CONFIGNET_FLAG} | | |
|
|
|
3 skipped lines |
|
78 | | 91 | | if [ ${cnt} -ge ${MAX_TIMES} ] |
|
|
| | 93 | | if [ "$NEW_LIGHT_DISPLAY" == "yes" ]; then |
| | 94 | | set_wifi_light.sh state_off |
| | 95 | | avacmd clb '{"type":"clb","cmd":"report_network_connect_mode","mode":6}' & |
| | 96 | | else |
80 | | set_wifi_light.sh flash_slow | | 97 | | set_wifi_light.sh flash_slow |
81 | | avacmd clb '{"type":"clb", "cmd":"report_network_connect_mode", "mode":1}' | | 98 | | avacmd clb '{"type":"clb","cmd":"report_network_connect_mode","mode":1}' & |
| | 99 | | fi |
|
83 | | 101 | | rm -f ${AP_FLAG} && sync |
|
|
16 skipped lines |
|
|
|
| | 122 | | if [ "$1" == "short_time" ]; then |
| | 123 | | MAX_TIMES=150 |
| | 124 | | CHANNEL=$(($RANDOM % 11)) |
| | 125 | | let CHANNEL++ |
| | 126 | | log "set ap keep_time=5min, channel=$CHANNEL" |
| | 127 | | fi |
| | 128 | | |
|
|