{"id":583,"date":"2021-09-30T14:09:11","date_gmt":"2021-09-30T05:09:11","guid":{"rendered":"https:\/\/rfsec.ddns.net\/db\/?p=583"},"modified":"2021-09-30T14:09:13","modified_gmt":"2021-09-30T05:09:13","slug":"bme280%e3%82%bb%e3%83%b3%e3%82%b5%e3%83%bc%e3%81%aeexporter","status":"publish","type":"post","link":"https:\/\/rfsec.ddns.net\/db\/?p=583","title":{"rendered":"BME280\u30bb\u30f3\u30b5\u30fc\u306eexporter"},"content":{"rendered":"\n<p><a href=\"https:\/\/github.com\/ashtreefarms\/bme280-exporter\">https:\/\/github.com\/ashtreefarms\/bme280-exporter<\/a><\/p>\n\n\n\n<p>CPU\u304crock Pi4\u306e\u5834\u5408\u3001I2C\u30d0\u30b9\u756a\u53f7\u304c\uff17\u306a\u306e\u3067\u3001\u4e00\u90e8\u4fee\u6b63\u304c\u5fc5\u8981<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>$ \/home\/mars\/.pyenv\/versions\/3.8.10\/bin\/bme280_exporter -a 0x76\n2021-09-30 14:07:43,226 - initializing BME280 at 0x76 filter: 0 oversampling(h: 4, p: 4, t: 4)\n2021-09-30 14:07:43,259 - initializing exporter with labels None\n2021-09-30 14:07:43,260 - starting exporter on port 9500\n2021-09-30 14:07:43,267 - starting sampling with 2.0s interval\n2021-09-30 14:07:43,295 - temp: 30.31 C   humidity: 0.00%   pressure: 998.05 hPa\n2021-09-30 14:07:45,302 - temp: 30.33 C   humidity: 0.00%   pressure: 998.02 hPa\n2021-09-30 14:07:47,310 - temp: 30.34 C   humidity: 0.00%   pressure: 998.01 hPa<\/code><\/pre><\/div>\n\n\n\n<p>\u4fee\u6b63\u7b87\u6240\u3000Adafruit_GPIO\/I2C.py<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>def get_default_bus():\n    &quot;&quot;&quot;Return the default bus number based on the device platform.  For a\n    Raspberry Pi either bus 0 or 1 (based on the Pi revision) will be returned.\n    For a Beaglebone Black the first user accessible bus, 1, will be returned.\n    &quot;&quot;&quot;\n    return 7<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>Usage<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>$ bme280_exporter -h\nusage: bme280_exporter [-h] [-v] [-p PORT] [-a ADDRESS] [-l LABELS]\n                       [-i INTERVAL] [-f FILTER] [-ho HO] [-po PO] [-to TO]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -v, --verbose         increase output verbosity\n  -p PORT, --port PORT  exporter port (default: 9500\n  -a ADDRESS, --address ADDRESS\n                        BME280 I2C address (default: 0x77)\n  -l LABELS, --labels LABELS\n                        JSON object of Prometheus labels to apply\n  -i INTERVAL, --interval INTERVAL\n                        measurement sample interval (default: 2)\n  -f FILTER, --filter FILTER\n                        filter value to apply (0-4, default: 0)\n  -ho HO                humidity oversampling value (1-5, default: 4)\n  -po PO                pressure oversampling value (1-5, default: 4)\n  -to TO                temperature oversampling value (1-5, default: 4)\n<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/github.com\/ashtreefarms\/bme280-exporter CPU\u304crock Pi4\u306e\u5834\u5408\u3001I2C\u30d0\u30b9\u756a\u53f7\u304c\uff17\u306a\u306e\u3067\u3001\u4e00\u90e8\u4fee\u6b63\u304c\u5fc5\u8981 \u4fee\u6b63\u7b87\u6240\u3000Adafruit_GPIO\/I2C.py [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-583","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"featured_image_src":null,"author_info":{"display_name":"mars","author_link":"https:\/\/rfsec.ddns.net\/db\/?author=1"},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/posts\/583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=583"}],"version-history":[{"count":3,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/posts\/583\/revisions"}],"predecessor-version":[{"id":599,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/posts\/583\/revisions\/599"}],"wp:attachment":[{"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}