{"id":1651,"date":"2018-05-09T11:45:44","date_gmt":"2018-05-09T11:45:44","guid":{"rendered":"http:\/\/easycoding.tn\/?page_id=1651"},"modified":"2018-05-09T12:07:05","modified_gmt":"2018-05-09T12:07:05","slug":"iot-server","status":"publish","type":"page","link":"http:\/\/easycoding.tn\/index.php\/nodemcu\/tuniot-documentation\/iot\/iot-server\/","title":{"rendered":"IOT Server"},"content":{"rendered":"<ul>\n<li><strong>Start Server<\/strong>:<br \/>\nWill make the board run a server and listening (or waiting for incoming requests) on the specified port.<br \/>\nParameter: Port &#8211; Type : <strong><span style=\"color: #00ff00;\">Number<\/span><\/strong>.<br \/>\n<a href=\"https:\/\/www.youtube.com\/watch?v=Ntzrnsz0MQM\">Video tutorial<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>Client IP<\/strong>:<br \/>\nReturns the IP address of the connected client.<br \/>\nReturn type: <strong><span style=\"color: #00ff00;\">String<\/span><\/strong>.<br \/>\n<a href=\"https:\/\/www.youtube.com\/watch?v=Ntzrnsz0MQM\">Video tutorial<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>Server read request<\/strong>:<br \/>\nReturns the incoming HTTP request. You should put it after the wait connection bloc.<br \/>\nReturn type: <span style=\"color: #00ff00;\"><strong>String<\/strong><\/span>.<br \/>\n<a href=\"https:\/\/www.youtube.com\/watch?v=Ntzrnsz0MQM\"> Video tutorial<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>Answer<\/strong>:<br \/>\nThis bloc will answer any incoming request with a HTML page containing the parameter text. It could be a simple text or the value of a sensor.<br \/>\n<a href=\"https:\/\/www.youtube.com\/watch?v=Ntzrnsz0MQM\">Video tutorial<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>Wait connection<\/strong>:<br \/>\nThis bloc will wait for any incoming request. You should put it in the main loop.<br \/>\n<a href=\"https:\/\/www.youtube.com\/watch?v=Ntzrnsz0MQM\">Video tutorial<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>Client flush<\/strong>:<br \/>\nDiscard any bytes that have been written to the client but not yet read.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Start Server: Will make the board run a server and listening (or waiting for incoming requests) on the specified port.&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1080,"menu_order":4,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"http:\/\/easycoding.tn\/index.php\/wp-json\/wp\/v2\/pages\/1651"}],"collection":[{"href":"http:\/\/easycoding.tn\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/easycoding.tn\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/easycoding.tn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/easycoding.tn\/index.php\/wp-json\/wp\/v2\/comments?post=1651"}],"version-history":[{"count":8,"href":"http:\/\/easycoding.tn\/index.php\/wp-json\/wp\/v2\/pages\/1651\/revisions"}],"predecessor-version":[{"id":1659,"href":"http:\/\/easycoding.tn\/index.php\/wp-json\/wp\/v2\/pages\/1651\/revisions\/1659"}],"up":[{"embeddable":true,"href":"http:\/\/easycoding.tn\/index.php\/wp-json\/wp\/v2\/pages\/1080"}],"wp:attachment":[{"href":"http:\/\/easycoding.tn\/index.php\/wp-json\/wp\/v2\/media?parent=1651"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}