{"id":3102,"date":"2018-02-11T21:43:19","date_gmt":"2018-02-11T21:43:19","guid":{"rendered":"http:\/\/grodansparadis.com\/wordpress\/?p=3102"},"modified":"2021-05-19T11:28:39","modified_gmt":"2021-05-19T09:28:39","slug":"howto-minimum-vscp-wifi-level-ii-node-vscp-pid-detector","status":"publish","type":"post","link":"https:\/\/grodansparadis.com\/wordpress\/?p=3102","title":{"rendered":"Howto: Minimum VSCP wifi Level II node  (VSCP PID detector)"},"content":{"rendered":"<p>In this\u00a0 howto we will build a simple VSCP level II node that with the help of a PIR motion sensor detects motion and sends this as a VSCP event wireless to a VSCP daemon.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-09-12-02-43.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3103\" data-permalink=\"https:\/\/grodansparadis.com\/wordpress\/?attachment_id=3103\" data-orig-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-09-12-02-43.png?fit=618%2C566&amp;ssl=1\" data-orig-size=\"618,566\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot from 2018-02-09 12-02-43\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-09-12-02-43.png?fit=580%2C531&amp;ssl=1\" class=\"alignnone size-full wp-image-3103\" src=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-09-12-02-43.png?resize=580%2C531\" alt=\"\" width=\"580\" height=\"531\" srcset=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-09-12-02-43.png?w=618&amp;ssl=1 618w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-09-12-02-43.png?resize=300%2C275&amp;ssl=1 300w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>We use the famous ESP8266\u00a0 for this\u00a0 and work in the even more famous Arduino environment.\u00a0 The ESP8266 comes in many flavors but a convenient form factor is the <a href=\"https:\/\/www.google.se\/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;uact=8&amp;ved=0ahUKEwiX48OR1pjZAhUDh6YKHXtcBx4QFgiHATAA&amp;url=http%3A%2F%2Fwww.nodemcu.com%2Findex_en.html&amp;usg=AOvVaw24vvhapfoMR6gu7ZXzPFv2\">NodeMCU board<\/a>.\u00a0 You can buy it on <a href=\"https:\/\/www.aliexpress.com\/item\/ESP8266-ESP-12F-ESP-12-WIFI-CP2102-NodeMCU-Compatible-Development-Board-For-Arduino-Internet-of-Things\/32839648374.html?src=google&amp;albslr=201492522&amp;isdl=y&amp;aff_short_key=UneMJZVf&amp;source=%7Bifdyn:dyn%7D%7Bifpla:pla%7D%7Bifdbm:DBM&amp;albch=DID%7D&amp;src=google&amp;albch=shopping&amp;acnt=494-037-6276&amp;isdl=y&amp;albcp=995090329&amp;albag=49408234055&amp;slnk=&amp;trgt=388120373908&amp;plac=&amp;crea=en32839648374&amp;netw=g&amp;device=c&amp;mtctp=&amp;gclid=CjwKCAiAqvXTBRBuEiwAE54dcFpfwL57GoEZonQ5fLL0JbExrpiDiFOE8EZFEff0VIzqHCZ1XH_QxBoC-OkQAvD_BwE\">Aliexpress<\/a> or <a href=\"https:\/\/www.ebay.com\/itm\/ESP8266-ESP-12E-CH340G-WIFI-Network-Development-Board-Module-For-NodeMcu-Lua\/112230225390?epid=18012751789&amp;hash=item1a217155ee:g:ShQAAOSwImRYSTVS\">Ebay<\/a> at a low-cost (USD 2.2).<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-09-12-07-12.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3104\" data-permalink=\"https:\/\/grodansparadis.com\/wordpress\/?attachment_id=3104\" data-orig-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-09-12-07-12.png?fit=502%2C493&amp;ssl=1\" data-orig-size=\"502,493\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot from 2018-02-09 12-07-12\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-09-12-07-12.png?fit=502%2C493&amp;ssl=1\" class=\"alignnone size-full wp-image-3104\" src=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-09-12-07-12.png?resize=502%2C493\" alt=\"\" width=\"502\" height=\"493\" srcset=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-09-12-07-12.png?w=502&amp;ssl=1 502w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-09-12-07-12.png?resize=300%2C295&amp;ssl=1 300w\" sizes=\"auto, (max-width: 502px) 100vw, 502px\" \/><\/a><\/p>\n<p>There is also a baseboard available for the NodeMCU and I use it as it is convenient when working with a new design. It to is available on <a href=\"https:\/\/www.aliexpress.com\/item\/NodeMcu-Base-ESP8266-Testing-DIY-Breadboard-Plate-NEU\/32635663849.html?spm=2114.search0104.3.92.371235f2EQip6O&amp;ws_ab_test=searchweb0_0,searchweb201602_4_10152_10151_10065_10344_10068_10342_10343_10340_10341_10084_10083_10618_10307_10301_10303_5711211_5722312_10313_10059_10534_100031_10103_10624_10623_10622_10621_10620_10142,searchweb201603_19,ppcSwitch_5&amp;algo_expid=db9d119d-ba69-4d65-b6d0-c98a0455f843-13&amp;algo_pvid=db9d119d-ba69-4d65-b6d0-c98a0455f843&amp;transAbTest=ae803_5&amp;priceBeautifyAB=0\">Aliexpress<\/a> and <a href=\"https:\/\/www.ebay.com\/itm\/NodeMCU-Breakout-Base-Board-MCU-Module-ESP8266-V3-Breadboard-Plate-For-ESP-12E\/262760878152?hash=item3d2dc4d048:g:TNUAAOSwJ7RYT8g-\">Ebay<\/a> at a low-cost (USD 1.54).<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-09-12-09-50.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3105\" data-permalink=\"https:\/\/grodansparadis.com\/wordpress\/?attachment_id=3105\" data-orig-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-09-12-09-50.png?fit=495%2C495&amp;ssl=1\" data-orig-size=\"495,495\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot from 2018-02-09 12-09-50\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-09-12-09-50.png?fit=495%2C495&amp;ssl=1\" class=\"alignnone size-full wp-image-3105\" src=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-09-12-09-50.png?resize=495%2C495\" alt=\"\" width=\"495\" height=\"495\" srcset=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-09-12-09-50.png?w=495&amp;ssl=1 495w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-09-12-09-50.png?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-09-12-09-50.png?resize=300%2C300&amp;ssl=1 300w\" sizes=\"auto, (max-width: 495px) 100vw, 495px\" \/><\/a><\/p>\n<p>The last item you need is the PIR sensor, they to are available at low-cost. I bought mine from <a href=\"https:\/\/www.ebay.com\/itm\/Pyroelectric-Infrared-IR-PIR-Motion-Sensor-Detector-Module-HC-SR501\/162710819989?var=461729167878&amp;epid=19007219212&amp;hash=item25e2521495:g:1kIAAOSwA91Z3wJP\">Ebay<\/a> (USD 0.99).<\/p>\n<p>If you haven&#8217;t set up your Arduino IDE for work with the ESP8266 you need to do that now.\u00a0 <a href=\"http:\/\/www.instructables.com\/id\/Programming-ESP8266-ESP-12E-NodeMCU-Using-Arduino-\/\">Here is an excellent tutorial<\/a> on how to do this. Make the blink example work before you move on.<\/p>\n<p>I find the Arduino IDE a bit crude to work with so I use <a href=\"https:\/\/code.visualstudio.com\/\">Visual Studio Code<\/a> instead.\u00a0 An excellent programming editor that works on all the major operation systems. I tend to use it more and more. But there are other options to such as <a href=\"https:\/\/atom.io\/\">Atom<\/a>. Anyway instructions on how to get it working for Arduino development is <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=vsciot-vscode.vscode-arduino\">here<\/a>.\u00a0 Make sure to set the &#8220;output&#8221; tag to a valid location in the .vscode\/arduino.json file otherwise upload will be VERY slow.<\/p>\n<p>You also need a VSCP daemon\/server running for this example. All info about it is <a href=\"http:\/\/www.vscp.org\/docs\/vscpd\/doku.php\">here<\/a>.<\/p>\n<p>To connect the sensor to the NodeMCU we need to know about he port mapping for the module which is a bit different from for other Arduino devices. It looks like this<\/p>\n<pre class=\"code c\"><span class=\"kw4\">static<\/span> <span class=\"kw4\">const<\/span> <span class=\"kw4\">uint8_t<\/span> D0   <span class=\"sy0\">=<\/span> <span class=\"nu0\">16<\/span><span class=\"sy0\">;<\/span>\n<span class=\"kw4\">static<\/span> <span class=\"kw4\">const<\/span> <span class=\"kw4\">uint8_t<\/span> D1   <span class=\"sy0\">=<\/span> <span class=\"nu0\">5<\/span><span class=\"sy0\">;<\/span>\n<span class=\"kw4\">static<\/span> <span class=\"kw4\">const<\/span> <span class=\"kw4\">uint8_t<\/span> D2   <span class=\"sy0\">=<\/span> <span class=\"nu0\">4<\/span><span class=\"sy0\">;<\/span>\n<span class=\"kw4\">static<\/span> <span class=\"kw4\">const<\/span> <span class=\"kw4\">uint8_t<\/span> D3   <span class=\"sy0\">=<\/span> <span class=\"nu0\">0<\/span><span class=\"sy0\">;<\/span>\n<span class=\"kw4\">static<\/span> <span class=\"kw4\">const<\/span> <span class=\"kw4\">uint8_t<\/span> D4   <span class=\"sy0\">=<\/span> <span class=\"nu0\">2<\/span><span class=\"sy0\">;<\/span>\n<span class=\"kw4\">static<\/span> <span class=\"kw4\">const<\/span> <span class=\"kw4\">uint8_t<\/span> D5   <span class=\"sy0\">=<\/span> <span class=\"nu0\">14<\/span><span class=\"sy0\">;<\/span>\n<span class=\"kw4\">static<\/span> <span class=\"kw4\">const<\/span> <span class=\"kw4\">uint8_t<\/span> D6   <span class=\"sy0\">=<\/span> <span class=\"nu0\">12<\/span><span class=\"sy0\">;<\/span>\n<span class=\"kw4\">static<\/span> <span class=\"kw4\">const<\/span> <span class=\"kw4\">uint8_t<\/span> D7   <span class=\"sy0\">=<\/span> <span class=\"nu0\">13<\/span><span class=\"sy0\">;<\/span>\n<span class=\"kw4\">static<\/span> <span class=\"kw4\">const<\/span> <span class=\"kw4\">uint8_t<\/span> D8   <span class=\"sy0\">=<\/span> <span class=\"nu0\">15<\/span><span class=\"sy0\">;<\/span>\n<span class=\"kw4\">static<\/span> <span class=\"kw4\">const<\/span> <span class=\"kw4\">uint8_t<\/span> D9   <span class=\"sy0\">=<\/span> <span class=\"nu0\">3<\/span><span class=\"sy0\">;<\/span>\n<span class=\"kw4\">static<\/span> <span class=\"kw4\">const<\/span> <span class=\"kw4\">uint8_t<\/span> D10  <span class=\"sy0\">=<\/span> <span class=\"nu0\">1<\/span><span class=\"sy0\">;<\/span><\/pre>\n<p>D0 has a blue LED connected to it so it is an obvious candidate for status. D1 can be used to connect to the PIR<\/p>\n<p>The PIR device I have outputs a 3V signal even when powered with +5V so it is OK to connect directly to D1. So the three pins on the PIR<\/p>\n<pre>1\u00a0\u00a0\u00a0\u00a0 +5V\n2\u00a0\u00a0\u00a0\u00a0 Output to D1 (High on detect)\n3\u00a0\u00a0\u00a0\u00a0 GND<\/pre>\n<p>The LED on D0 light up when a LOW is written to it. This is opposite to the PIR output. We take care of this in software.<\/p>\n<p>We implement a dump VSCP device here. This is a device that does not handle any of the register reads that &#8220;normal&#8221; VSCP requires and which don&#8217;t have a MDF file either. A dumb device has bit 14 set in the header.<\/p>\n<p>We send two events. The heartbeat event (<a href=\"http:\/\/www.vscp.org\/docs\/vscpspec\/doku.php?id=class1.information#type_9_0x09_node_heartbeat\">CLASS1.INFORMATION, Type=9<\/a>) every minute. This event is recommended for all nodes as it is used for node discovery and detection. The other event we send is the detect event (<a href=\"http:\/\/www.vscp.org\/docs\/vscpspec\/doku.php?id=class1.information#type_49_0x31_detect\">CLASS1.INFORMATION, Type=49 detect<\/a>) when an object is detected.<\/p>\n<p>The test setup looks like this<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/IMG_20180209_141319149.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3109\" data-permalink=\"https:\/\/grodansparadis.com\/wordpress\/?attachment_id=3109\" data-orig-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/IMG_20180209_141319149.jpg?fit=3006%2C5344&amp;ssl=1\" data-orig-size=\"3006,5344\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;2&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;XT1562&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1518185598&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;4.67&quot;,&quot;iso&quot;:&quot;125&quot;,&quot;shutter_speed&quot;:&quot;0.03333&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"IMG_20180209_141319149\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/IMG_20180209_141319149.jpg?fit=576%2C1024&amp;ssl=1\" class=\"alignnone size-full wp-image-3109\" src=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/IMG_20180209_141319149.jpg?resize=580%2C1031\" alt=\"\" width=\"580\" height=\"1031\" srcset=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/IMG_20180209_141319149.jpg?w=3006&amp;ssl=1 3006w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/IMG_20180209_141319149.jpg?resize=169%2C300&amp;ssl=1 169w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/IMG_20180209_141319149.jpg?resize=768%2C1365&amp;ssl=1 768w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/IMG_20180209_141319149.jpg?resize=576%2C1024&amp;ssl=1 576w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/IMG_20180209_141319149.jpg?w=1160&amp;ssl=1 1160w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/IMG_20180209_141319149.jpg?w=1740&amp;ssl=1 1740w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>and you can find the complete code is <a href=\"https:\/\/github.com\/grodansparadis\/vscp-samples\/blob\/master\/samples\/arduino\/esp8266\/pir%20detector\/sketch_pir_detector.ino\" data-wplink-edit=\"true\">here<\/a><\/p>\n<p>The heartbeat coming into the VSCP daemon (using VSCP works)<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-11-22-28-04.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3110\" data-permalink=\"https:\/\/grodansparadis.com\/wordpress\/?attachment_id=3110\" data-orig-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-11-22-28-04.png?fit=1497%2C632&amp;ssl=1\" data-orig-size=\"1497,632\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot from 2018-02-11 22-28-04\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-11-22-28-04.png?fit=580%2C245&amp;ssl=1\" class=\"alignnone size-full wp-image-3110\" src=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-11-22-28-04.png?resize=580%2C245\" alt=\"\" width=\"580\" height=\"245\" srcset=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-11-22-28-04.png?w=1497&amp;ssl=1 1497w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-11-22-28-04.png?resize=300%2C127&amp;ssl=1 300w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-11-22-28-04.png?resize=768%2C324&amp;ssl=1 768w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-11-22-28-04.png?resize=1024%2C432&amp;ssl=1 1024w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-11-22-28-04.png?w=1160&amp;ssl=1 1160w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>and the detect event<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-11-22-28-23.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3111\" data-permalink=\"https:\/\/grodansparadis.com\/wordpress\/?attachment_id=3111\" data-orig-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-11-22-28-23.png?fit=1501%2C564&amp;ssl=1\" data-orig-size=\"1501,564\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot from 2018-02-11 22-28-23\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-11-22-28-23.png?fit=580%2C218&amp;ssl=1\" class=\"alignnone size-full wp-image-3111\" src=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-11-22-28-23.png?resize=580%2C218\" alt=\"\" width=\"580\" height=\"218\" srcset=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-11-22-28-23.png?w=1501&amp;ssl=1 1501w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-11-22-28-23.png?resize=300%2C113&amp;ssl=1 300w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-11-22-28-23.png?resize=768%2C289&amp;ssl=1 768w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-11-22-28-23.png?resize=1024%2C385&amp;ssl=1 1024w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2018\/02\/Screenshot-from-2018-02-11-22-28-23.png?w=1160&amp;ssl=1 1160w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>With the event in the VSCP daemon it is easy to add a DM row that for instance light up the lamps in a room. You can also use the rest or the websocket interface to do give visual feedback.<\/p>\n<p>We will follow-up this howto with a post where we use the Expressif SDK instead of the Arduino and use a plain ESP8266 board. But also a ost where we implement a full Level II node that have registers and a MDF and show the advantage we get with a node like that over a dumb one.<\/p>\n<p>An alternative wifi lib is documented <a href=\"https:\/\/diyprojects.io\/esp8266-web-client-tcp-ip-communication-examples-esp8266wifi-esp866httpclient\/#.WpAdNuYo_0o\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this\u00a0 howto we will build a simple VSCP level II node that with the help of a PIR motion sensor detects motion and sends this as a VSCP event wireless to a VSCP daemon. We use the famous ESP8266\u00a0 for this\u00a0 and work in the even more famous Arduino environment.\u00a0 The ESP8266 comes in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[53],"tags":[],"class_list":["post-3102","post","type-post","status-publish","format-standard","hentry","category-howtos"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4raCZ-O2","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3102"}],"version-history":[{"count":9,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3102\/revisions"}],"predecessor-version":[{"id":5083,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3102\/revisions\/5083"}],"wp:attachment":[{"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}