{"id":584,"date":"2022-08-21T16:57:54","date_gmt":"2022-08-21T16:57:54","guid":{"rendered":"http:\/\/www.n4n.us\/wordpress\/?p=584"},"modified":"2022-08-29T23:33:38","modified_gmt":"2022-08-29T23:33:38","slug":"mqtt-how-simple","status":"publish","type":"post","link":"https:\/\/www.n4n.us\/wordpress\/?p=584","title":{"rendered":"MQTT &#8211; How simple &#8230;"},"content":{"rendered":"\n<p>Was able to add MQTT server using Mosquitto, as simple as they attempt to make it sound to setup and operate, it isn&#8217;t.  <\/p>\n\n\n\n<p>Using BREW to installed sounded simple, but never worked as all the instructions I could find. Doing a mix install using Brew and other installers I was able to get it working. You couldn&#8217;t just start and stop the service thru Brew you had to Force Quit using Activity Monitor, then use:<\/p>\n\n\n\n<p>\/usr\/local\/sbin\/mosquitto -c \/usr\/local\/etc\/mosquitto\/mosquitto.conf to restart.<\/p>\n\n\n\n<p>Adding users was confusing but after a few tries I got it working. <\/p>\n\n\n\n<p>mosquitto_passwd -b passwordfile admin mqttadmin1<\/p>\n\n\n\n<p>Monitoring the server was make very easy using MQTT Explorer, thought understanding the data was a bit more of a challenge.  Couldn&#8217;t tell when of of my devices was online or not, till about the 15th try. The it just showed up and started working.<\/p>\n\n\n\n<p>My first device was a weather station by Pimoroni:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-link is-provider-embed wp-block-embed-embed\"><div class=\"wp-block-embed__wrapper\">\n<a href=\"https:\/\/shop.pimoroni.com\/products\/enviro-weather-board-only?variant=40056047173715\">Enviro Weather (Pico W Aboard) &#8211; Board Only<\/a>\n<\/div><\/figure>\n\n\n\n<p>Having purchased the sensors a few years ago from SparkFun. When I finally saw the sweet data appear I was overjoyed. <\/p>\n\n\n\n<p>{<br>&#8220;device&#8221;: &#8220;nature-weather&#8221;,<br>&#8220;pressure&#8221;: 951.99,<br>&#8220;temperature&#8221;: 25.8,<br>&#8220;humidity&#8221;: 42.61,<br>&#8220;wind_direction&#8221;: 90,<br>&#8220;light&#8221;: 334.98,<br>&#8220;rain&#8221;: 0,<br>&#8220;timestamp&#8221;: &#8220;2022-08-21 15:51:03&#8221;,<br>&#8220;wind_speed&#8221;: 0<br>}<\/p>\n\n\n\n<p>My next project is using Red-node to display the data as it is published to my broker (Can&#8217;t understand why they don&#8217;t just call it a server).<\/p>\n\n\n\n<p>OH a note about Red-Note, don&#8217;t attempt to use Safari on a Mac, it doesn&#8217;t work. (See Photo Below) Wasted half an hour thinking i needed to install Modulars or something. Tried in chrome and it opened right up. Apple is become a real pain, IMHO.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"455\" height=\"1024\" src=\"https:\/\/www.n4n.us\/wordpress\/wp-content\/uploads\/2022\/08\/natureweather-455x1024.jpeg\" alt=\"\" class=\"wp-image-586\" srcset=\"https:\/\/www.n4n.us\/wordpress\/wp-content\/uploads\/2022\/08\/natureweather-455x1024.jpeg 455w, https:\/\/www.n4n.us\/wordpress\/wp-content\/uploads\/2022\/08\/natureweather-133x300.jpeg 133w, https:\/\/www.n4n.us\/wordpress\/wp-content\/uploads\/2022\/08\/natureweather-768x1727.jpeg 768w, https:\/\/www.n4n.us\/wordpress\/wp-content\/uploads\/2022\/08\/natureweather-scaled.jpeg 1138w\" sizes=\"auto, (max-width: 455px) 85vw, 455px\" \/><figcaption>Nature-Weather and Nature-Cam<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"475\" height=\"419\" src=\"https:\/\/www.n4n.us\/wordpress\/wp-content\/uploads\/2022\/08\/NodeRed.jpg\" alt=\"\" class=\"wp-image-590\" srcset=\"https:\/\/www.n4n.us\/wordpress\/wp-content\/uploads\/2022\/08\/NodeRed.jpg 475w, https:\/\/www.n4n.us\/wordpress\/wp-content\/uploads\/2022\/08\/NodeRed-300x265.jpg 300w\" sizes=\"auto, (max-width: 475px) 85vw, 475px\" \/><figcaption>Problem with Safari on Right VS Chrome on Left<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Was able to add MQTT server using Mosquitto, as simple as they attempt to make it sound to setup and operate, it isn&#8217;t. Using BREW to installed sounded simple, but never worked as all the instructions I could find. Doing a mix install using Brew and other installers I was able to get it working. &hellip; <a href=\"https:\/\/www.n4n.us\/wordpress\/?p=584\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;MQTT &#8211; How simple &#8230;&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42,21,38],"tags":[],"class_list":["post-584","post","type-post","status-publish","format-standard","hentry","category-macos","category-raspberry-pi","category-website-development"],"_links":{"self":[{"href":"https:\/\/www.n4n.us\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/584","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.n4n.us\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.n4n.us\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.n4n.us\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.n4n.us\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=584"}],"version-history":[{"count":4,"href":"https:\/\/www.n4n.us\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/584\/revisions"}],"predecessor-version":[{"id":593,"href":"https:\/\/www.n4n.us\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/584\/revisions\/593"}],"wp:attachment":[{"href":"https:\/\/www.n4n.us\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.n4n.us\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.n4n.us\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}