Merge pull request #281 from Mculover666/master

improve at firmware
This commit is contained in:
Supowang
2021-01-26 14:46:27 +08:00
committed by GitHub
15 changed files with 497 additions and 537 deletions

View File

@@ -699,7 +699,7 @@
<Group>
<GroupName>tos/kernel</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>

View File

@@ -4,17 +4,17 @@
#include "esp8266.h"
#include "mqttclient.h"
//#define USE_ESP8266
#define USE_ESP8266
//#define USE_NB_BC35
#define USE_NB_BC35
#ifdef USE_ESP8266
static hal_uart_port_t esp8266_port = HAL_UART_PORT_0;
void mqtt_set_esp8266_port(hal_uart_port_t port) {
esp8266_port = port;
}
#endif
/* Tencent IoThub Device Info */
#define IOTHUB_MQTT_IP "111.230.189.156"
#define IOTHUB_MQTT_PORT "1883"
#define IOTHUB_MQTT_CLIENT_ID "KHHIXM0JJ5dev001"
#define IOTHUB_MQTT_USERNAME "KHHIXM0JJ5dev001;12010126;9K3WO;1647628324"
#define IOTHUB_MQTT_PASSWD "53696f22a061ed2524b1de185815ad2fcae7739afd3f395cb6131521da7f0bb7;hmacsha256"
#define IOTHUB_MQTT_PUB_TOPIC "KHHIXM0JJ5/dev001/data"
#define IOTHUB_MQTT_SUB_TOPIC "KHHIXM0JJ5/dev001/control"
static void tos_topic_handler(void* client, message_data_t* msg)
{
@@ -39,8 +39,8 @@ void mqttclient_task(void)
memset(&msg, 0, sizeof(msg));
#ifdef USE_ESP8266
esp8266_sal_init(esp8266_port);
esp8266_join_ap("Supowang", "13975428888");
esp8266_sal_init(HAL_UART_PORT_0);
esp8266_join_ap("Mculover666", "mculover666");
#endif
#ifdef USE_NB_BC35
@@ -52,18 +52,18 @@ void mqttclient_task(void)
client = mqtt_lease();
mqtt_set_port(client, "1883");
mqtt_set_host(client, "111.230.189.156");
mqtt_set_client_id(client, "RUAP1R610Vsupowang");
mqtt_set_user_name(client, "RUAP1R610Vsupowang;12010126;80LJ2;1621294860");
mqtt_set_password(client, "2e90a9f1e604f2f0473355228c3d59276951aa8e6ed4d27f270f05ee8a4d0983;hmacsha256");
mqtt_set_port(client, IOTHUB_MQTT_PORT);
mqtt_set_host(client, IOTHUB_MQTT_IP);
mqtt_set_client_id(client, IOTHUB_MQTT_CLIENT_ID);
mqtt_set_user_name(client, IOTHUB_MQTT_USERNAME);
mqtt_set_password(client, IOTHUB_MQTT_PASSWD);
mqtt_set_clean_session(client, 1);
error = mqtt_connect(client);
MQTT_LOG_D("mqtt connect error is %#x", error);
mqtt_subscribe(client, "RUAP1R610V/supowang/data", QOS0, tos_topic_handler);
mqtt_subscribe(client, IOTHUB_MQTT_SUB_TOPIC, QOS0, tos_topic_handler);
MQTT_LOG_D("mqtt subscribe error is %#x", error);
@@ -76,7 +76,7 @@ void mqttclient_task(void)
msg.qos = QOS0;
msg.payload = (void *) buf;
error = mqtt_publish(client, "RUAP1R610V/supowang/data", &msg);
error = mqtt_publish(client, IOTHUB_MQTT_PUB_TOPIC, &msg);
tos_task_delay(4000);
}

View File

@@ -410,7 +410,7 @@
<Group>
<GroupName>examples</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>

View File

@@ -10,14 +10,14 @@
<TargetName>TencentOS_tiny</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>STM32L431RCTx</Device>
<Vendor>STMicroelectronics</Vendor>
<PackID>Keil.STM32L4xx_DFP.2.2.0</PackID>
<PackURL>http://www.keil.com/pack</PackURL>
<PackID>Keil.STM32L4xx_DFP.2.3.0</PackID>
<PackURL>https://www.keil.com/pack/</PackURL>
<Cpu>IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>
@@ -185,6 +185,7 @@
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@@ -351,7 +352,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>0</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@@ -1024,4 +1025,19 @@
<files/>
</RTE>
<LayerInfo>
<Layers>
<Layer>
<LayName>&lt;Project Info&gt;</LayName>
<LayDesc></LayDesc>
<LayUrl></LayUrl>
<LayKeys></LayKeys>
<LayCat></LayCat>
<LayLic></LayLic>
<LayTarg>0</LayTarg>
<LayPrjMark>1</LayPrjMark>
</Layer>
</Layers>
</LayerInfo>
</Project>

View File

