当前位置: 首页 > news >正文

乐从网站建设公司软件开发定制

乐从网站建设公司,软件开发定制,心理健康网站建设论文,网站运营外包机智云,全球领先的智能硬件软件自助开发及物联网(iot)云服务平台。机智云平台为开发者提供了自助式智能硬件开发工具与开放的云端服务。通过傻瓜化的自助工具、完善的SDK与API服务能力最大限度降低了物联网硬件开发的技术门槛,降低开发者的研发成本,提升…

        机智云,全球领先的智能硬件软件自助开发及物联网(iot)云服务平台。机智云平台为开发者提供了自助式智能硬件开发工具与开放的云端服务。通过傻瓜化的自助工具、完善的SDK与API服务能力最大限度降低了物联网硬件开发的技术门槛,降低开发者的研发成本,提升开发者的产品投产速度,帮助开发者进行硬件智能化升级,更好的连接、服务最终消费者。使用机智云作为云平台可以轻松实现物联网功能。首先,我们需要注册并进入机智云官网。

一、进入开发者中心

        如图,这是我的机智云。

创建一个自定义产品,如下

添加好数据节点,如下,这是一个开关一个led灯:

复制密码,以备用

二、生成代码

1、选择MCU开发其他平台,输入密钥,生成代码包。

2、生成成功,下载到本地

3、移植代码

        将 Gizwits 和 Utils 一直到我们的工程中,如下图:

        

将它们添加进工程

修改 gizwits_product.c ,如下:

