Rest Interface support for ESP32
Rest Interface support for ESP32
Hi,
We are working on ESP32 product and we have one requirement in which our device will be working into AP mode and Mobile Application will be connected with device for command Request and Response.
So, Our client Requirement is to communicate using Rest Server Interface and Rest APIs.
So, Does anyone has ported this type of interface?
Please suggest any information or links for that.
We are working on ESP32 product and we have one requirement in which our device will be working into AP mode and Mobile Application will be connected with device for command Request and Response.
So, Our client Requirement is to communicate using Rest Server Interface and Rest APIs.
So, Does anyone has ported this type of interface?
Please suggest any information or links for that.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: Rest Interface support for ESP32
I'm using https://github.com/chmorgan/libesphttpd and cgi functions to have the esp32 provide restful interfaces for external use by other devices, web pages etc.Ritesh wrote:Hi,
We are working on ESP32 product and we have one requirement in which our device will be working into AP mode and Mobile Application will be connected with device for command Request and Response.
So, Our client Requirement is to communicate using Rest Server Interface and Rest APIs.
So, Does anyone has ported this type of interface?
Please suggest any information or links for that.
I use cJSON for json parsing and generation. It's working well. The biggest issue so far is that establishing a https connection can take a handful of seconds. Once the connection is open its quite fast however.
Re: Rest Interface support for ESP32
Ritesh,
Form my usage I liked to work in C++ so am using:
https://github.com/nkolban/esp32-snippe ... Server.pdf
Form my usage I liked to work in C++ so am using:
https://github.com/nkolban/esp32-snippe ... Server.pdf
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: Rest Interface support for ESP32
Hi,cmorgan wrote:I'm using https://github.com/chmorgan/libesphttpd and cgi functions to have the esp32 provide restful interfaces for external use by other devices, web pages etc.Ritesh wrote:Hi,
We are working on ESP32 product and we have one requirement in which our device will be working into AP mode and Mobile Application will be connected with device for command Request and Response.
So, Our client Requirement is to communicate using Rest Server Interface and Rest APIs.
So, Does anyone has ported this type of interface?
Please suggest any information or links for that.
I use cJSON for json parsing and generation. It's working well. The biggest issue so far is that establishing a https connection can take a handful of seconds. Once the connection is open its quite fast however.
Thanks for quick reply.
So, Did you checked how-many memory has been consumed while porting above libraries into ESP32? Also, Did you test it with Mobile Application or directly with Web Page?
Also, Which ESP32 IDF SDK version are you using for your development purpose?
It will be good if you provide any sample program for that.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: Rest Interface support for ESP32
- On the memory question, do you mean flash or ram?Ritesh wrote:Hi,cmorgan wrote:I'm using https://github.com/chmorgan/libesphttpd and cgi functions to have the esp32 provide restful interfaces for external use by other devices, web pages etc.Ritesh wrote:Hi,
We are working on ESP32 product and we have one requirement in which our device will be working into AP mode and Mobile Application will be connected with device for command Request and Response.
So, Our client Requirement is to communicate using Rest Server Interface and Rest APIs.
So, Does anyone has ported this type of interface?
Please suggest any information or links for that.
I use cJSON for json parsing and generation. It's working well. The biggest issue so far is that establishing a https connection can take a handful of seconds. Once the connection is open its quite fast however.
Thanks for quick reply.
So, Did you checked how-many memory has been consumed while porting above libraries into ESP32? Also, Did you test it with Mobile Application or directly with Web Page?
Also, Which ESP32 IDF SDK version are you using for your development purpose?
It will be good if you provide any sample program for that.
- I've tested pages delivered from the esp32 with javascript on them that was retrieving data from the device via json.
- I'm using esp-idf 3a271a4ae7df8. I was using the 2.1 release but had issues with AP + STA where the AP connection to the esp32 wouldn't establish in most cases.
- Here is a linux example I put together to test libesphttpd outside of the device:
https://github.com/chmorgan/libesphttpd_linux_example
I've also used Sprite's example pages from this repo and copied them into my projects:
https://github.com/Spritetm/esphttpd-freertos
-
- Posts: 23
- Joined: Thu Oct 26, 2017 7:34 am
Re: Rest Interface support for ESP32
Hello @cmorgan
I tried your both examples as you suggested
1) https://github.com/chmorgan/libesphttpd_linux_
In this example, even if i followed read-me steps properly ,but when I tried to run make file its following error.
2) https://github.com/Spritetm/esphttpd-freertos
I am using esp-idf v2.1 . i arranged this repository as examples are given in idf , but still getting following error when run make file.
can you please provide proper steps to build this project?
I tried your both examples as you suggested
1) https://github.com/chmorgan/libesphttpd_linux_
In this example, even if i followed read-me steps properly ,but when I tried to run make file its following error.
Code: Select all
[ 4%] Performing configure step for 'esphttpd'
CMake Error at /usr/local/share/cmake-3.9/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY
OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/local/share/cmake-3.9/Modules/FindPackageHandleStandardArgs.cmake:377 (_FPHSA_FAILURE_MESSAGE)
/usr/local/share/cmake-3.9/Modules/FindOpenSSL.cmake:388 (find_package_handle_standard_args)
CMakeLists.txt:55 (find_package)
-- Configuring incomplete, errors occurred!
See also "/data/rest/libesphttpd_linux_example/build/esphttpd-prefix/src/esphttpd-build/CMakeFiles/CMakeOutput.log".
CMakeFiles/esphttpd.dir/build.make:105: recipe for target 'esphttpd-prefix/src/esphttpd-stamp/esphttpd-configure' failed
make[2]: *** [esphttpd-prefix/src/esphttpd-stamp/esphttpd-configure] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/esphttpd.dir/all' failed
make[1]: *** [CMakeFiles/esphttpd.dir/all] Error 2
Makefile:94: recipe for target 'all' failed
make: *** [all] Error 2
2) https://github.com/Spritetm/esphttpd-freertos
I am using esp-idf v2.1 . i arranged this repository as examples are given in idf , but still getting following error when run make file.
Code: Select all
make[1]: *** No rule to make target '/data/rest/new/esp-idf-v2.1/examples/protocols/restful/html/', needed by 'webpages.espfs'. Stop.
/data/rest/new/esp-idf-v2.1/make/project.mk:434: recipe for target 'component-libesphttpd-build' failed
make: *** [component-libesphttpd-build] Error 2
Re: Rest Interface support for ESP32
Hello.pratik.yadav.455 wrote:Hello @cmorgan
I tried your both examples as you suggested
1) https://github.com/chmorgan/libesphttpd_linux_
In this example, even if i followed read-me steps properly ,but when I tried to run make file its following error.Code: Select all
[ 4%] Performing configure step for 'esphttpd' CMake Error at /usr/local/share/cmake-3.9/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR) Call Stack (most recent call first): /usr/local/share/cmake-3.9/Modules/FindPackageHandleStandardArgs.cmake:377 (_FPHSA_FAILURE_MESSAGE) /usr/local/share/cmake-3.9/Modules/FindOpenSSL.cmake:388 (find_package_handle_standard_args) CMakeLists.txt:55 (find_package) -- Configuring incomplete, errors occurred! See also "/data/rest/libesphttpd_linux_example/build/esphttpd-prefix/src/esphttpd-build/CMakeFiles/CMakeOutput.log". CMakeFiles/esphttpd.dir/build.make:105: recipe for target 'esphttpd-prefix/src/esphttpd-stamp/esphttpd-configure' failed make[2]: *** [esphttpd-prefix/src/esphttpd-stamp/esphttpd-configure] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/esphttpd.dir/all' failed make[1]: *** [CMakeFiles/esphttpd.dir/all] Error 2 Makefile:94: recipe for target 'all' failed make: *** [all] Error 2
2) https://github.com/Spritetm/esphttpd-freertos
I am using esp-idf v2.1 . i arranged this repository as examples are given in idf , but still getting following error when run make file.can you please provide proper steps to build this project?Code: Select all
make[1]: *** No rule to make target '/data/rest/new/esp-idf-v2.1/examples/protocols/restful/html/', needed by 'webpages.espfs'. Stop. /data/rest/new/esp-idf-v2.1/make/project.mk:434: recipe for target 'component-libesphttpd-build' failed make: *** [component-libesphttpd-build] Error 2
For #1 you'll want to install the openssl-devel package for your particular Linux distributions. It's openssl-devel here on Fedora 26.
For #2 I was thinking about this just the other day, I don't have a simple small example and I'm not sure if Sprite's esphttpd-freertos builds. You could recreate it by taking one of the examples from esp-idf, adding libesphttpd into the components/ subdirectory, creating a html/ folder and then looking at esphttpd-freertos and the libesphttpd README to initialize. I'll put together a simple example at some point but probably not within the next few days.
Re: Rest Interface support for ESP32
Hi @ritesh. I had some time and updated Sprite's example to work for ESP32 and the latest libesphttpd. You can find it here:
https://github.com/chmorgan/esphttpd-freertos
https://github.com/chmorgan/esphttpd-freertos
Re: Rest Interface support for ESP32
Hi,cmorgan wrote:Hi @ritesh. I had some time and updated Sprite's example to work for ESP32 and the latest libesphttpd. You can find it here:
https://github.com/chmorgan/esphttpd-freertos
Thanks for Reply and valuable support for this.
I will check it in details and will get back to you if any issue or any query for that.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Who is online
Users browsing this forum: No registered users and 108 guests