@@ -148,40 +148,7 @@
<Name>-U303030303030303030303031 -O10446 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_256.FLM -FS08000000 -FL040000 -FP0($$Device:STM32L431RCTx$CMSIS\Flash\STM32L4xx_256.FLM)</Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint>
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>69</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134234708</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>..\..\..\..\examples\tcp_through_module\tcp_through_module.c</Filename>
<ExecCommand></ExecCommand>
<Expression>\\TencentOS_tiny\../../../../examples/tcp_through_module/tcp_through_module.c\69</Expression>
</Bp>
<Bp>
<Number>1</Number>
<Type>0</Type>
<LineNumber>66</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>..\..\..\..\examples\tcp_through_module\tcp_through_module.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
</Breakpoint>
<Breakpoint/>
<WatchWindow1>
<Ww>
<count>0</count>
@@ -303,7 +270,7 @@
<Group>
<GroupName>Application/User</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@@ -1203,7 +1170,7 @@
<Group>
<GroupName>at</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@@ -1223,7 +1190,7 @@
<Group>
<GroupName>devices</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@@ -1239,17 +1206,65 @@
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>12</GroupNumber>
<FileNumber>73</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\devices\ec200s\ec200s.c</PathWithFileName>
<FilenameWithoutPath>ec200s.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>12</GroupNumber>
<FileNumber>74</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\devices\ec20\ec20.c</PathWithFileName>
<FilenameWithoutPath>ec20.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>12</GroupNumber>
<FileNumber>75</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\devices\air724\air724.c</PathWithFileName>
<FilenameWithoutPath>air724.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>12</GroupNumber>
<FileNumber>76</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\devices\l610\l610.c</PathWithFileName>
<FilenameWithoutPath>l610.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>sal_module_wrapper</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>13</GroupNumber>
<FileNumber>73</FileNumber>
<FileNumber>77</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -1269,7 +1284,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>14</GroupNumber>
<FileNumber>74</FileNumber>
<FileNumber>78</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>

View File

@@ -16,8 +16,8 @@
<TargetCommonOption>
<Device>STM32L431RCTx</Device>
<Vendor>STMicroelectronics</Vendor>
<PackID>Keil.STM32L4xx_DFP.2.4.0</PackID>
<PackURL>http://www.keil.com/pack/</PackURL>
<PackID>Keil.STM32L4xx_DFP.2.3.0</PackID>
<PackURL>https://www.keil.com/pack/</PackURL>
<Cpu>IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>
@@ -339,7 +339,7 @@
<MiscControls></MiscControls>
<Define>USE_HAL_DRIVER,STM32L431xx,WITH_TOS_NET_ADAPTER</Define>
<Undefine></Undefine>
<IncludePath>..\..\BSP\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Legacy;..\..\..\..\platform\vendor_bsp\st\CMSIS\Device\ST\STM32L4xx\Include;..\..\..\..\platform\vendor_bsp\st\CMSIS\Include;..\..\..\..\kernel\core\include;..\..\TOS-CONFIG;..\..\..\..\platform\arch\arm\cortex-m4\keil;..\..\..\..\kernel\pm\include;..\..\..\..\osal\cmsis_os;..\..\..\..\arch\arm\arm-v7m\common\include;..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc;..\..\BSP\Hardware\DHT11;..\..\BSP\Hardware\OLED;..\..\BSP\Hardware\BH1750;..\..\..\..\devices\esp8266;..\..\..\..\net\at\include;..\..\..\..\kernel\hal\include;..\..\..\..\net\sal_module_wrapper;..\..\..\..\devices\ec20</IncludePath>
<IncludePath>..\..\BSP\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Legacy;..\..\..\..\platform\vendor_bsp\st\CMSIS\Device\ST\STM32L4xx\Include;..\..\..\..\platform\vendor_bsp\st\CMSIS\Include;..\..\..\..\kernel\core\include;..\..\TOS-CONFIG;..\..\..\..\platform\arch\arm\cortex-m4\keil;..\..\..\..\kernel\pm\include;..\..\..\..\osal\cmsis_os;..\..\..\..\arch\arm\arm-v7m\common\include;..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc;..\..\BSP\Hardware\DHT11;..\..\BSP\Hardware\OLED;..\..\BSP\Hardware\BH1750;..\..\..\..\devices\esp8266;..\..\..\..\net\at\include;..\..\..\..\kernel\hal\include;..\..\..\..\net\sal_module_wrapper;..\..\..\..\devices\ec20;..\..\..\..\devices\ec200s;..\..\..\..\devices\air724;..\..\..\..\devices\l610</IncludePath>
</VariousControls>
</Cads>
<Aads>
@@ -798,6 +798,26 @@
<FileType>1</FileType>
<FilePath>..\..\..\..\devices\esp8266\esp8266.c</FilePath>
</File>
<File>
<FileName>ec200s.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\devices\ec200s\ec200s.c</FilePath>
</File>
<File>
<FileName>ec20.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\devices\ec20\ec20.c</FilePath>
</File>
<File>
<FileName>air724.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\devices\air724\air724.c</FilePath>
</File>
<File>
<FileName>l610.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\devices\l610\l610.c</FilePath>
</File>
</Files>
</Group>
<Group>