iot_water_monitor_v2
Dependencies: easy-connect-v16 Watchdog FP MQTTPacket RecordType-v-16 watersenor_and_temp_code
Diff: jsonString.md
- Revision:
- 43:dcde0e66874a
- Parent:
- 40:4356c209c58d
- Child:
- 55:c405323f8d5a
diff -r 3656e1b2f20a -r dcde0e66874a jsonString.md --- a/jsonString.md Sun Mar 04 07:58:23 2018 +0000 +++ b/jsonString.md Thu Mar 08 13:13:53 2018 +0000 @@ -1,1 +1,44 @@ -# PACKET JSON DETAILS \ No newline at end of file +# PACKET JSON DETAILS + +1/ SYSTEM TO SERVER + +{"type":1, "deviceId": "string", "cmdID":uint16_t,"adc0":uint16_t,"adc1":uint16_t,"adc2":uint16_t,"adc3":uint16_t} //no need to display this one + +{"type":2,"deviceId": "string", "time":epoch, "cmdID":uint16_t, "temperature0":float, "oxygen0":float} //sensor values + //map voi cai hien //map voi cai hien thi + thi nhiet do DO + +{"type":3,"deviceId": "string", "time":epoch, "cmdID":uint16_t,"relayState1":int 0 or 1, "relayState2":int 0 or 1} //relay state values + //thoi gian thiet bi //Ngo ra 1 //Ngo ra 2 + +{"type":4, "deviceId": "string", "time":epoch, "cmdID":uint16_t,"mode":int 0 or 1,"OxygenThreshold":int ,"TemperatureThreshold":int, "uploadInterval":int} //config values + 0 for automatic //che do hoat dong //nguong tac dong DO //nguong tac dong nhiet do //tan suat lay du lieu + 1 for manual + +cmdID should increase 1 if all 4 types are sent successfully + + + +2/ SERVER TO SYSTEM +//send one command when pressing one button. For example when there 4 buttons with 4 different commands, pressing button A will send command 0, not sending +all 4 commands 0 1 2 3 +(y em la moi nut nhan chi gui 1 command thoi dc ko anh? gui het 4 comman 1 luc de bi loi lam a) + +{"type":0, "deviceId": "string", "cmdID":uint16_t} //Calib button + +{"type":1, "deviceId": "string", "cmdID":uint16_t, "AlarmTime":epoch, "SetRelayState1":int 0 or 1, "SetRelayState2":int 0 or 1} //Set time to turn on//off the relay + //Cái này là tính nang hen gio bat tat relay, + and Danh thêm vô giúp em dc ko ?? + +{"type":2, "deviceId": "string", "cmdID":uint16_t,"relayState1":int 0 or 1, "relayState2":int 0 or 1} //Ði?u khi?n relay nhu cu + +{"type":3, "deviceId": "string", "cmdID":"uint16_t","mode":int 0 or 1,"OxygenThreshold":int,"TemperatureThreshold":int, "uploadInterval":int, "setRTCTime":epoch} + 0 for automatic //field cuoi là cài dat gio cho + 1 for manual //thiet bi + +{"type":4, "deviceId": "string", "cmdID":uint16_t} //Cái này là nút synchronize, nh?n vô phát là c?p nh?t h?t giá tr? c?m bi?n + + uint8_t CONFIG_Mode; + uint8_t CONFIG_MinOxi; + uint8_t CONFIG_MaxOxi; + uint16_t CONFIG_UploadInterval; \ No newline at end of file