This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] Energia:Energia->MSP432P401r 和 cc3100

Guru**** 2551350 points
Other Parts Discussed in Thread: ENERGIA, CC3100

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/692305/energia-energia--msp432p401r-and-cc3100

器件型号:Energia
主题中讨论的其他器件: CC3100

我正在处理通过 cc3100booster 和 msp432p401r 发送电子邮件的相关代码。 在 void setup()中提供 wifi 连接代码时,模块中的 wifi 连接出现问题。 我正在提供移动热点、它会定期连接和断开连接。 我需要连续连接。

当 wifi 连接代码被写入 loop()时,连接问题就会得到解决,但一个较新的问题是通过 I、e、 该程序正在运行、用于电子邮件、但不用于服务器[在服务器程序中、我将温度和脉冲计数值发送到 thingspeak.com 以获取数据的图形表示。]

此外、尽管它出现在循环中、但它只执行一次。 这对我来说是一个非常重要的问题。 我正在链接下面的代码。 请帮我解决这个问题。

#define TEMBOO_ACCOUNT "xxxxxxx"  // your Temboo account name
#define TEMBOO_APP_KEY_NAME "xxxxxxx"  // your Temboo app name
#define TEMBOO_APP_KEY  "xxxxxxxx"  // your Temboo app key
#define WIFI_SSID "xxxxxx"   //hotspot name
#define WIFI_PASSWORD "xxxxxxx"   //hotspot password
#ifndef __CC3200R1M1RGC__
#include <SPI.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include <Temboo.h>
#endif
constString GMAIL_USER_NAME = "xxxxxxx"; //sender's email
constString GMAIL_APP_PASSWORD = "xxxxxx"//sender's app password
constString TO_EMAIL_ADDRESS = "xxxxxxx";    //receiver's email
boolean attempted = false;
#include <LiquidCrystal.h>
LiquidCrystal lcd(13,33,12,24,5,25,6,26,27,8,28);
  floattemp;
  floatvolt;
  intsensorValue1;
  intsensorValue2;
  intcount;
WiFiClient client;
charserver[] = "api.thingspeak.com";
unsigned longlastConnectionTime = 0;            // last time you connected to the server, in milliseconds
constunsigned longpostingInterval = 10L * 1000L; // delay between updates, in milliseconds
voidcheckconnection()
{
  intwifiStatus = WL_IDLE_STATUS;
  // determine if the WiFi Shield is present.
  Serial.print("\n\nShield:");
  
    
  if(WiFi.status() == WL_NO_SHIELD) {
   
    Serial.println("FAIL");
   
    
    // if there's no WiFi shield, stop here.
    while(true);
  }
    
  while(wifiStatus != WL_CONNECTED) {
    Serial.print("WiFi:");
    wifiStatus = WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
    if(wifiStatus == WL_CONNECTED) {
      Serial.println("OK");
    } else{
      Serial.println("FAIL");
    }
    delay(1000);
  }
   Serial.println("Waiting for an ip address");
  
  while(WiFi.localIP() == INADDR_NONE) {
    // print dots while we wait for an ip addresss
    Serial.print(".");
    delay(300);
  }
  Serial.println("\nIP Address obtained");
  // We are connected and have an IP address.
  // Print the WiFi status.
  printWifiStatus();
}
voidserverprog()
{
 while(client.available()) {
    charc = client.read();
    Serial.write(c);
  
 if(millis() - lastConnectionTime > postingInterval) {
    httpRequest();
  }
}
voidhttpRequest() {
  // close any connection before send a new request.
  // This will free the socket on the WiFi shield
  client.stop();
  // if there's a successful connection:
  if(client.connect(server, 80)) {
    Serial.println("connecting...");
    charmsgg[200];
    sprintf(msgg,"GET /update?api_key=xxxxxxxxxxxxxxxx&field1=%f&field2=%d",temp,count);  //have to make account on thingspeak.com and create channel then create 2 fields. then copy the WRITE API key in place of xxxxxxxxx
    // send the HTTP PUT request:
    client.println(msgg);
    client.println("Host: api.thingspeak.com");
    client.println("User-Agent: Energia/1.1");
    client.println("Connection: close");
    client.println();
    // note the time that the connection was made:
    lastConnectionTime = millis();
  }
  else{
    // if you couldn't make a connection:
    Serial.println("connection failed");
  }
}
voidprintWifiStatus() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());
  // print your WiFi IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);
  // print the received signal strength:
  longrssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
}
   voidsetup() {
  lcd.begin(16, 2);
 
  Serial.begin(9600);
  Serial.println("processing......");
  
   }
 
 
