{"id":594,"date":"2017-07-11T21:31:33","date_gmt":"2017-07-11T21:31:33","guid":{"rendered":"https:\/\/test.warrensoft.co.uk\/wp-test\/home-hub\/?p=594"},"modified":"2018-12-08T07:29:27","modified_gmt":"2018-12-08T07:29:27","slug":"controller-bme280-installation","status":"publish","type":"post","link":"https:\/\/test.warrensoft.co.uk\/wp-test\/2017\/07\/11\/controller-bme280-installation\/","title":{"rendered":"Controller &#8211; BME280 Installation"},"content":{"rendered":"<p>Once you have your BME280 sensor assembled you need to fetch the python scripts to talk to it, but first we need to prepare the pi to enable the serial interface for this purpose.<\/p>\n<p>By default, the serial interface is available for console login, so this needs to be disabled.<\/p>\n<pre>sudo raspi-config<\/pre>\n<p>choose option 5 &#8211; Interfacing Options, and option P6 &#8211; Serial.<\/p>\n<p><em>Would you like a login shell to be accessible over serial<\/em>? Answer No.<\/p>\n<p><em>Would you like the serial port hardware to be enabled<\/em>? Answer Yes.<\/p>\n<p>Exit raspi-config, but don&#8217;t reboot just yet as we have a number of other changes to make first.<\/p>\n<p>Disable the getty service:<\/p>\n<pre>sudo systemctl disable serial-getty@ttyAMA0.service<\/pre>\n<p>Install python serial&#8230;<\/p>\n<pre>sudo apt-get install python-serial<\/pre>\n<p>Add the following files to the controller&#8230;<\/p>\n<pre>wget -nH -x --cut-dirs=3 -P \/usr\/local\/bin\/code\/controller\/ -i \/usr\/local\/bin\/code\/controller\/manifest6.txt http:\/\/www.warrensoft.co.uk\/home-hub\/manifests\/controller\/manifest6.txt<\/pre>\n<p>uncomment the bme280 sensor in \/sensor_helpers\/__init__.py<\/p>\n<p>and reboot the pi.<\/p>\n<p>You can now check the serial port is available with the following:<\/p>\n<pre> ls -l \/dev<\/pre>\n<p>and you should see the following alias:<\/p>\n<p>serial0 -&gt; ttyAMA0<\/p>\n<p>Now it should be safe to connect your sensor module to the pi. \u00a0If you do this before completing the configuration you may have connection issues, as the pi is interpreting your module as a login. \u00a0Note that the Pi TXD (BCM 14) connects to the modules Rx line and Pi RXD (BCM 15)\u00a0connects to the modules Tx line. The remaining connections are just 3v3 Power and Ground.\u00a0I recommend you shutdown and power-down to make these connections.<\/p>\n<p>Add a new sensor using the website Organisation page, and set the sensor function to:<\/p>\n<p>bme280.\/dev\/serial0.4800.0<\/p>\n<p>This function is constructed from 4 parts:<\/p>\n<p style=\"padding-left: 30px;\">helper . serial-port . baudrate . channel<\/p>\n<p style=\"padding-left: 30px;\">The serial port is \/dev\/serial0 which is an alias to the ttyAMA0 port we are connected to.<\/p>\n<p style=\"padding-left: 30px;\">The baud rate is fixed in the picaxe program, at 4800, which works well in my setup.<\/p>\n<p style=\"padding-left: 30px;\">The channel is a value of 0 &#8211; Temperature, 1 &#8211; Atmospheric Pressure or 2 &#8211; Relative Humidity.<\/p>\n<p>With your new sensor configured you should be all set to take readings.<\/p>\n<p>In the next post I will cover interfacing to the Amazon Dash button.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Once you have your BME280 sensor assembled you need to fetch the python scripts to talk to it, but first we need to prepare the pi to enable the serial interface for this purpose. By default, the serial interface is available for console login, so this needs to be disabled. sudo raspi-config choose option 5 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/test.warrensoft.co.uk\/wp-test\/2017\/07\/11\/controller-bme280-installation\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Controller &#8211; BME280 Installation&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-594","post","type-post","status-publish","format-standard","hentry","category-hub-software-controller"],"_links":{"self":[{"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/posts\/594","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/comments?post=594"}],"version-history":[{"count":11,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/posts\/594\/revisions"}],"predecessor-version":[{"id":673,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/posts\/594\/revisions\/673"}],"wp:attachment":[{"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/media?parent=594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/categories?post=594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/tags?post=594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}