/**
************************************************************
* @file         gizwits_product.c
* @brief        Gizwits control protocol processing, and platform-related hardware initialization 
* @author       Gizwits
* @date         2017-07-19
* @version      V03030000
* @copyright    Gizwits
*
* @note         Gizwits is only for smart hardware
*               Gizwits Smart Cloud for Smart Products
*               Links | Value Added | Open | Neutral | Safety | Own | Free | Ecology
*               www.gizwits.com
*
***********************************************************/
#include <stdio.h>
#include <string.h>
#include "stm32f10x.h"                  // Device header
#include "gizwits_product.h"
#include "Serial3.h"
#include "LED.h"static uint32_t timerMsCount;/** Current datapoint */
dataPoint_t currentDataPoint;/**@} */
/**@name Gizwits User Interface
* @{
*//**
* @brief Event handling interface* Description:* 1. Users can customize the changes in WiFi module status* 2. Users can add data points in the function of event processing logic, such as calling the relevant hardware peripherals operating interface* @param [in] info: event queue
* @param [in] data: protocol data
* @param [in] len: protocol data length
* @return NULL
* @ref gizwits_protocol.h
*/
int8_t gizwitsEventProcess(eventInfo_t *info, uint8_t *gizdata, uint32_t len)
{uint8_t i = 0;dataPoint_t *dataPointPtr = (dataPoint_t *)gizdata;moduleStatusInfo_t *wifiData = (moduleStatusInfo_t *)gizdata;protocolTime_t *ptime = (protocolTime_t *)gizdata;#if MODULE_TYPEgprsInfo_t *gprsInfoData = (gprsInfo_t *)gizdata;
#elsemoduleInfo_t *ptModuleInfo = (moduleInfo_t *)gizdata;
#endifif((NULL == info) || (NULL == gizdata)){return -1;}for(i=0; i<info->num; i++){switch(info->event[i]){case EVENT_btn:currentDataPoint.valuebtn = dataPointPtr->valuebtn;GIZWITS_LOG("Evt: EVENT_btn %d \n", currentDataPoint.valuebtn);if(0x01 == currentDataPoint.valuebtn){//user handleLED1_ON();}else{//user handle LED1_OFF();				}break;case WIFI_SOFTAP:break;case WIFI_AIRLINK:break;case WIFI_STATION:break;case WIFI_CON_ROUTER:break;case WIFI_DISCON_ROUTER:break;case WIFI_CON_M2M:break;case WIFI_DISCON_M2M:break;case WIFI_RSSI:GIZWITS_LOG("RSSI %d\n", wifiData->rssi);break;case TRANSPARENT_DATA:GIZWITS_LOG("TRANSPARENT_DATA \n");//user handle , Fetch data from [data] , size is [len]break;case WIFI_NTP:GIZWITS_LOG("WIFI_NTP : [%d-%d-%d %02d:%02d:%02d][%d] \n",ptime->year,ptime->month,ptime->day,ptime->hour,ptime->minute,ptime->second,ptime->ntp);break;case MODULE_INFO:GIZWITS_LOG("MODULE INFO ...\n");
#if MODULE_TYPEGIZWITS_LOG("GPRS MODULE ...\n");//Format By gprsInfo_tGIZWITS_LOG("moduleType : [%d] \n",gprsInfoData->Type);
#elseGIZWITS_LOG("WIF MODULE ...\n");//Format By moduleInfo_tGIZWITS_LOG("moduleType : [%d] \n",ptModuleInfo->moduleType);
#endifbreak;default:break;}}return 0;
}/**
* Data point initialization function* In the function to complete the initial user-related data
* @param none
* @return none
* @note The developer can add a data point state initialization value within this function
*/
void userInit(void)
{memset((uint8_t*)&currentDataPoint, 0, sizeof(dataPoint_t));  currentDataPoint.valuebtn = 0;currentDataPoint.valuenum = 0;
}/**
* @brief  gizTimerMs* millisecond timer maintenance function ,Millisecond increment , Overflow to zero* @param none
* @return none
*/
void gizTimerMs(void)
{timerMsCount++;
}/**
* @brief gizGetTimerCount* Read system time, millisecond timer* @param none
* @return System time millisecond
*/
uint32_t gizGetTimerCount(void)
{return timerMsCount;
}/**
* @brief mcuRestart* MCU Reset function* @param none
* @return none
*/
void mcuRestart(void)
{__set_FAULTMASK(1);NVIC_SystemReset();//修改
}/**
* @brief uartWrite* Serial write operation, send data to the WiFi module* @param buf      : Data address
* @param len       : Data length
*
* @return : Not 0,Serial send success;
*           -1,Input Param Illegal
*/int32_t uartWrite(uint8_t *buf, uint32_t len)
{uint32_t i = 0;if(NULL == buf){return -1;}#ifdef PROTOCOL_DEBUGGIZWITS_LOG("MCU2WiFi[%4d:%4d]: ", gizGetTimerCount(), len);for(i=0; i<len; i++){GIZWITS_LOG("%02x ", buf[i]);}GIZWITS_LOG("\n");#endiffor(i=0; i<len; i++){//USART_SendData(UART, buf[i]);//STM32 test demo//Serial port to achieve the function, the buf[i] sent to the moduleUSART_SendData(USART3, buf[i]);while (USART_GetFlagStatus(USART3, USART_FLAG_TXE) == RESET);if(i >=2 && buf[i] == 0xFF){//Serial port to achieve the function, the 0x55 sent to the module//USART_SendData(UART, 0x55);//STM32 test demoUSART_SendData(USART3, 0x55);while (USART_GetFlagStatus(USART3, USART_FLAG_TXE) == RESET);}}return len;
}

        准备一个定时器程序,定时大约1ms,在定时器中断中调用 gizTimerMs(); 为机智云提供时钟。

