ESP8266 with Rest-api POST/GET
Sz Gombos wrote 02/09/2017 at 20:24 • 1 pointHi guys,
I am new in the IoT, but I have more expreience in programing. I would like to create a simple program for ESP8266. With these program, the wifi module can post some data (eg: JSON) to an web server (eg.: Spring). I don't know how I started it.
If my question is stupid, I am very sorry, but I didn't find any useless thread in theme.
If you have any good tip for me, I am thank you so much.
Best regards,
Sz,
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
To all those posting that they should use a raspberry pi in combination with the ESP8266, the ESP8266 has a 32 bit processor, runs at 80Mhz, has a fair amountof ram and program storage, is easy to program with "platformio", and costs about $4-$6 in a breadboard friendly form factor shipped from china. (Google for wemos D1 Mini). For many uses, including the Raspberry is just more power/expense and not really needed.
Are you sure? yes | no
A couple of short hints:
First of all, get platformio (http://platformio.org) to set up C compilers and a dev environment for the ESP8266. It will allow you to program the ESP8266 much like any Arduino clone, with sketches that have the same general format.
Next, find some code. This sparkfun page has some details on how to construct REST like calls to their data logging service, but it should be adaptable to whatever you like:
https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide/example-sketch-posting-to-phant
Hope that helps!
Are you sure? yes | no
Thank you for your answers. You helped me a lot. Yesterday I bought a NodeMCU device, and I realized that the environment setup is not an easy thing :) I thought, I buy a device, I upload the code, and that's all. :D Thanks a lot again :D
Are you sure? yes | no
https://shop.pimoroni.com/collections/raspberry-pi/products/esp8266-phat
Raspberry pi zero will set you back £4 + extras for connectors. The ESP8266 documentation is poor, but developing.
Are you sure? yes | no
if you are looking to push data out from sensors, then consider designing around MQTT. wiring a ESP8266 should be possible to a raspberry pi, and from there you can produce simple scripts to publish the data out to anything, incl. websockets etc.
Might also like to look at cayenne (mydeivcies.com) project - it may already have the libraries you need and links to IoT services.
good luck.
Are you sure? yes | no
I don't know, I think the raspberry phi is not too easy to learn basics of IoT. But thank you.
Are you sure? yes | no
Have you tried something like this?
https://github.com/DaKaZ/esp8266-restclient
Are you sure? yes | no
Thank you, I didn't find it. :)
Are you sure? yes | no