MORENBUOU 发表于 2020-4-20 22:56:04

mega2560和nodemcu问题

/**
****************************************
* @file         Gizwits + ArduinoUnoR3 Library
* @brief      Datapoints handle , Gizwits Process
* @author       Gizwits
* @date         2017-08-01
* @version      V03030000
* @copyright    Gizwits
*
* @note         机智云.只为智能硬件而生
*               Gizwits Smart Cloudfor 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 initOK \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();
}数据上传失败,服务器显示设备在线了,但是一直无法收到数据

MORENBUOU 发表于 2020-4-20 22:57:15

用的代码是mcu生成unor3的simpleTry代码

木几知曰云 发表于 2021-5-4 16:24:14

请问楼主解决了吗?我这里连接机智云接不上。和你一样的硬件。解决了能指点下吗
页: [1]
查看完整版本: mega2560和nodemcu问题