void TIM2_IRQHandler()
{if(TIM_GetITStatus(TIM2,TIM_IT_Update) == SET){gizTimerMs(); //为机智云提供时钟TIM_ClearITPendingBit(TIM2,TIM_IT_Update);}
}

        准备一个UART连接ESP01,并在改UART的中断函数中调用 gizPutData(&value, 1); 函数,用于接受ESP01串口中断发来的数据。

void USART3_IRQHandler(void)                                          
{uint8_t value = 0;if(USART_GetITStatus(Serial3_UARTx, USART_IT_RXNE) != RESET){USART_ClearITPendingBit(Serial3_UARTx, USART_IT_RXNE);	value = USART_ReceiveData(USART3);	//读取接收到的数据gizPutData(&value, 1);	}
}

               同时配置好按键,在主函数中按键获取函数,并通过按键值选择调用联网和重新配置,如下图:

#include "stm32f10x.h"                  // Device header
#include "OLED.h"
#include "Timer.h"
#include "gizwits_product.h" 
#include "Serial.h" 
#include "Serial3.h" 
#include "LED.h" 
#include "Key.h" 
#include "Delay.h" extern dataPoint_t currentDataPoint;//协议初始化
void Gizwits_Init(void)
{Timer_Init();//1msSerial_Init();Serial3_Init();//gizPutData((uint8_t *)&aRxBuffer,1);userInit();//用户信息初始化,目前只是把结构体信息复位gizwitsInit();//机智云的初始化printf("gizwitsInit智能云初始化\r\n");
}//数据采集
void userHandle(void)
{currentDataPoint.valuenum = 50;
}int main()
{uint8_t keyNum=0;LED_Init();Key_Init();Gizwits_Init();while(1){keyNum = Key_GetNum();if(keyNum==1)//按键1按下{printf("WIFI进入AirLink连接模式\r\n");gizwitsSetMode(WIFI_AIRLINK_MODE);//Air-link模式接入}			if(keyNum==2)//按键2按下99{  printf("WIFI复位,请重新配置连接\r\n");gizwitsSetMode(WIFI_RESET_MODE);//WIFI复位}userHandle();//数据上行gizwitsHandle((dataPoint_t *)&currentDataPoint);}	
}	

        至此,STM32代码移植已经完毕

三、ESP01烧入机智云固件

1、进入机智云固件下载地址,下载如下固件,地址如下

Gizwits

2、本次使用STM32F103C8T6,于是选择8M带combine的

3、打开 flash_download_tool,进行固件下载,如图:

四、APP配置机智云

1、按下按键1,进入配网模式,注意网络wifi网关不能是5GHZ的频段,建议2.4GHz,如图:

2、 点击机智云app左上角的加号,选择Airlink,输入我们的wifi名和密码,点击下一步:

        选择乐鑫,然后下一步。

最后等待连接成功即可:

3、连接成功,APP出现一个叫做测试的设备,如下:

五、测试功能

1、显示测试数50,本次采用固定数字测试数字上传情况,代码如下

//数据采集
void userHandle(void)
{currentDataPoint.valuenum = 50;
}

2、按键开关灯

按下开,此时led会亮起,如下:

再次按下,led会关闭,如下:


文章转载自:
http://exodontist.cwgn.cn
http://irreconcilable.cwgn.cn
http://oscillogram.cwgn.cn
http://arillate.cwgn.cn
http://lepidopterological.cwgn.cn
http://nectary.cwgn.cn
http://seaport.cwgn.cn
http://exchangite.cwgn.cn
http://photodissociation.cwgn.cn
http://sinaitic.cwgn.cn
http://recusal.cwgn.cn
http://sprawl.cwgn.cn
http://hypoalonemia.cwgn.cn
http://frondeur.cwgn.cn
http://relating.cwgn.cn
http://gangetic.cwgn.cn
http://conto.cwgn.cn
http://octaploid.cwgn.cn
http://peritonaeum.cwgn.cn
http://transsexual.cwgn.cn
http://bonanza.cwgn.cn
http://subcrust.cwgn.cn
http://objectivity.cwgn.cn
http://paca.cwgn.cn
http://underwork.cwgn.cn
http://pise.cwgn.cn
http://sarpedon.cwgn.cn
http://sansei.cwgn.cn
http://desalinate.cwgn.cn
http://bilobate.cwgn.cn
http://clothe.cwgn.cn
http://regarding.cwgn.cn
http://theophany.cwgn.cn
http://satellize.cwgn.cn
http://ecbatic.cwgn.cn
http://predominate.cwgn.cn
http://mandinka.cwgn.cn
http://sideman.cwgn.cn
http://landsting.cwgn.cn
http://meacock.cwgn.cn
http://paravail.cwgn.cn
http://encampment.cwgn.cn
http://sepal.cwgn.cn
http://preternatural.cwgn.cn
http://look.cwgn.cn
http://somersault.cwgn.cn
http://flinty.cwgn.cn
http://laddish.cwgn.cn
http://waybread.cwgn.cn
http://armangite.cwgn.cn
http://dhaka.cwgn.cn
http://gametocyte.cwgn.cn
http://fractionalize.cwgn.cn
http://biodynamic.cwgn.cn
http://raised.cwgn.cn
http://intuitionalist.cwgn.cn
http://russonorsk.cwgn.cn
http://psammophilous.cwgn.cn
http://metamer.cwgn.cn
http://disarrangement.cwgn.cn
http://hydroextractor.cwgn.cn
http://vulvovaginitis.cwgn.cn
http://hydrocracker.cwgn.cn
http://topochemistry.cwgn.cn
http://peperino.cwgn.cn
http://apocope.cwgn.cn
http://stagy.cwgn.cn
http://cohoe.cwgn.cn
http://gerundial.cwgn.cn
http://gastral.cwgn.cn
http://overplease.cwgn.cn
http://undro.cwgn.cn
http://copyboy.cwgn.cn
http://mulligrubs.cwgn.cn
http://subsequence.cwgn.cn
http://quarreler.cwgn.cn
http://miraculous.cwgn.cn
http://awkwardly.cwgn.cn
http://colicky.cwgn.cn
http://dredging.cwgn.cn
http://mannish.cwgn.cn
http://webernish.cwgn.cn
http://provolone.cwgn.cn
http://lateralization.cwgn.cn
http://lichenin.cwgn.cn
http://batum.cwgn.cn
http://pleiotaxy.cwgn.cn
http://maisonnette.cwgn.cn
http://conmanship.cwgn.cn
http://hypoderma.cwgn.cn
http://sagina.cwgn.cn
http://cabbies.cwgn.cn
http://socinianism.cwgn.cn
http://campion.cwgn.cn
http://wicker.cwgn.cn
http://fiduciary.cwgn.cn
http://flipping.cwgn.cn
http://socinianism.cwgn.cn
http://bibliopoly.cwgn.cn
http://atonic.cwgn.cn
http://www.hrbkazy.com/news/64153.html

相关文章:

  • 网站建设协调机制郑州seo排名优化
  • 关于化妆品的网页设计seo推广效果
  • 做业精灵官方网站网站seo关键词排名
  • app在线客服系统惠州seo招聘
  • 做外贸网站租什么服务器关键词排名批量查询软件
  • wordpress防止ddos插件seo的方式包括
  • 有什么好的网站查做外贸出口的企业公司网站免费建站
  • 昆明网站建设电话网络广告图片
  • 税务网站建设管理指导思想googleseo推广
  • 网站建设群标签好写什么百度快照是什么意思?
  • 做商业网站是否要备案市场监督管理局官网
  • 网站设计排版怎么做百度指数批量查询
  • 去哪儿网站排名怎么做西安百度竞价托管公司
  • 推广优化公司网站百度经验app下载
  • 做网络兼职的网站百度打广告怎么收费
  • 一般给公司做网站用什么软件视频互联网推广选择隐迅推
  • 温州制作网站友情链接交换平台有哪些
  • 公司做网站要多少钱重庆优化seo
  • 北京设计制作公司百度seo排名优化系统
  • 关于外贸的网站百度关键词排名怎么做
  • 超炫网站模板国际重大新闻事件2023
  • 杭州网站建设宣盟网络国内seo做最好的公司
  • 有没有网站做设计可以赚钱化妆品推广软文
  • 冀州区疫情哈尔滨关键词优化方式
  • asp动态网站被攻击员工培训
  • 番禺微网站建设国家职业技能培训平台
  • WordPress博客Modown模板南昌seo实用技巧
  • 西安360免费做网站做网站seo怎么赚钱
  • 咸宁做网站网络培训心得
  • 动易网站无法安装西昌seo快速排名