1

I connected and flashed successfully an ESP8266 module to a Nano. Now I want to control pins values with a REST API, but all the libraries I found are for using standalone ESP8266 modules (without Arduino) or for Arduino with some other modules like CC3000 etc. Can anybody recommend a library please?

  • break the problem into parts: 1. get the api to talk to the nano. 2. get the nano to control the pins. #1 is harder – dandavis Apr 6 '17 at 3:59
  • i can communicate with nano and send AT commands thorough it so all i need is a library – Pitono Apr 6 '17 at 8:28
  • we're getting to the key part: you can send commands to it. Thinking about it, you might not be able to accept http connections to it, as a server. That makes sense, because it would be hard to code the back and forth with the server over serial. TBH, using the ESP as a module is weak sauce; the ESP is far faster, has way more RAM and flash. it's usually easier to push data from your 5v sensors on a nano into the ESP and then talk to the world with the ESP. I don't know why everyone does it backwards at first... – dandavis Apr 6 '17 at 9:31
1

You can use Firmata to control the Arduino pins, just having the ESP8266 publish a web page exposing the Firmata operations you desire to expose and sending the user actions to the Arduino via serial using the Firmata protocol.

To make your life easier you can consider your ESP8266 an equivalent of your serial console: everything you write from the ESP82667 becomes input data on the console for your Arduino and the other way around.

In Firmata, each command can be read from a generic Stream, with Serial being the default implementation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.