Loading sdk/build/miphoto/SendToRTOS_recount.sh 0 → 100755 +17 −0 Original line number Diff line number Diff line #!/bin/sh set -e output=$(wpa_cli all_sta 2>/dev/null) count=$(echo $output | grep -E "^..:..:..:..:..:.." | wc -l) echo connected devices: $count echo SendToRTOS net_ready 0 echo net_ready $? for i in $(seq $counter); do SendToRTOS wifi_connected echo wifi_connected $? done return 0 sdk/build/miphoto/miphoto-exec +1.02 KiB (9.39 MiB) File changed.No diff preview for this file type. View original file View changed file sdk/build/miphoto/www/index.html +3 −3 Original line number Diff line number Diff line Loading @@ -146,15 +146,15 @@ </table></td> <tbody></table> <!--<table id="wsFormTable2"> <table id="wsFormTable2"> <tr> <td><label for="checkboxWifiOff">Turn off Wifi when shooting<br> timelapse above 1 minute</label></td> <td><label class="switch"> <td style="padding-left: 15px;"><label class="switch"> <input id="checkboxWifiOff" type="checkbox" name="wifiOff" disabled><span class="slider"></span> </label> </td> </tr> </table>--> </table> <button type="button" id="buttonShoot" onclick="wsFormSubmit();" name="cmd" value="SHOOT" disabled>Shoot!</button> </form> Loading sdk/build/miphoto/www/script.js +22 −9 Original line number Diff line number Diff line Loading @@ -26,6 +26,18 @@ function waitFor(conditionFunction) { return new Promise(poll); } function getDateTime() { var date = new Date(); return date.getFullYear() +'-'+ ('0' + (date.getMonth()+1)).slice(-2) +'-'+ ('0' + date.getDate()).slice(-2) +'-'+ ('0' + date.getHours()).slice(-2) +'-'+ ('0' + date.getMinutes()).slice(-2) +'-'+ ('0' + date.getSeconds()).slice(-2) +'-'+ (date.getDay()+1); //sunday=1, monday=2 ... } Loading Loading @@ -152,6 +164,7 @@ function setState(newState) //DISCONNECTED -> READY case State.DISCONNECTED: notify("Connected!", false, 1000); ws.send('{"cmd":"RTC_SYNC","param":"' + getDateTime() + '"}'); break; //SHOOTING -> READY Loading Loading @@ -182,9 +195,9 @@ function setState(newState) function wsDisconnect() { /*if (document.getElementById("checkboxWifiOff").checked) if (document.getElementById("checkboxWifiOff").checked) ws.send('{"cmd":"WIFI_OFF"}'); document.getElementById("checkboxWifiOff").disabled = true;*/ document.getElementById("checkboxWifiOff").disabled = true; ws.close(1000, "disconnected by user"); connected = false; Loading Loading @@ -223,8 +236,8 @@ function wsFormSubmit() function turnOffAppClick() { /*if (document.getElementById("checkboxWifiOff").checked) ws.send('{"cmd":"WIFI_OFF"}');*/ if (document.getElementById("checkboxWifiOff").checked) ws.send('{"cmd":"WIFI_OFF"}'); ws.send('{"cmd":"APP_OFF"}'); wsDisconnect(); } Loading Loading @@ -295,14 +308,14 @@ function wsFormToJson() { { json["timelapseCount"] = 0; json["timelapseInterval"] = 0; //json["wifiOff"] = false; json["wifiOff"] = false; } /*else else { if (json["timelapseInterval"] * json["timelapseCount"] < 60) if (json["timelapseInterval"] * (json["timelapseCount"]-1) < 60) json["wifiOff"] = false; }*/ } delete json[""] return json; Loading sdk/src/codes.h +4 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,9 @@ public: { GetToken = 257, DropToken = 258, QuerySessionHolder = 1793, GetWifiStatus = 1542, WifiStart = 1541, WifiStop = 1540, Loading @@ -36,8 +38,8 @@ public: GetCameraSettings = 4364, GetCameraState = 4362, SyncRTC = 6147, QuerySessionHolder = 1793, PowerOff = 6155, GetSetAutoPowerOff = 6151, Loading Loading
sdk/build/miphoto/SendToRTOS_recount.sh 0 → 100755 +17 −0 Original line number Diff line number Diff line #!/bin/sh set -e output=$(wpa_cli all_sta 2>/dev/null) count=$(echo $output | grep -E "^..:..:..:..:..:.." | wc -l) echo connected devices: $count echo SendToRTOS net_ready 0 echo net_ready $? for i in $(seq $counter); do SendToRTOS wifi_connected echo wifi_connected $? done return 0
sdk/build/miphoto/miphoto-exec +1.02 KiB (9.39 MiB) File changed.No diff preview for this file type. View original file View changed file
sdk/build/miphoto/www/index.html +3 −3 Original line number Diff line number Diff line Loading @@ -146,15 +146,15 @@ </table></td> <tbody></table> <!--<table id="wsFormTable2"> <table id="wsFormTable2"> <tr> <td><label for="checkboxWifiOff">Turn off Wifi when shooting<br> timelapse above 1 minute</label></td> <td><label class="switch"> <td style="padding-left: 15px;"><label class="switch"> <input id="checkboxWifiOff" type="checkbox" name="wifiOff" disabled><span class="slider"></span> </label> </td> </tr> </table>--> </table> <button type="button" id="buttonShoot" onclick="wsFormSubmit();" name="cmd" value="SHOOT" disabled>Shoot!</button> </form> Loading
sdk/build/miphoto/www/script.js +22 −9 Original line number Diff line number Diff line Loading @@ -26,6 +26,18 @@ function waitFor(conditionFunction) { return new Promise(poll); } function getDateTime() { var date = new Date(); return date.getFullYear() +'-'+ ('0' + (date.getMonth()+1)).slice(-2) +'-'+ ('0' + date.getDate()).slice(-2) +'-'+ ('0' + date.getHours()).slice(-2) +'-'+ ('0' + date.getMinutes()).slice(-2) +'-'+ ('0' + date.getSeconds()).slice(-2) +'-'+ (date.getDay()+1); //sunday=1, monday=2 ... } Loading Loading @@ -152,6 +164,7 @@ function setState(newState) //DISCONNECTED -> READY case State.DISCONNECTED: notify("Connected!", false, 1000); ws.send('{"cmd":"RTC_SYNC","param":"' + getDateTime() + '"}'); break; //SHOOTING -> READY Loading Loading @@ -182,9 +195,9 @@ function setState(newState) function wsDisconnect() { /*if (document.getElementById("checkboxWifiOff").checked) if (document.getElementById("checkboxWifiOff").checked) ws.send('{"cmd":"WIFI_OFF"}'); document.getElementById("checkboxWifiOff").disabled = true;*/ document.getElementById("checkboxWifiOff").disabled = true; ws.close(1000, "disconnected by user"); connected = false; Loading Loading @@ -223,8 +236,8 @@ function wsFormSubmit() function turnOffAppClick() { /*if (document.getElementById("checkboxWifiOff").checked) ws.send('{"cmd":"WIFI_OFF"}');*/ if (document.getElementById("checkboxWifiOff").checked) ws.send('{"cmd":"WIFI_OFF"}'); ws.send('{"cmd":"APP_OFF"}'); wsDisconnect(); } Loading Loading @@ -295,14 +308,14 @@ function wsFormToJson() { { json["timelapseCount"] = 0; json["timelapseInterval"] = 0; //json["wifiOff"] = false; json["wifiOff"] = false; } /*else else { if (json["timelapseInterval"] * json["timelapseCount"] < 60) if (json["timelapseInterval"] * (json["timelapseCount"]-1) < 60) json["wifiOff"] = false; }*/ } delete json[""] return json; Loading
sdk/src/codes.h +4 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,9 @@ public: { GetToken = 257, DropToken = 258, QuerySessionHolder = 1793, GetWifiStatus = 1542, WifiStart = 1541, WifiStop = 1540, Loading @@ -36,8 +38,8 @@ public: GetCameraSettings = 4364, GetCameraState = 4362, SyncRTC = 6147, QuerySessionHolder = 1793, PowerOff = 6155, GetSetAutoPowerOff = 6151, Loading