{"id":150,"date":"2026-03-15T13:04:34","date_gmt":"2026-03-15T12:04:34","guid":{"rendered":"https:\/\/elrebo.de\/?p=150"},"modified":"2026-03-15T13:05:12","modified_gmt":"2026-03-15T12:05:12","slug":"http_config_server","status":"publish","type":"post","link":"https:\/\/www.elrebo.de\/index.php\/2026\/03\/15\/http_config_server\/","title":{"rendered":"http_config_server"},"content":{"rendered":"\n<p>An ESP-IDF component for <a href=\"https:\/\/elrebo.de\/index.php\/2026\/02\/20\/physical-computing\/\">Physical Computing<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"block-c7f2a10d-f10d-4f44-99b3-ddb01659d218\">Purpose<\/h2>\n\n\n\n<p id=\"block-e5a9f4fc-abde-431c-807a-ac16505411d2\">Enter configuration parameters on a web page and store it in NVS flash memory for ESP32 systems.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"block-6892f2d3-e35e-4726-adb2-1b871f1297a2\">How it is done<\/h2>\n\n\n\n<p id=\"block-68239c84-e4e0-438a-ae06-3a6fb3a4d2e2\">You need to include<code>http_config_server.hpp<\/code>.<\/p>\n\n\n\n<p id=\"block-04e3da60-1b5e-44e4-b8e7-513486e89184\">After establishing a Wifi connection the\u00a0<code>HttpConfigServer<\/code>\u00a0class can be used.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"block-f58dbd72-b47c-4a85-8bd5-658bf352ac8b\">Where to find it<\/h2>\n\n\n\n<p id=\"block-11d88940-6f97-42da-af7a-c77fa57f8078\"><code>http_config_server<\/code> is published on the ESP Registry at <a href=\"https:\/\/components.espressif.com\/components\/elrebo-de\/http_config_server\">https:\/\/components.espressif.com\/components\/elrebo-de\/http_config_server<\/a>.<\/p>\n\n\n\n<p id=\"block-04470259-782e-47da-a448-0ce0b7e5f3ce\">The source code can be found at <a href=\"https:\/\/github.com\/elrebo-de\/http_config_server\">https:\/\/github.com\/elrebo-de\/http_config_server<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"block-ed37d27d-8eab-4b02-afa6-a88fdb12b5df\">How to use it<\/h2>\n\n\n\n<p id=\"block-5012e084-c0b9-4eb4-b4eb-4d9702c9f78f\">As an ESP-IDF component <code>http_config_server<\/code> must be included into idf_component.yml as a dependency. As usual this can be done by executing this command:<\/p>\n\n\n\n<p id=\"block-9c6944ee-94b4-4feb-bf45-e83ac50cb66c\"><code>idf.py add-dependency \"elrebo-de\/http_config_server^1.1.3\"<\/code><\/p>\n\n\n\n<p id=\"block-5753f62d-164e-422b-aafc-640b23a2dbb4\">Now you can include <code>http_config_server.hpp<\/code> and use the HttpConfigServer class in your program.<\/p>\n\n\n\n<p id=\"block-c2631bd9-c018-437f-978c-1a6be6318139\">The HttpConfigServer class is implemented as a Singleton. With this code it is initialized:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"405\" src=\"https:\/\/elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-12.39.31-1024x405.png\" alt=\"\" class=\"wp-image-153\" srcset=\"https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-12.39.31-1024x405.png 1024w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-12.39.31-300x119.png 300w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-12.39.31-768x304.png 768w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-12.39.31.png 1442w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The Wifi connection is set up with <code>elrebo-de\/wifi_manager<\/code>. <\/p>\n\n\n\n<p>Then the pointer to the <code>HttpConfigServer<\/code> instance is retrieved with <code>getInstance()<\/code> and the method <code>initialize<\/code> is called.<\/p>\n\n\n\n<p id=\"block-843b28c1-b3f4-44a5-9681-2e5c608796e3\">The next step is to declare the config parameters. This is done with method <code>addStringParameter<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"311\" src=\"https:\/\/elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-12.47.09-1024x311.png\" alt=\"\" class=\"wp-image-154\" srcset=\"https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-12.47.09-1024x311.png 1024w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-12.47.09-300x91.png 300w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-12.47.09-768x233.png 768w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-12.47.09-1536x466.png 1536w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-12.47.09-2048x621.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p id=\"block-a59d7f6d-1728-4c18-b1cf-a911cea17a82\">Here four parameters are declared.<\/p>\n\n\n\n<p id=\"block-be0335d2-36a3-4a68-9267-72d26ef945d4\">The last step is to call method <code>isConfigured()<\/code> which does the magic.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"319\" src=\"https:\/\/elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-13.00.24-1024x319.png\" alt=\"\" class=\"wp-image-156\" srcset=\"https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-13.00.24-1024x319.png 1024w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-13.00.24-300x93.png 300w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-13.00.24-768x239.png 768w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-13.00.24.png 1272w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>It returns <code>true<\/code> when all configuration parameters have been assigned a value, which is stored in NVS flash memory.<\/p>\n\n\n\n<p>If any parameter has no value yet, it starts the HTTP configuration server and returns <code>false<\/code>.<\/p>\n\n\n\n<p>The user opens a browser and navigates to the configuration server page, e.g.: <code>http:\/\/192.168.178.146\/config<\/code> where the configuration parameters can be entered.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"481\" src=\"https:\/\/elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-12.17.21-1024x481.png\" alt=\"\" class=\"wp-image-155\" srcset=\"https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-12.17.21-1024x481.png 1024w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-12.17.21-300x141.png 300w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-12.17.21-768x361.png 768w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-12.17.21-1536x722.png 1536w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-12.17.21-2048x962.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>When all parameters are set, method <code>isConfigured()<\/code> returns <code>true<\/code> and the values can be retrieved with method <code>getStringParameterValue<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\" id=\"block-0e6dff1c-6a26-4127-bb52-13aa6eebf078\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"417\" src=\"https:\/\/elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-13.01.51-1024x417.png\" alt=\"\" class=\"wp-image-157\" srcset=\"https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-13.01.51-1024x417.png 1024w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-13.01.51-300x122.png 300w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-13.01.51-768x312.png 768w, https:\/\/www.elrebo.de\/wp-content\/uploads\/2026\/03\/Bildschirmfoto-2026-03-15-um-13.01.51.png 1396w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p id=\"block-cd06d9fc-3d75-4ba3-928f-e844bb711148\">The next time the program is run, the config parameters are taken from NVS flash memory, no user interaction is needed and the HTTP configuration server is not used.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>An ESP-IDF component for Physical Computing Purpose Enter configuration parameters on a web page and store it in NVS flash memory for ESP32 systems. How it is done You need to includehttp_config_server.hpp. After establishing a Wifi connection the\u00a0HttpConfigServer\u00a0class can be used. Where to find it http_config_server is published on the ESP Registry at https:\/\/components.espressif.com\/components\/elrebo-de\/http_config_server. The [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":155,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-150","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oss"],"_links":{"self":[{"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/posts\/150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/comments?post=150"}],"version-history":[{"count":2,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/posts\/150\/revisions"}],"predecessor-version":[{"id":158,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/posts\/150\/revisions\/158"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/media\/155"}],"wp:attachment":[{"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/media?parent=150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/categories?post=150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.elrebo.de\/index.php\/wp-json\/wp\/v2\/tags?post=150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}