As the title says... Chat on...

User avatar
By zioax
#9306 Hi, I would to make a system that when arduino detect a sound, the ESP8266 send a request to a Webserver, but I'm using lua on the ESP, so how can I send lua from arduino serial to ESPM? Thanks
User avatar
By ArnieO
#9310 You set up a serial connection between Arduino and ESP, and send the LUA commands through that. It could be an advantage to use Software.serial for this connection, enabling debug messages to the Arduino IDE serial monitor.
User avatar
By elac
#9315 ArnieO ,
Could you give a quick example on how to set the esp to receive serial LUA commands from the Arduino?
User avatar
By ArnieO
#9316 @elac:
You do it in the same way as you would send AT commands if you used the official AT-command firmware from Espressif.

Software:
You send the commands by serial println commands, I think using Software Serial is a good idea, in that way you can use hw serial for debug monitoring of the Arduino. http://arduino.cc/en/Reference/SoftwareSerial

Hardware:
The ESP runs on 3.3V so I strongly recommend level shifting of the Rx/Tx signals, even if I have seen reports of people getting away with direct connection. But note: 5V into the Rx pin could potentially kill your ESP.
I am successfully using this level shifting method:
Image
Source: http://www.faludi.com/bwsn/xbee-level-shifting/
R1 can be omitted if you activate the internal pullup on the Arduino input you use for software Rx.