Chat freely about anything...

User avatar
By Synergy679
#25014 Hi

I am working on a project where a remote device with an ESP8266 onboard can communicate with a website.
The aim is to have the device send all its information to the website at specific intervals.

When a user goes to the website and logs in, they will be able to view the data that the device has been uploading.
The user will be able to use the website to make changes to parameters on the device as required.

After speaking with a web developer who would like to take this project on they have told me that my device needs an API.
I have read about this API and understand it to be a list of commands and responses the the device will act upon.
Is this pretty much all that it is??

If this is the case does anyone have any examples of how a device might do what i need?
I am looking for something like a flowchart to show how the device communicates with the website and then how the website would be able to communicate with the device.
I expect i will need to establish some sort of a link between the website and the device?

Thanks in advance
User avatar
By kenn
#25016
Synergy679 wrote:I am working on a project where a remote device with an ESP8266 onboard can communicate with a website.
The aim is to have the device send all its information to the website at specific intervals.


That's what about 80% of us are doing, so you're in good company

After speaking with a web developer who would like to take this project on they have told me that my device needs an API.
I have read about this API and understand it to be a list of commands and responses the the device will act upon.
Is this pretty much all that it is??


yes. pretty much.

At a minimum, your ESP device just needs to send some data in a GET or POST request to your server. Not much of an API, but it would get the job done. Now if you need more security (like passing tokens), or you want to pass data back in the server's response to the ESP (eg on-the-fly configuration, change intervals etc), then there's more involved... and you're going to need to write and publish an API so that others can work with it.

But for your initial efforts, why re-invent the wheel and mess with a custom server? There are several free servers who will let you fire data at them, collect it and display it nicely. Thingspeak is one. The benefit is that you're starting with a well-developed server system who already have a mature API that you can learn from. Also, for the popular ones like Thingspeak, there are already many fully working examples for the ESP8266 - just Google "thingspeak esp8266".

Have fun :)