If I send these commands through the serial monitor everything works fine . But if I try it using the code below it just does't work and show errors and what not.
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 4); // RX, TX
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
Serial.println("Goodnight moon!");
// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
I have already been trying on 9600 . This is what I get on the serial monitor .
Goodnight moon!
¬,®XY·nn�Ñ¥r¢Å ò
Þ¹¹z:�25ëË ¬®_XJ¸inP…å½*ûò¥RõËKÖÖ'KM—7.j¹sp8266 Lua; Windows NT 5.1)\r\n')
conn:send('\r\n')
stdin:1: '=' expected near 'Lua'
þ
And these error messages keep changing as well everytime it runs . On 115200 its entirely garbled .
That's a Lua syntax error; the semicolon needs to be escaped. Better yet just remove the entire "User-Agent:" line because it's not necessary anyway. Then remove the "Accept:" line as well.
Erni:
Why do you use an Arduino to upload LUA code?
He's not writing files on the ESP8266 (the would prefix each line with file.writeline(..)). He's giving the module commands from the Arduino to do... whatever.
There are more efficient ways to do what he's doing but I don't see it as a problem.
I also experience that problem. I also dont know how did I manage to solve mine. But I think it is beacuse of the number of characters you sent. I also used a <SoftwareSerial.h>. But in your code, you send all the data thru serial and what I did is i just send data to serial what is just necessary. I wanted to put the code here but its bit long so if you want to know how I did mine here is the link. I hope it helps and ignore if it dont. Thanks. http://thinkingparts.blogspot.com/2015/08/home-automation-diy-version-internet_23.html