{"id":100,"date":"2015-12-03T00:01:45","date_gmt":"2015-12-02T22:01:45","guid":{"rendered":"http:\/\/iot.fkainka.de\/?p=100"},"modified":"2018-10-24T16:04:10","modified_gmt":"2018-10-24T15:04:10","slug":"day-3","status":"publish","type":"post","link":"https:\/\/iot.fkainka.de\/en\/day-3","title":{"rendered":"Day 3: UDP-Send"},"content":{"rendered":"<p>In today&#8217;s project, data are exchanged between the board and the PC through the WLAN for the first time. The prerequisite for this is that your computer has a WLAN adapter. The UDP (User Datagram Protocol) is used. Another program on the PC-side ensures successful receipt of the messages.<\/p>\n<p>Behind the third door of the calendar, you can find an insulated cable that you will need to build circuits. To prepare for later experiments, you can place the supply lines ground and VCC on the outer tracks.<\/p>\n<div id=\"attachment_102\" style=\"width: 626px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day3-1.jpg\"><img aria-describedby=\"caption-attachment-102\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-102\" src=\"http:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day3-1-1024x528.jpg\" alt=\"Die Versorgungsleitungen auf den \u00e4u\u00dferen Bahnen\" width=\"616\" height=\"318\" srcset=\"https:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day3-1-1024x528.jpg 1024w, https:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day3-1-300x155.jpg 300w, https:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day3-1-972x501.jpg 972w\" sizes=\"(max-width: 616px) 100vw, 616px\" \/><\/a><p id=\"caption-attachment-102\" class=\"wp-caption-text\">VCC and GND for easy acces<\/p><\/div>\n<p><strong>The program:\u00a0<a href=\"http:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day3_UPDBasics.zip\">Day3_UPDBasics<\/a><\/strong><\/p>\n<p>When you load the program onto the controller, the controller is configured as an access point and you should see an open network called NanoESP. Before connecting to the network, first download another program from the Internet. In my experiments, I used the programme Packet Sender by Dan Nagle which you can download from the following link:<\/p>\n<p><a href=\"https:\/\/www.packetsender.com\/\">https:\/\/packetsender.com\/<\/a><\/p>\n<p>After loading and installing the program, you can connect your PC to the open network of the NanoESP. Ensure that the firewall recognises the network as a home network, to avoid blocking data. Your computer should now have the IP 192.168.4.2. You can check this by sending the command<\/p>\n<p><strong>AT+CWLIF<\/strong><\/p>\n<p>to the module via the serial monitor. This command shows all computers connected to the access point with IP and MAC addresses.<br \/>\nStart the program Packet Sender; set the UDP server port to 90 in Settings-&gt;Network and click the check box &#8220;Enable UDP Server&#8221;. Usually, the lower left should say UDP:90. If it does not, you need to restart the software once.<\/p>\n<div id=\"attachment_105\" style=\"width: 881px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day3-3.jpeg\"><img aria-describedby=\"caption-attachment-105\" decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-105\" src=\"http:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day3-3.jpeg\" alt=\"Einstellungen im Packet Sender\" width=\"871\" height=\"590\" srcset=\"https:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day3-3.jpeg 871w, https:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day3-3-300x203.jpeg 300w, https:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day3-3-148x100.jpeg 148w\" sizes=\"(max-width: 871px) 100vw, 871px\" \/><\/a><p id=\"caption-attachment-105\" class=\"wp-caption-text\">The right settings<\/p><\/div>\n<p><em>! Attention: Some MAC-Users reportet a bug in the PacketSender-Software. This bug doesn&#8217;t allow you to change the ports. If you have problems with this bug you can change the ports in the Arduino program. All you have to do for todays project is to change the line 55 from<\/em><br \/>\n<strong><em>succes &amp;= sendCom(&#8220;AT+CIPSTART=\\&#8221;UDP\\&#8221;,\\&#8221;192.168.4.2\\&#8221;,90&#8243;, &#8220;OK&#8221;); \/\/UDP-Server<\/em><\/strong><br \/>\n<em>to <\/em><br \/>\n<strong><em>succes &amp;= sendCom(&#8220;AT+CIPSTART=\\&#8221;UDP\\&#8221;,\\&#8221;192.168.4.2\\&#8221;,5505&#8243;, &#8220;OK&#8221;); \/\/UDP-Server<\/em><\/strong><\/p>\n<p>The program on the computer is now used as UDP server, while the controller is set as UDP client. The differentiation between client and server is not clear in the UDP protocol, but in this case it means that you will send data from your controller to the computer.<\/p>\n<p>To send data, use the command:<\/p>\n<p><strong>AT+CIPSEND=7<\/strong><\/p>\n<div id=\"attachment_106\" style=\"width: 565px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day3-4.jpeg\"><img aria-describedby=\"caption-attachment-106\" decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-106\" src=\"http:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day3-4.jpeg\" alt=\"Verwendung des CIPSEND-Befehls\" width=\"555\" height=\"592\" srcset=\"https:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day3-4.jpeg 555w, https:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day3-4-281x300.jpeg 281w\" sizes=\"(max-width: 555px) 100vw, 555px\" \/><\/a><p id=\"caption-attachment-106\" class=\"wp-caption-text\">Use the CIPSEND command<\/p><\/div>\n<p>The 7 means the number of characters to be sent. The character &gt; is returned. This means that you can now send your message. Enter Hello and confirm with Enter again. The module returns SEND OK, although you have only entered five characters. This is because after your input Carriage Return and New Line are sent as well, i.e. two characters more that you need to include in your message length calculation.<\/p>\n<div id=\"attachment_103\" style=\"width: 740px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day3-5.jpeg\"><img aria-describedby=\"caption-attachment-103\" decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-103\" src=\"http:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day3-5.jpeg\" alt=\"Die Nachricht wurde vom Packet Sender Programm empfangen\" width=\"730\" height=\"603\" srcset=\"https:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day3-5.jpeg 730w, https:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day3-5-300x248.jpeg 300w\" sizes=\"(max-width: 730px) 100vw, 730px\" \/><\/a><p id=\"caption-attachment-103\" class=\"wp-caption-text\">The programm recieved the message<\/p><\/div>\n<p>When you switch back to the Packet Sender and look at Log Traffic there, you can see the receipt of the message. In the ASCII view, you will even see the two enclosed characters, represented by \\r and \\n. Therefore the first communication between board and PC via the WLAN has been successful.<\/p>","protected":false},"excerpt":{"rendered":"<p>In today&#8217;s project, data are exchanged between the board and the PC through the WLAN for the first time. The prerequisite for this is that your computer has a WLAN adapter. The UDP (User Datagram Protocol) is used. Another program&#8230;<br \/><a class=\"read-more-button\" href=\"https:\/\/iot.fkainka.de\/en\/day-3\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":103,"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":[9,4,5,106],"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 3: UDP-Send - 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-3\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Day 3: UDP-Send - Internet of Things with the NanoESP\" \/>\n<meta property=\"og:description\" content=\"In today&#8217;s project, data are exchanged between the board and the PC through the WLAN for the first time. The prerequisite for this is that your computer has a WLAN adapter. The UDP (User Datagram Protocol) is used. Another program...Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/iot.fkainka.de\/day-3\" \/>\n<meta property=\"og:site_name\" content=\"Internet of Things with the NanoESP\" \/>\n<meta property=\"article:published_time\" content=\"2015-12-02T22:01:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-10-24T15:04:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day3-5.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"730\" \/>\n\t<meta property=\"og:image:height\" content=\"603\" \/>\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=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/iot.fkainka.de\/day-3\",\"url\":\"https:\/\/iot.fkainka.de\/day-3\",\"name\":\"Day 3: UDP-Send - Internet of Things with the NanoESP\",\"isPartOf\":{\"@id\":\"https:\/\/iot.fkainka.de\/#website\"},\"datePublished\":\"2015-12-02T22:01:45+00:00\",\"dateModified\":\"2018-10-24T15:04:10+00:00\",\"author\":{\"@id\":\"https:\/\/iot.fkainka.de\/#\/schema\/person\/d3205fdf2649027fc35e240d4f8b285a\"},\"breadcrumb\":{\"@id\":\"https:\/\/iot.fkainka.de\/day-3#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/iot.fkainka.de\/day-3\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/iot.fkainka.de\/day-3#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/iot.fkainka.de\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tag 3: UDP-Send\"}]},{\"@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 3: UDP-Send - 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-3","og_locale":"en_US","og_type":"article","og_title":"Day 3: UDP-Send - Internet of Things with the NanoESP","og_description":"In today&#8217;s project, data are exchanged between the board and the PC through the WLAN for the first time. The prerequisite for this is that your computer has a WLAN adapter. The UDP (User Datagram Protocol) is used. Another program...Read more","og_url":"https:\/\/iot.fkainka.de\/day-3","og_site_name":"Internet of Things with the NanoESP","article_published_time":"2015-12-02T22:01:45+00:00","article_modified_time":"2018-10-24T15:04:10+00:00","og_image":[{"width":730,"height":603,"url":"https:\/\/iot.fkainka.de\/wp-content\/uploads\/2015\/09\/Day3-5.jpeg","type":"image\/jpeg"}],"author":"fk","twitter_card":"summary_large_image","twitter_misc":{"Written by":"fk","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/iot.fkainka.de\/day-3","url":"https:\/\/iot.fkainka.de\/day-3","name":"Day 3: UDP-Send - Internet of Things with the NanoESP","isPartOf":{"@id":"https:\/\/iot.fkainka.de\/#website"},"datePublished":"2015-12-02T22:01:45+00:00","dateModified":"2018-10-24T15:04:10+00:00","author":{"@id":"https:\/\/iot.fkainka.de\/#\/schema\/person\/d3205fdf2649027fc35e240d4f8b285a"},"breadcrumb":{"@id":"https:\/\/iot.fkainka.de\/day-3#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/iot.fkainka.de\/day-3"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/iot.fkainka.de\/day-3#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/iot.fkainka.de\/"},{"@type":"ListItem","position":2,"name":"Tag 3: UDP-Send"}]},{"@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\/Day3-5.jpeg","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6McI0-1C","_links":{"self":[{"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/posts\/100"}],"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=100"}],"version-history":[{"count":9,"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/posts\/100\/revisions"}],"predecessor-version":[{"id":635,"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/posts\/100\/revisions\/635"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/media\/103"}],"wp:attachment":[{"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/media?parent=100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/categories?post=100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iot.fkainka.de\/en\/wp-json\/wp\/v2\/tags?post=100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}