{"id":98,"date":"2015-09-13T17:43:41","date_gmt":"2015-09-13T17:43:41","guid":{"rendered":"http:\/\/www.spants.com\/blog\/?p=98"},"modified":"2022-05-09T16:42:01","modified_gmt":"2022-05-09T16:42:01","slug":"iotbox-instructions-for-use","status":"publish","type":"post","link":"http:\/\/www.spants.com\/blog\/iotbox-instructions-for-use\/","title":{"rendered":"IoTBox: Instructions for use"},"content":{"rendered":"<p>When power is applied to the IoTBox, it will try to connect to the stored WiFi access point and will show the IP address on the screen if successful. The screen will show an error message if it cannot connect.<\/p>\n<p>The IoTBox uses two WiFi modes simultaneously:<\/p>\n<ol>\n<li><strong>Client Mode<\/strong> = It will connect to an Access Point.<\/li>\n<li><strong>Access Point Mode<\/strong> = It will behave as an Access Point.<\/li>\n<\/ol>\n<p>To configure the IoTBox, look for an open network with the same ID as shown on the OLED display, it will be similar to &#8220;iotbox00fcf9ab&#8221;.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.spants.com\/blog\/wp-content\/uploads\/2015\/09\/Screen-Shot-2015-09-13-at-17.45.33.png\"><img loading=\"lazy\" class=\"size-medium wp-image-100 alignright\" src=\"https:\/\/i0.wp.com\/www.spants.com\/blog\/wp-content\/uploads\/2015\/09\/Screen-Shot-2015-09-13-at-17.45.33.png?resize=300%2C258\" alt=\"IoTBox Menu\" width=\"300\" height=\"258\" srcset=\"https:\/\/i0.wp.com\/www.spants.com\/blog\/wp-content\/uploads\/2015\/09\/Screen-Shot-2015-09-13-at-17.45.33.png?resize=300%2C258 300w, https:\/\/i0.wp.com\/www.spants.com\/blog\/wp-content\/uploads\/2015\/09\/Screen-Shot-2015-09-13-at-17.45.33.png?w=627 627w\" sizes=\"(max-width: 300px) 100vw, 300px\" data-recalc-dims=\"1\" \/><\/a>When connected, your PC\/Mac or Phone will have an address of 192.168.4.2 and the IoTBox menu will be found at http:\/\/192.168.4.1.<\/p>\n<p>The first thing to do is to upgrade to the latest version of the <a href=\"https:\/\/i0.wp.com\/www.spants.com\/blog\/wp-content\/uploads\/2015\/09\/Screen-Shot-2015-09-13-at-18.01.17.png\"><img loading=\"lazy\" class=\"size-medium wp-image-103 alignright\" src=\"https:\/\/i0.wp.com\/www.spants.com\/blog\/wp-content\/uploads\/2015\/09\/Screen-Shot-2015-09-13-at-18.01.17.png?resize=300%2C238\" alt=\"WiFi Settings\" width=\"300\" height=\"238\" srcset=\"https:\/\/i0.wp.com\/www.spants.com\/blog\/wp-content\/uploads\/2015\/09\/Screen-Shot-2015-09-13-at-18.01.17.png?resize=300%2C238 300w, https:\/\/i0.wp.com\/www.spants.com\/blog\/wp-content\/uploads\/2015\/09\/Screen-Shot-2015-09-13-at-18.01.17.png?w=624 624w\" sizes=\"(max-width: 300px) 100vw, 300px\" data-recalc-dims=\"1\" \/><\/a>IoTBox firmware. For this, you will need to be connected to an external Access Point chosen on the WiFi settings page and then select OTA Upgrade. The IoTBox will download the updated firmware and then reboot into the new version.<\/p>\n<p>The ESP8266 on the IoTBox is configured as two slots. The OTA firmware is downloaded and stored in the other slot. If it has downloaded correctly, it will reboot into the other slot. You may switch back to the old version by using the Switch ROM menu option.<\/p>\n<p>If you have configured something that is causing an issue with the IoTBox, you can reset it using the button (wired to GPIO0). The button on the IoTBox has three functions:<\/p>\n<ol>\n<li>If the button is held down while powering on, you can update the firmware on the chip with a programmer. This is only required when putting the initial firmware on the chip.<\/li>\n<li>If the button is pressed for more than 0.5 seconds and less than 10 seconds (2 seconds is ideal), a message is sent to the button MQTT topic.<\/li>\n<li>If the button is pressed for more than 10 seconds, the settings are cleared to the default values. You will need to set the WiFi and MQTT parameters again.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h2>MQTT Topics<\/h2>\n<p>IoTBox has an MQTT v3.1 client built into the firmware and is the main way of communicating to other systems. When MQTT is enabled, it will try to connect every 10 seconds and when successful, it will post &#8220;online&#8217; to the LWT topic.<a href=\"https:\/\/i0.wp.com\/www.spants.com\/blog\/wp-content\/uploads\/2015\/09\/Screen-Shot-2015-09-13-at-18.18.47.png\"><img loading=\"lazy\" class=\"size-medium wp-image-109 aligncenter\" src=\"https:\/\/i0.wp.com\/www.spants.com\/blog\/wp-content\/uploads\/2015\/09\/Screen-Shot-2015-09-13-at-18.18.47.png?resize=300%2C242\" alt=\"MQTT Menu\" width=\"300\" height=\"242\" srcset=\"https:\/\/i0.wp.com\/www.spants.com\/blog\/wp-content\/uploads\/2015\/09\/Screen-Shot-2015-09-13-at-18.18.47.png?resize=300%2C242 300w, https:\/\/i0.wp.com\/www.spants.com\/blog\/wp-content\/uploads\/2015\/09\/Screen-Shot-2015-09-13-at-18.18.47.png?w=691 691w\" sizes=\"(max-width: 300px) 100vw, 300px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>The following topics are supported:<\/p>\n<p><em>Note: MQTT can use wildcards, such as &#8216;+&#8217;. This means that a subscription to &#8216;+\/out\/led\/1&#8217; will pick up data for &#8216;iotbox00112233\/out\/led\/1&#8217; and &#8216;iotbox56229922\/out\/led\/1&#8217;. This is useful when sending\u00a0 the same information to many devices.<\/em><\/p>\n<p><strong>LED<\/strong>: For the example shown above, the IoTBox is listening on:<\/p>\n<ul>\n<li style=\"text-align: left;\">+\/out\/led\/1<\/li>\n<li style=\"text-align: left;\">+\/out\/led\/2<\/li>\n<li style=\"text-align: left;\">+\/out\/led\/3<\/li>\n<\/ul>\n<p>A payload of &#8216;0&#8217; or &#8216;1&#8217;\u00a0 to these topics switches the LED colour (red, green or blue) off or on. This will likely change in the future to support PWM and a single Topic.<\/p>\n<p><strong>DISPLAY<\/strong>: For the example shown above, the IoTBox is listening on:<\/p>\n<ul>\n<li style=\"text-align: left;\">+\/out\/display\/0<\/li>\n<li style=\"text-align: left;\">+\/out\/display\/1<\/li>\n<li style=\"text-align: left;\">+\/out\/display\/2<\/li>\n<li style=\"text-align: left;\">+\/out\/display\/3<\/li>\n<li style=\"text-align: left;\">+\/out\/display\/4<\/li>\n<\/ul>\n<p>A payload of upto 20 characters will be displayed on lines 3-8 on the OLED screen. Useful for notifications and information.<\/p>\n<p><strong>BUTTON: <\/strong>A button press creates a payload of &#8216;1&#8217; on the Topic.<\/p>\n<p><strong>TEMPERATURE:<\/strong> Readings from the sensor (DS18B20 or DHT22) are sent every 10 seconds to this topic.<\/p>\n<p><strong>HUMIDITY: <\/strong>Readings from a DHT22 (if connected) are sent every 10 seconds).<\/p>\n<p><strong>LAST WILL &amp; TESTAMENT:<\/strong> When the IoTBox is connected to MQTT, a payload of &#8216;online&#8217; is sent to this Topic. The MQTT server will send &#8216;offline&#8217; if it does not receive a heartbeat from IoTBox.<\/p>\n<p>The best way of exploring how IoTBox uses these Topics is to use the MQTT-SPY application found at <a href=\"http:\/\/kamilfb.github.io\/mqtt-spy\/\" target=\"_blank\" rel=\"noopener\">MQTT-SPY Homepage.<\/a><\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-98\" class=\"share-twitter sd-button share-icon no-text\" href=\"http:\/\/www.spants.com\/blog\/iotbox-instructions-for-use\/?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Twitter (Opens in new window)<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-98\" class=\"share-facebook sd-button share-icon no-text\" href=\"http:\/\/www.spants.com\/blog\/iotbox-instructions-for-use\/?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Facebook (Opens in new window)<\/span><\/a><\/li><li class=\"share-reddit\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-reddit sd-button share-icon no-text\" href=\"http:\/\/www.spants.com\/blog\/iotbox-instructions-for-use\/?share=reddit\" target=\"_blank\" title=\"Click to share on Reddit\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Reddit (Opens in new window)<\/span><\/a><\/li><li class=\"share-email\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-email sd-button share-icon no-text\" href=\"http:\/\/www.spants.com\/blog\/iotbox-instructions-for-use\/?share=email\" target=\"_blank\" title=\"Click to email this to a friend\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to email this to a friend (Opens in new window)<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>When power is applied to the IoTBox, it will try to connect to the stored WiFi access point and will show the IP address on the screen if successful. The screen will show an error message if it cannot connect. The IoTBox uses two WiFi modes simultaneously: Client Mode = It will connect to an &hellip; <a href=\"http:\/\/www.spants.com\/blog\/iotbox-instructions-for-use\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">IoTBox: Instructions for use<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-98\" class=\"share-twitter sd-button share-icon no-text\" href=\"http:\/\/www.spants.com\/blog\/iotbox-instructions-for-use\/?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Twitter (Opens in new window)<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-98\" class=\"share-facebook sd-button share-icon no-text\" href=\"http:\/\/www.spants.com\/blog\/iotbox-instructions-for-use\/?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Facebook (Opens in new window)<\/span><\/a><\/li><li class=\"share-reddit\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-reddit sd-button share-icon no-text\" href=\"http:\/\/www.spants.com\/blog\/iotbox-instructions-for-use\/?share=reddit\" target=\"_blank\" title=\"Click to share on Reddit\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Reddit (Opens in new window)<\/span><\/a><\/li><li class=\"share-email\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-email sd-button share-icon no-text\" href=\"http:\/\/www.spants.com\/blog\/iotbox-instructions-for-use\/?share=email\" target=\"_blank\" title=\"Click to email this to a friend\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to email this to a friend (Opens in new window)<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[4,2],"tags":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6n7xT-1A","_links":{"self":[{"href":"http:\/\/www.spants.com\/blog\/wp-json\/wp\/v2\/posts\/98"}],"collection":[{"href":"http:\/\/www.spants.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.spants.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.spants.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.spants.com\/blog\/wp-json\/wp\/v2\/comments?post=98"}],"version-history":[{"count":12,"href":"http:\/\/www.spants.com\/blog\/wp-json\/wp\/v2\/posts\/98\/revisions"}],"predecessor-version":[{"id":265,"href":"http:\/\/www.spants.com\/blog\/wp-json\/wp\/v2\/posts\/98\/revisions\/265"}],"wp:attachment":[{"href":"http:\/\/www.spants.com\/blog\/wp-json\/wp\/v2\/media?parent=98"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.spants.com\/blog\/wp-json\/wp\/v2\/categories?post=98"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.spants.com\/blog\/wp-json\/wp\/v2\/tags?post=98"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}