voidloop() {
  intsensorValue1 = analogRead(A0);
  lcd.clear();
    lcd.setCursor(0,2);
  lcd.print("wait..");
 /* lcd.setCursor(0,0);
  lcd.print("temperature =");
  lcd.setCursor(14,0);
  lcd.print(temp);*/
   
  Serial.println(sensorValue1);
  volt=sensorValue1*3.22;
  temp=volt/10;
  Serial.println(volt);
  Serial.println("temp=");
  Serial.println(temp);
  delay(10);
  
 intsensorValue2;
  unsigned longstart=millis();
  analogReadResolution(10);
  unsigned longcurrentValue;
  floatx=0;
  inty;
  count=0;
  delay(3000);
  lcd.clear();
 
lcd.setCursor(0,2);
lcd.print("detecting.......");
  do
  {
    intsensorValue2 = analogRead(A1);
    if(sensorValue2 > x)
   
    {
      x=sensorValue2;
      y=1;
     
    }
elseif(sensorValue2 < x)
{
   x=sensorValue2;
   if(y==1)
   {
     count++;
     y=0;
   }
}
currentValue=millis();
  }
  while(currentValue-start<=30000);
   count=(count*2)/10000;
  lcd.clear();
  lcd.setCursor(0,0);
 lcd.print("temperature =");
  lcd.setCursor(14,0);
  lcd.print(temp);
   lcd.setCursor(0,2);
  lcd.print("pulse count =");
  lcd.setCursor(14,1);
    lcd.print(count);
    delay(1000);
     
  Serial.println(sensorValue2);
   Serial.println("pulse count=");
    Serial.println(count);
    checkconnection();
    delay(3000);
    
  if(!attempted) {
   
    Serial.println("Running SendAnEmail...");
  
    TembooChoreo SendEmailChoreo(client);
    SendEmailChoreo.begin();
    
    SendEmailChoreo.setAccountName(TEMBOO_ACCOUNT);
    SendEmailChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME);
    SendEmailChoreo.setAppKey(TEMBOO_APP_KEY);
    SendEmailChoreo.setChoreo("/Library/Google/Gmail/SendEmail");
 
    SendEmailChoreo.addInput("Username", GMAIL_USER_NAME);
   
    SendEmailChoreo.addInput("Password", GMAIL_APP_PASSWORD);
    SendEmailChoreo.addInput("ToAddress", TO_EMAIL_ADDRESS);
  
    SendEmailChoreo.addInput("Subject", "Recieved An Email???");
  charmsg[100];
  sprintf (msg," Body Temperature=%f, Pulse count=%d",temp,count);
    SendEmailChoreo.addInput("MessageBody", msg);
       unsigned intreturnCode = SendEmailChoreo.run();
    if(returnCode == 0) {
        Serial.println("Success! Email sent!");
    } else{
           while(SendEmailChoreo.available()) {
        charc = SendEmailChoreo.read();
        Serial.print(c);
      }
    }
    SendEmailChoreo.close();
    
  }
 serverprog();
     lcd.clear();
}
1
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18
19.
20.
21.
22.
23
24
25
26
27.
28.
29.
30
31.
32
33.
34
35.
36.
37.
38.
39.
40
41.
42.
43.
44.
45.
46.
47.
48
49
50
51.
52.
53.
54
55
56.
57.
58.
59.
60
61.
62.
63.
64
65
66
67
68
69
70
71.
72.
73.
74.
75
76.
77
78
79
80
81.
82.
83.
84
85.
86
87
88
89
90
91.
92
93
94
95
96
97
98
99
100
101.
102.
103.
104.
105.
106.
107.
108.
109.
110
111.
112
113
114
115
116
117
118
119
120
121.
122.
123.
124.
125.
126.
127.
128
129.
130
131.
132.
133.
134.
135.
136.
137.
138.
139.
140
141.
142.
143.
144.
145.
146.
147.
148.
149.
150
151.
152.
153.
154.
155.
156.
157.
158.
159.
160
161.
162.
163.
164.
165.
166.
167.
168.
169.
170
171.
172.
173.
174.
175.
176.
177.
178.
179.
180
181.
182.
183.
184.
185.
186.
187.
188.
189.
190
191.
192.
193.
194.
195.
196
197
198
199
200
201
202.
203.
204.
205.
206.
207.
208.
209.
210
211
212
213.
214.
215.
216
217.
218.
219.
220
221.
222.
223.
224.
225
226
227
228
229
230
231.
232
233
2334
235
236
237
238
239.
240
241.
242.
243.
244.
245.
246.
247.
248.
249.
250
251.
252.
253.
254.
255.
256
257.
258.
259.
260
261.
262.
263.
264
265
#define TEMBOO_ACCOUNT "xxxxxxx"  // your Temboo account name
#define TEMBOO_APP_KEY_NAME "xxxxxxx"  // your Temboo app name
#define TEMBOO_APP_KEY  "xxxxxxxx"  // your Temboo app key
#define WIFI_SSID "xxxxxx"   //hotspot name
#define WIFI_PASSWORD "xxxxxxx"   //hotspot password
#ifndef __CC3200R1M1RGC__
#include <SPI.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include <Temboo.h>
#endif
constString GMAIL_USER_NAME = "xxxxxxx"; //sender's email
constString GMAIL_APP_PASSWORD = "xxxxxx"//sender's app password
constString TO_EMAIL_ADDRESS = "xxxxxxx";    //receiver's email
boolean attempted = false;
#include <LiquidCrystal.h>
LiquidCrystal lcd(13,33,12,24,5,25,6,26,27,8,28);
  floattemp;
  floatvolt;
  intsensorValue1;
  intsensorValue2;
  intcount;
