我是使用 MCBSTR9 手臂板的初学者
我正在尝试使用 pushbox API 在TCP模式下使用 ESP8266 wifi模块。
连接到API后,pushbox无法发送请求GET /pushingbox?devid=deviceid HTTP/1.0\r\nHost: api.pushingbox.com\r\n\r\n
。
我的问题是如何在keil c中包含新的线路键。我已经使用了\r\n
但它没有用。但它适用于ESP 8266用户应用程序。
这是我尝试过的代码:
/*ESP8266-01*/
char data[] = "GET /pushingbox?devid=*************&tag=but HTTP/1.0";
char data1[] = "Host: api.pushingbox.com";
char data2[] = "";
void at(void) {
sendchar1('A');
sendchar1('T');
sendchar1('\r');
sendchar1('\n');
for (i = 0; i < 12; i++)
lcd_putchar(getkey1());
}
void atcwmode(void) {
char ch[] = "AT+CWMODE=3\r\n"
for (i = 0; i < 13; i++)
sendchar1(ch[i]);
for (i = 0; i < 21; i++) {
lcd_putchar(getkey1());
if (i == 14)
set_cursor(0, 1);
}
}
void atcipmux(void) {
char ch[] = "AT+CIPMUX=0\r\n";
for (i = 0; i < 13; i++)
sendchar1(ch[i]);
for (i = 0; i < 21; i++) {
lcd_putchar(getkey1());
if (i == 14)
set_cursor(0, 1);
}
}
void atcwjap(void) {
char ch[] = "AT+CWJAP?\r\n";
for (i = 0; i < 11; i++)
sendchar1(ch[i]);
for (i = 0; i < 29; i++) {
lcd_putchar(getkey1());
if (i == 16)
set_cursor(0, 1);
}
}
void atsend() {
char ch[] = "AT+CIPSEND=";
for (i = 0; i < strlen(ch); i++)
sendchar1(ch[i]);
sendchar1('8');
sendchar1('5');
sendchar1('\r');
sendchar1('\n');
for (i = 0; i < 16; i++)
lcd_putchar(getkey1());
set_cursor(0, 1);
lcd_putchar(getkey1());
lcd_putchar(getkey1());
lcd_putchar(getkey1());
lcd_putchar(getkey1());
lcd_putchar(getkey1());
lcd_putchar(getkey1());
lcd_putchar(getkey1());
wait();
wait();
for (i = 0; i < strlen(data) - 1; i++)
sendchar1(data[i]);
GPIO7 - > DR[0x3FC] = 0xFF;
set_cursor(0, 0);
GPIO7 - > DR[0x3FC] = 0x00;
for (i = 0; i < 16; i++)
lcd_putchar(getkey1());
set_cursor(0, 1);
for (i = 0; i < 16; i++)
lcd_putchar(getkey1());
set_cursor(0, 0);
for (i = 0; i < 16; i++)
lcd_putchar(getkey1());
set_cursor(0, 1);
for (i = 0; i < 16; i++)
lcd_putchar(getkey1());
}
我尝试过使用esp用户应用程序 POST / pushbox?devid = vD12658A9BB09A13&amp; tag =但HTTP / 1.0 \ r \ n 主持人:api.pushingbox.com:80
它可以工作,我的推箱方案得到更新。 但它不适用于董事会。