{"id":157,"date":"2015-12-11T00:01:31","date_gmt":"2015-12-10T22:01:31","guid":{"rendered":"http:\/\/iot.fkainka.de\/?p=157"},"modified":"2018-10-24T16:04:09","modified_gmt":"2018-10-24T15:04:09","slug":"day-11","status":"publish","type":"post","link":"https:\/\/iot.fkainka.de\/en\/day-11","title":{"rendered":"Day 11: TCP-Webserver"},"content":{"rendered":"<p>In the previous experiments, we dealt with the subject of TCP and access to web servers a lot. Today, the module is to act as a web server of its own for the first time.<\/p>\n<p>Behind the door of the 11th day, there is a special cable that will be very useful soon. A special setup is not necessary today, since the program works similarly to the serial monitor programme of day one.<\/p>\n<p><strong>The program:\u00a0<a href=\"http:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day11_TCPServer.zip\">Day11_TCPServer<\/a><\/strong><\/p>\n<p>Change the WLAN data as before and load the program onto your board. Then start the monitor. It may take a few seconds before the message that the board is connected appears. When the success message has appeared and the IP of the module is displayed, you can start with the first command in the Serial Monitor:<\/p>\n<p><strong>AT+CIPMUX=1<\/strong><\/p>\n<p>This command permits multiple connections to the module. You can then access the web server from several computers. Use the next command to start the web server:<\/p>\n<p><strong>AT+CIPSERVER=1,80<\/strong><\/p>\n<p>The parameter 1 means that the server is being started. 0 terminates a server again. The number 80 represents the port under which the server can be reached. HTTP requests sent by the browser are generally sent through port 80.<\/p>\n<p>You can now open a browser of your choice and enter the IP of your module into the address bar and call it. The browser initially shows a loading message, but the Serial Monitor will show a change. You can see a request query similar to the one you have sent out manually before.<\/p>\n<div id=\"attachment_159\" style=\"width: 656px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day11-1.jpeg\"><img aria-describedby=\"caption-attachment-159\" decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-159\" src=\"http:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day11-1.jpeg\" alt=\"Die Browser-Anfrage\" width=\"646\" height=\"574\" srcset=\"https:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day11-1.jpeg 646w, https:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day11-1-300x267.jpeg 300w\" sizes=\"(max-width: 646px) 100vw, 646px\" \/><\/a><p id=\"caption-attachment-159\" class=\"wp-caption-text\">The browser query<\/p><\/div>\n<p>The browser now waits for a response, and will show a loading sign until then, or until the connection is interrupted due to time-out. You can send a message to the browser with a version of a familiar command:<\/p>\n<p><strong>AT+CIPSEND=0,7<\/strong><\/p>\n<p>The parameter 0 indicates the client to which the message is to be sent here. This is necessary because multiple connections are permitted and several clients may therefore also be connected. The second parameter, here 7, again indicates the characters to be sent. &gt; appears, and you can enter a simple<\/p>\n<p><strong>Hello<\/strong><\/p>\n<p>and send it out with Enter. Nothing will change in your browser at first. You need to close the connection before this can happen. For this, use the command:<\/p>\n<p><strong>AT+CIPCLOSE=0<\/strong><\/p>\n<p>Now you can see a Hello in the browser. You have implemented the first webserver application.<\/p>","protected":false},"excerpt":{"rendered":"<p>In the previous experiments, we dealt with the subject of TCP and access to web servers a lot. Today, the module is to act as a web server of its own for the first time. Behind the door of the&#8230;<br \/><a class=\"read-more-button\" href=\"https:\/\/iot.fkainka.de\/en\/day-11\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":159,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[3,26,311],"tags":[4,13,106,12],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Day 11: TCP-Webserver - Internet of Things with the NanoESP<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/iot.fkainka.de\/day-11\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Day 11: TCP-Webserver - Internet of Things with the NanoESP\" \/>\n<meta property=\"og:description\" content=\"In the previous experiments, we dealt with the subject of TCP and access to web servers a lot. Today, the module is to act as a web server of its own for the first time. Behind the door of the...Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/iot.fkainka.de\/day-11\" \/>\n<meta property=\"og:site_name\" content=\"Internet of Things with the NanoESP\" \/>\n<meta property=\"article:published_time\" content=\"2015-12-10T22:01:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-10-24T15:04:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day11-1.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"646\" \/>\n\t<meta property=\"og:image:height\" content=\"574\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"fk\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"fk\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/iot.fkainka.de\/day-11\",\"url\":\"https:\/\/iot.fkainka.de\/day-11\",\"name\":\"Day 11: TCP-Webserver - Internet of Things with the NanoESP\",\"isPartOf\":{\"@id\":\"https:\/\/iot.fkainka.de\/#website\"},\"datePublished\":\"2015-12-10T22:01:31+00:00\",\"dateModified\":\"2018-10-24T15:04:09+00:00\",\"author\":{\"@id\":\"https:\/\/iot.fkainka.de\/#\/schema\/person\/d3205fdf2649027fc35e240d4f8b285a\"},\"breadcrumb\":{\"@id\":\"https:\/\/iot.fkainka.de\/day-11#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/iot.fkainka.de\/day-11\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/iot.fkainka.de\/day-11#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/iot.fkainka.de\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tag 11: TCP Webserver\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/iot.fkainka.de\/#website\",\"url\":\"https:\/\/iot.fkainka.de\/\",\"name\":\"Internet of Things with the NanoESP\",\"description\":\"The webpage for the Arduino compatible WiFi-Board\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/iot.fkainka.de\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/iot.fkainka.de\/#\/schema\/person\/d3205fdf2649027fc35e240d4f8b285a\",\"name\":\"fk\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/iot.fkainka.de\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/141cf958a831e66efabf9674e117e8d9?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/141cf958a831e66efabf9674e117e8d9?s=96&d=identicon&r=g\",\"caption\":\"fk\"},\"url\":\"https:\/\/iot.fkainka.de\/en\/author\/fk\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Day 11: TCP-Webserver - Internet of Things with the NanoESP","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/iot.fkainka.de\/day-11","og_locale":"en_US","og_type":"article","og_title":"Day 11: TCP-Webserver - Internet of Things with the NanoESP","og_description":"In the previous experiments, we dealt with the subject of TCP and access to web servers a lot. Today, the module is to act as a web server of its own for the first time. Behind the door of the...Read more","og_url":"https:\/\/iot.fkainka.de\/day-11","og_site_name":"Internet of Things with the NanoESP","article_published_time":"2015-12-10T22:01:31+00:00","article_modified_time":"2018-10-24T15:04:09+00:00","og_image":[{"width":646,"height":574,"url":"https:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day11-1.jpeg","type":"image\/jpeg"}],"author":"fk","twitter_card":"summary_large_image","twitter_misc":{"Written by":"fk","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/iot.fkainka.de\/day-11","url":"https:\/\/iot.fkainka.de\/day-11","name":"Day 11: TCP-Webserver - Internet of Things with the NanoESP","isPartOf":{"@id":"https:\/\/iot.fkainka.de\/#website"},"datePublished":"2015-12-10T22:01:31+00:00","dateModified":"2018-10-24T15:04:09+00:00","author":{"@id":"https:\/\/iot.fkainka.de\/#\/schema\/person\/d3205fdf2649027fc35e240d4f8b285a"},"breadcrumb":{"@id":"https:\/\/iot.fkainka.de\/day-11#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/iot.fkainka.de\/day-11"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/iot.fkainka.de\/day-11#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/iot.fkainka.de\/"},{"@type":"ListItem","position":2,"name":"Tag 11: TCP Webserver"}]},{"@type":"WebSite","@id":"https:\/\/iot.fkainka.de\/#website","url":"https:\/\/iot.fkainka.de\/","name":"Internet of Things with the NanoESP","description":"The webpage for the Arduino compatible WiFi-Board","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/iot.fkainka.de\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/iot.fkainka.de\/#\/schema\/person\/d3205fdf2649027fc35e240d4f8b285a","name":"fk","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/iot.fkainka.de\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/141cf958a831e66efabf9674e117e8d9?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/141cf958a831e66efabf9674e117e8d9?s=96&d=identicon&r=g","caption":"fk"},"url":"https:\/\/iot.fkainka.de\/en\/author\/fk"}]}},"jetpack_featured_media_url":"https:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day11-1.jpeg","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6McI0-2x","_links":{"self":[{"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/posts\/157"}],"collection":[{"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/comments?post=157"}],"version-history":[{"count":5,"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/posts\/157\/revisions"}],"predecessor-version":[{"id":583,"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/posts\/157\/revisions\/583"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/media\/159"}],"wp:attachment":[{"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/media?parent=157"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/categories?post=157"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/tags?post=157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}