WiFiClient client;
charserver[] = "api.thingspeak.com";
unsigned longlastConnectionTime = 0;            // last time you connected to the server, in milliseconds
constunsigned longpostingInterval = 10L * 1000L; // delay between updates, in milliseconds
voidcheckconnection()
{
  intwifiStatus = WL_IDLE_STATUS;
  // determine if the WiFi Shield is present.
  Serial.print("\n\nShield:");
   Serial.println("qqqqq");
    
  if(WiFi.status() == WL_NO_SHIELD) {
     Serial.println("xxxxx");
    
    Serial.println("FAIL");
     Serial.println("yyyyy");
    
    
    // if there's no WiFi shield, stop here.
    while(true);
  }
  Serial.println("zzzzzzz");
    
  while(wifiStatus != WL_CONNECTED) {
    Serial.print("WiFi:");
    wifiStatus = WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
    if(wifiStatus == WL_CONNECTED) {
      Serial.println("OK");
    } else{
      Serial.println("FAIL");
    }
    delay(1000);
  }
   Serial.println("Waiting for an ip address");
  
  while(WiFi.localIP() == INADDR_NONE) {
    // print dots while we wait for an ip addresss
    Serial.print(".");
    delay(300);
  }
  Serial.println("\nIP Address obtained");
  // We are connected and have an IP address.
  // Print the WiFi status.
  printWifiStatus();
}
voidserverprog()
{
 while(client.available()) {
    charc = client.read();
    Serial.write(c);
  
 if(millis() - lastConnectionTime > postingInterval) {
    httpRequest();
  }
}
voidhttpRequest() {
  // close any connection before send a new request.
  // This will free the socket on the WiFi shield
  client.stop();
  // if there's a successful connection:
  if(client.connect(server, 80)) {
    Serial.println("connecting...");
    charmsgg[200];
    sprintf(msgg,"GET /update?api_key=xxxxxxxxxxxxxxxx&field1=%f&field2=%d",temp,count);  //have to make account on thingspeak.com and create channel then create 2 fields. then copy the WRITE API key in place of xxxxxxxxx
    // send the HTTP PUT request:
    client.println(msgg);
    client.println("Host: api.thingspeak.com");
    client.println("User-Agent: Energia/1.1");
    client.println("Connection: close");
    client.println();
    // note the time that the connection was made:
    lastConnectionTime = millis();
  }
  else{
    // if you couldn't make a connection:
    Serial.println("connection failed");
  }
}
voidprintWifiStatus() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());
  // print your WiFi IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);
  // print the received signal strength:
  longrssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
}
   voidsetup() {
  lcd.begin(16, 2);
 
  Serial.begin(9600);
  Serial.println("processing......");
  
   }
 
 
