-->
Page 1 of 2

REST interface to an Arduino based board?

PostPosted: Wed Nov 01, 2017 12:15 pm
by amp
I'm just starting to work with the ESP8266, but have been working with other microcontrollers for many years.

I am looking to use the ESP to present a REST interface to boards I've been building that are based on the ATMega architecture, with the ESP serving the REST requests from a http client, passing commands to the uC via its serial interface, and then packaging a response from the serial interface to return results to the client. It looks like this library (https://github.com/esp8266/ESPWebServer) would provide the basics needed for that, but there's a lot of infrastructure that would also be needed for detecting and configuring a wifi networks, and preferably being able to flash the uC from the ESP.

The esp-link (https://github.com/jeelabs/esp-link) project has a lot of that stuff built into it along those lines that would be useful and I'm sure I could modify it to add the REST interface I need, but I figured I'd try asking here to see if there are other frameworks or libraries that I should be looking into.

Thanks!

Re: REST interface to an Arduino based board?

PostPosted: Sat Nov 04, 2017 2:56 am
by amp
Sorry if I wasn't clear. The ATMega based boards that I'm trying to put a REST interface in front of already have a binary command protocol. The ESP will be used to receive REST commands over HTTP, it will then translate that to the existing binary protocol, send that over the ESP's serial interface to the ATMega, and then take the response from the ATMega and package it as the reply to the REST commands.

Re: REST interface to an Arduino based board?

PostPosted: Sat Nov 04, 2017 11:54 am
by rudy
If the ESP receives the REST request via HTTP then it can just respond with HTTP - where does the serial bit come in?


He wants to use the ESP8266 as the web interface for an ATMega based board.

Re: REST interface to an Arduino based board?

PostPosted: Sat Nov 04, 2017 2:47 pm
by amp
rudy wrote:
If the ESP receives the REST request via HTTP then it can just respond with HTTP - where does the serial bit come in?


He wants to use the ESP8266 as the web interface for an ATMega based board.


Thats correct. The ESP8266 would be processing the REST requests, translating them into a binary format that is sent via serial to the ATMega, wait for responses from the ATMega, and then translate that response to return via HTTP.