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?

dda
1,5951 gold badge12 silver badges17 bronze badges
asked Apr 5, 2017 at 12:18
3
  • 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 Commented Apr 6, 2017 at 3:59
  • i can communicate with nano and send AT commands thorough it so all i need is a library Commented Apr 6, 2017 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... Commented Apr 6, 2017 at 9:31

1 Answer 1

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.

answered May 3, 2017 at 12:57

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.