voidloop() {
  intsensorValue1 = analogRead(A0);
  lcd.clear();
    lcd.setCursor(0,2);
  lcd.print("wait..");
 /* lcd.setCursor(0,0);
  lcd.print("temperature =");
  lcd.setCursor(14,0);
  lcd.print(temp);*/
   
  Serial.println(sensorValue1);
  volt=sensorValue1*3.22;
  temp=volt/10;
  Serial.println(volt);
  Serial.println("temp=");
  Serial.println(temp);
  delay(10);
  
 intsensorValue2;
  unsigned longstart=millis();
  analogReadResolution(10);
  unsigned longcurrentValue;
  floatx=0;
  inty;
  count=0;
  delay(3000);
  lcd.clear();
 
lcd.setCursor(0,2);
lcd.print("detecting.......");
  do
  {
    intsensorValue2 = analogRead(A1);
    if(sensorValue2 > x)
   
    {
      x=sensorValue2;
      y=1;
     
    }
elseif(sensorValue2 < x)
{
   x=sensorValue2;
   if(y==1)
   {
     count++;
     y=0;
   }
}
currentValue=millis();
  }
  while(currentValue-start<=30000);
   count=(count*2)/10000;
  lcd.clear();
  lcd.setCursor(0,0);
 lcd.print("temperature =");
  lcd.setCursor(14,0);
  lcd.print(temp);
   lcd.setCursor(0,2);
  lcd.print("pulse count =");
  lcd.setCursor(14,1);
    lcd.print(count);
    delay(1000);
     
  Serial.println(sensorValue2);
   Serial.println("pulse count=");
    Serial.println(count);
    checkconnection();
    delay(3000);
    
  if(!attempted) {
   
    Serial.println("Running SendAnEmail...");
  
    TembooChoreo SendEmailChoreo(client);
    SendEmailChoreo.begin();
    
    SendEmailChoreo.setAccountName(TEMBOO_ACCOUNT);
    SendEmailChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME);
    SendEmailChoreo.setAppKey(TEMBOO_APP_KEY);
    SendEmailChoreo.setChoreo("/Library/Google/Gmail/SendEmail");
 
    SendEmailChoreo.addInput("Username", GMAIL_USER_NAME);
   
    SendEmailChoreo.addInput("Password", GMAIL_APP_PASSWORD);
    SendEmailChoreo.addInput("ToAddress", TO_EMAIL_ADDRESS);
  
    SendEmailChoreo.addInput("Subject", "Recieved An Email???");
  charmsg[100];
  sprintf (msg," Body Temperature=%f, Pulse count=%d",temp,count);
    SendEmailChoreo.addInput("MessageBody", msg);
       unsigned intreturnCode = SendEmailChoreo.run();
    if(returnCode == 0) {
        Serial.println("Success! Email sent!");
    } else{
           while(SendEmailChoreo.available()) {
        charc = SendEmailChoreo.read();
        Serial.print(c);
      }
    }
    SendEmailChoreo.close();
    
  }
 serverprog();
     lcd.clear();
}
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好、Sherry、

    主 CC3xxx 论坛位于此处:
    forum.43oh.com/.../
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尽管您的草图可能起作用、但它存在几个问题。 反复调用 WiFi.begin 没有任何作用,因为如果已经调用 WiFi.begin,只需返回:status()。 连续调用 Begine() 实际上不执行任何操作。 在对::Begine()的连续调用中不会进行连接尝试。 其工作原理是 ,当您调用::bege()时,在此情况下 AP (SSID、PASS)的凭据将存储为配置文件。 当具有 BEGIN 中提供的 SSID 的 AP 在范围内时、CC3100将尝试连接到该 AP。 如果 AP 断开、CC3100将断开连接。 当 AP 重新出现时、CC3100将自动尝试 重新连接到 AP。 例如、假设我有一个连接到 AP (我手机上的热点)的 Sketch。 如果我用手机离开办公室、CC3100将失去连接。 但是、在我第二天早上走进办公室时、CC3100将重新连接到 AP。

    要解决您的问题、请执行以下操作:

    下面的草图与您最初发布的内容略有不同。 它仅在 setup 中调用::bege(),然后检查函数 serverprog()中是否有连接。 如果关闭个人热点、串行控制台将打印 WiFi 连接已丢失。 如果我现在将其重新打开、 CC3100将重新连接并恢复正常运行。

    为了排除电话的任何问题、您是否有合适的 AP、可通过打开和关闭该 AP 来测试连接?

    测试中使用的草图:

    #define TEMBO_account "xxxxxxx"// Temboo 帐户名称
    #define TEMBO_APP_KEY_NAME "xxxxxxx"// Temboo 应用程序名称
    #define TEMBOO_APP_KEY "xxxxxxxxxxxxxxxx"// Temboo 应用程序密钥
    #define WIFI_SSID "Energia"//热点名称
    #WIFI_PASSWORD "LaunchPad_#def_SECURIT_SECURE_SECURIT_SECURIT_#def_SECURIT_SECURIT_#def_SECURIT_#def_SECURIT_#def_#def_SECURIT_#def_
    
    
    #include 
    #include 
    #include 
    #endif
    const String Gmail_user_name ="boolean xxxx";//发件人的电子邮件
    const String Gmail_app_password ="xxxxxxxxxxxxxxxx";//发件人的应用密码
    const String 收件人_email_address ="xxxxxxxxxxxxxxxx";//接收人的电子邮件
    //尝试= false;
    float temp;
    float volt;
    int sensorValue1;int sensorValue2
    ;
    int 计数;
    WiFiClient 客户端;
    char 服务器[]="api.thingspeak.com";
    unsigned long lastConnectionTime = 0; //上次连接到服务器时,以毫秒为单位
    表示无符号长后置间隔= 10L * 1000L;//更新之间的延迟,以毫秒为单位
    
    void connect_TO_wifi ()
    {
    Serial.print ("\n\nShield:");
    
    // if (wif.status ()= wL_no_shield){
    // sery.printn (");
    
    
    
    /wifi 连接失败("serial)
    /SSID);//串行打印(wife.ssid)
    
    if (WiFi.begin(WIFI_SSID、wifi 密码)=WL_connect_failed){
    serial.println ("连接到 WiFi 时出错");
    }
    
    while (wia.status()!= wL_connected){
    serial.print(".");
    delay (300);
    }
    
    Serial.println ();
    
    Serial.println ("正在等待 IP 地址");
    
    while (WiFi.localIP ()== INADDR_NONE){
    serial.print(".");
    delay (300);
    }
    Serial.println (获得\nip 地址);
    
    printWifiStatus ();
    }
    
    void serverprog ()
    {
    if (wif.status ()!= wL_connected){
    //如果我们失去了与 AP 的连接,则返回。
    serial.print ("WiFi 连接丢失.. ");
    serial.println("正在等待恢复连接");
    延迟(5000);
    return;
    }
    
    while (client.available ()){
    char c = client.read();
    serial.write (c);
    }
    if (millis ()- lastConnectionTime > postingInterval){
    HttpRequest();
    }
    
    
    void HttpRequest(){//
    在发送新请求之前关闭任何连接。
    //这将释放 WiFi shield
    client.stop()上的套接字;
    //如果连接成功:
    if (client.connect (server、80)){
    serial.println ("正在连接...");
    char msg[200];
    system_sprintf (msgg、"get /update?api_key=xxxxxxxxxxxx&field1=%f&field2=%d"、temp、count);//必须在 thingspeak.com 上进行帐户并创建通道,然后创建2个字段。 然后复制写入 API 密钥以代替 xxxxxxxxx
    //发送 HTTP PUT 请求:
    client.println (msgg);
    client.println ("主机:api.thingspeak.com");
    client.println ("用户代理:Energia/1.1");
    client.println ("连接:关闭");
    client.println();
    //注意建立连接的时间:
    lastConnectionTime =毫秒();
    }
    否则{
    //如果无法建立连接:
    serial.tltn ("连接失败");
    }
    
    void printWifiStatus (){
    //打印您所连接网络的 SSID:
    serial.print ("ssid:");serial.println
    (WiFi.ssid ());
    //打印 WiFi IP 地址:
    ipaddress = WiFi.localIP ();
    serial.print ("sspisn
    
    
    )("Serial Strength)
    (ssi)(ssi);
    / print (ssi)信号强度:"(ssi);(ssi (串行)(ssi));(ssi (ssi (ssi))))(打印)
    serial.println (" dBm");
    }
    
    void setup (){
    
    Serial.begin(115200);
    connect_TO_wifi ();
    }
    
    void loop (){
    int sensorValue1 = analogRead (A0);
    
    Serial.println (sensorValue1);
    volt = sensorValue1 * 3.22;
    temp =/10;
    Serial.printn (sensorValue1)
    ;voltal.pringn
    (ale10);voltal.pring.pringn ("temp (serial.printn);voltal.n (temp);volt
    
    
    int sensorValue2;
    unsigned long start = millis ();
    analogReadResolution (10);
    unsigned long CurrentValue;
    float x = 0;
    int y;
    count = 0;
    delay (3000);
    
    do
    {
    int sensorValue2 = analogRead (A1);
    如果(sensorValue2 > x)
    
    {
    x = sensorValue2;
    Y = 1;
    
    }
    否则、如果(sensorValue2 < x)
    {
    x = sensorValue2;
    如果(y==1)
    {
    count++;
    Y = 0;
    }
    }
    CurrentValue =毫秒();
    }
    while (CurrentValue - start <= 30000);
    count =(count * 2)/10000;
    delay (1000);
    
    Serial.println (sensorValue2);
    Serial.println ("pulse count=");
    Serial.println (count);
    延迟(3000);
    
    // if (!attempted){
    //
    serial.println ("正在运行 SendAnEmail...");
    //
    // TembooChoreo SendEmailChoreo (客户端);
    // SendEmailChoreo.begin();
    //
    // SendEmailChoreo.setAccountName(TEMBOO_ACCOUNT);
    // SendEmailChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME);
    // SendEmailChoreo.setAppKey(TEMBOO_APP_KEY);
    // SendEmailChoreo.setChoreo("/Library/Google/Gmail/SendEmail");
    //
    // SendEmailChoreo.addInput ("用户名"、Gmail_user_name);
    //
    SendEmailChoreo.addInput ("密码"、Gmail_app_password);
    // SendEmailChoreo.addInput ("ToAddress"、To_email_address);
    //
    SendEmailChoreo.addInput ("主题"、"收到电子邮件????");
    // char msg[100];
    // System_sprintf (msg、"体温=%f、脉冲计数=%d"、temp、count);
    // SendEmailChoreo.addInput ("MessageBody "、msg);
    // unsigned int returnCode = SendEmailChoreo.run();
    // 如果(返回码= 0){
    // serial.println ("成功! 电子邮件已发送!");
    //} 否则{
    // while (SendEmailChoreo.available ()){
    // char c = SendEmailChoreo.read();
    // serial.print(c);
    //}
    //}
    // SendEmailChoreo.close();
    ////
    }
    serverprog();
    }