FAIL: ESP8266 ESP-1 TCP Connections via Arduino UNO
hi,
i'm trying use dweet.io trough esp8266 esp-1 module connected arduino uno board.
the problem i'm able make connection trough at+cipstart when using @ commands directly on esp8266, i'm unable same throughout arduino sketch via softwareserial!
i used own web server see why fails, , direct @ commands worked these:
however, sketch same @ commands fails:
to monitor response of web server used command sudo tail -f /var/log/apache2/access.log. noticed direct @ commands response, when 400 response. however, sketch there isn't response, , yes tried bigger sketch connections established, including at+cwjap, , works fine until get command, looks softwareserial unable post html commands get!
it helpful see serial esp8266 response sketch commands, don't know how it, i'm able monitor arduino serial (9600) when commanding board trough sketch!
any suggestions?
thanks
i'm trying use dweet.io trough esp8266 esp-1 module connected arduino uno board.
the problem i'm able make connection trough at+cipstart when using @ commands directly on esp8266, i'm unable same throughout arduino sketch via softwareserial!
i used own web server see why fails, , direct @ commands worked these:
code: [select]
at+cipstart=0,"tcp","homepages.myownsite.com",80
at+cipsend=0,70
get /docs/testdocument.pdf http/1.1
host: homepages.myownsite.com
at+cipclose=0
however, sketch same @ commands fails:
code: [select]
#include <softwareserial.h>
#include <stdlib.h>
// rx esp -> tx arduino
// tx esp -> rx arduino
softwareserial espserial(10, 11); // rx, tx
// runs once
void setup() {
// enable debug serial
serial.begin(9600);
// enable software serial
espserial.begin(115200);
delay(2000);
serial.println("at+cipmux=1");
espserial.println("at+cipmux=1");
}
// loop
void loop() {
delay(2000);
serial.println("at+cipstart=0,\"tcp\",\"homepages.myownsite.com\",80");
espserial.println("at+cipstart=0,\"tcp\",\"homepages.myownsite.com\",80");
delay(2000);
serial.println("at+cipsend=0,70");
espserial.println("at+cipsend=0,70");
delay(2000);
serial.print("get /docs/testdocument.pdf http/1.1\r\nhost: homepages.myownsite.com\r\n\r\n");
espserial.print("get /docs/testdocument.pdf http/1.1\r\nhost: homepages.myownsite.com\r\n\r\n");
delay(6000);
//close connection
serial.println("at+cipclose=0");
espserial.println("at+cipclose=0");
}
to monitor response of web server used command sudo tail -f /var/log/apache2/access.log. noticed direct @ commands response, when 400 response. however, sketch there isn't response, , yes tried bigger sketch connections established, including at+cwjap, , works fine until get command, looks softwareserial unable post html commands get!
it helpful see serial esp8266 response sketch commands, don't know how it, i'm able monitor arduino serial (9600) when commanding board trough sketch!
any suggestions?
thanks
try using slower baud rates softwareserial, starting 9600.
you need change baud rate of esp8266 too, sending @ command:
as in instruction set
you need change baud rate of esp8266 too, sending @ command:
code: [select]
at+uart=9600,8,1,0,0
as in instruction set
Arduino Forum > Using Arduino > Programming Questions > FAIL: ESP8266 ESP-1 TCP Connections via Arduino UNO
arduino
Comments
Post a Comment