iot_water_monitor_v2

Dependencies:   easy-connect-v16 Watchdog FP MQTTPacket RecordType-v-16 watersenor_and_temp_code

Committer:
DuyLionTran
Date:
Tue Apr 03 17:03:01 2018 +0000
Revision:
57:898fcb6692cd
Parent:
55:c405323f8d5a
;   * version 2.9.8  	03-04-2018  Minor changes. Time frame updated to IBM Watson every 60s

Who changed what in which revision?

UserRevisionLine numberNew contents of line
DuyLionTran 43:dcde0e66874a 1 # PACKET JSON DETAILS
DuyLionTran 43:dcde0e66874a 2
DuyLionTran 43:dcde0e66874a 3 1/ SYSTEM TO SERVER
DuyLionTran 43:dcde0e66874a 4
DuyLionTran 43:dcde0e66874a 5 {"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
DuyLionTran 43:dcde0e66874a 6
DuyLionTran 43:dcde0e66874a 7 {"type":2,"deviceId": "string", "time":epoch, "cmdID":uint16_t, "temperature0":float, "oxygen0":float} //sensor values
DuyLionTran 43:dcde0e66874a 8 //map voi cai hien //map voi cai hien thi
DuyLionTran 43:dcde0e66874a 9 thi nhiet do DO
DuyLionTran 43:dcde0e66874a 10
DuyLionTran 43:dcde0e66874a 11 {"type":3,"deviceId": "string", "time":epoch, "cmdID":uint16_t,"relayState1":int 0 or 1, "relayState2":int 0 or 1} //relay state values
DuyLionTran 43:dcde0e66874a 12 //thoi gian thiet bi //Ngo ra 1 //Ngo ra 2
DuyLionTran 43:dcde0e66874a 13
DuyLionTran 43:dcde0e66874a 14 {"type":4, "deviceId": "string", "time":epoch, "cmdID":uint16_t,"mode":int 0 or 1,"OxygenThreshold":int ,"TemperatureThreshold":int, "uploadInterval":int} //config values
DuyLionTran 43:dcde0e66874a 15 0 for automatic //che do hoat dong //nguong tac dong DO //nguong tac dong nhiet do //tan suat lay du lieu
DuyLionTran 43:dcde0e66874a 16 1 for manual
DuyLionTran 43:dcde0e66874a 17
DuyLionTran 43:dcde0e66874a 18 cmdID should increase 1 if all 4 types are sent successfully
DuyLionTran 43:dcde0e66874a 19
DuyLionTran 43:dcde0e66874a 20
DuyLionTran 43:dcde0e66874a 21
DuyLionTran 43:dcde0e66874a 22 2/ SERVER TO SYSTEM
DuyLionTran 43:dcde0e66874a 23 //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
DuyLionTran 43:dcde0e66874a 24 all 4 commands 0 1 2 3
DuyLionTran 43:dcde0e66874a 25 (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)
DuyLionTran 43:dcde0e66874a 26
DuyLionTran 43:dcde0e66874a 27 {"type":0, "deviceId": "string", "cmdID":uint16_t} //Calib button
DuyLionTran 43:dcde0e66874a 28
DuyLionTran 43:dcde0e66874a 29 {"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
DuyLionTran 43:dcde0e66874a 30 //Cái này là tính nang hen gio bat tat relay,
DuyLionTran 43:dcde0e66874a 31 and Danh thêm vô giúp em dc ko ??
DuyLionTran 43:dcde0e66874a 32
DuyLionTran 43:dcde0e66874a 33 {"type":2, "deviceId": "string", "cmdID":uint16_t,"relayState1":int 0 or 1, "relayState2":int 0 or 1} //Ði?u khi?n relay nhu cu
DuyLionTran 43:dcde0e66874a 34
DuyLionTran 43:dcde0e66874a 35 {"type":3, "deviceId": "string", "cmdID":"uint16_t","mode":int 0 or 1,"OxygenThreshold":int,"TemperatureThreshold":int, "uploadInterval":int, "setRTCTime":epoch}
DuyLionTran 55:c405323f8d5a 36 1 for automatic //field cuoi là cài dat gio cho
DuyLionTran 55:c405323f8d5a 37 0 for manual //thiet bi
DuyLionTran 43:dcde0e66874a 38
DuyLionTran 43:dcde0e66874a 39 {"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
DuyLionTran 43:dcde0e66874a 40
DuyLionTran 43:dcde0e66874a 41 uint8_t CONFIG_Mode;
DuyLionTran 43:dcde0e66874a 42 uint8_t CONFIG_MinOxi;
DuyLionTran 43:dcde0e66874a 43 uint8_t CONFIG_MaxOxi;
DuyLionTran 43:dcde0e66874a 44 uint16_t CONFIG_UploadInterval;