|
- /**
- ****************************************
- * @file Gizwits + arduinoUnoR3 Library
- * @brief Datapoints handle , Gizwits Process
- * @author Gizwits
- * @date 2017-08-01
- * @version V03030000
- * @copyright Gizwits
- *
- * @note 机智云.只为智能硬件而生
- * Gizwits Smart Cloud for Smart Products
- * 链接|增值ֵ|开放|中立|安全|自有|自由|生态
- * www.gizwits.com
- *
- ****************************************/
- #include "Gizwits.h"
- //#include <Wire.h>
- #include <SoftwareSerial.h>
- //#include"gizwits_product.h"
- //#include"gizwits_protocol.h"
- //#include<dataPointTools.h>
- //SoftwareSerial mySerial(18, 19); // A2 -> RX, A3 -> TX
- Gizwits myGizwits;
- //Wifi配网
- void wifiStatusHandle()
- {
- if(myGizwits.wifiHasBeenSet(WIFI_CON_ROUTER)){}
- }
- /**
- * Serial Init , Gizwits Init
- * @param none
- * @return none
- */
- void setup() {
- // put your setup code here, to run once:
- mySerial.begin(115200);
- //Serial.begin(9600);
- myGizwits.begin();
- //Serial.println("gokit init OK \n");
- }
- /**
- * Arduino loop
- * @param none
- * @return none
- */
- float varW_temp = 0;//Add Sensor Data Collection
- void loop() {
-
- //Configure network
- //if(XXX) //Trigger Condition
- //myGizwits.setBindMode(0x02); //0x01:Enter AP Mode;0x02:Enter Airlink Mode
-
-
- myGizwits.write(VALUE_temp, varW_temp);
- float varW_shidu = 50;//Add Sensor Data Collection
- myGizwits.write(VALUE_shidu, varW_shidu);
-
- varW_temp+=1;
- //delay(500);
- //Serial.println(varW_temp);
-
- if(varW_temp>30){
- varW_temp=0;
- }
-
- unsigned long varR_xinlv = 0;
- if(myGizwits.hasBeenSet(EVENT_xinlv))
- {
- myGizwits.read(EVENT_xinlv,&varR_xinlv);//Address for storing data
- //Serial.println(F("EVENT_xinlv"));
- //Serial.println(varR_xinlv,DEC);
-
- }
- //binary datapoint handle
-
- wifiStatusHandle();
- myGizwits.process();
- }
复制代码 数据上传失败,服务器显示设备在线了,但是一直无法收到数据
|
|