{"id":7665,"date":"2017-02-01T04:09:42","date_gmt":"2017-01-31T20:09:42","guid":{"rendered":"http:\/\/www.ifroglab.com\/?p=7665"},"modified":"2017-03-17T02:27:50","modified_gmt":"2017-03-16T18:27:50","slug":"ifroglab-lora-gateway-docker-container","status":"publish","type":"post","link":"https:\/\/www.ifroglab.com\/tw\/?p=7665","title":{"rendered":"02, iFrogLab LoRa Gateway, Docker Container"},"content":{"rendered":"<p>iFrogLab\u7684\u00a0LoRa Gateway\u73fe\u5728\u63d0\u4f9b Docker Container\uff0c<\/p>\n<p>\u8b93\u4f7f\u7528LoRa USB \u00a0Dongle \u7684\u958b\u767c\u8005\u548c\u7528\u6236\uff0c<\/p>\n<p>\u53ef\u4ee5\u5728\u5f88\u5feb\u7684\u6642\u9593\u5167\uff0c\u5c31\u80fd\u5c31\u67b6\u8a2d\u597d\u4e00\u500bLoRa Gateway<\/p>\n<p>\u53ef\u4ee5<a href=\"https:\/\/hub.docker.com\/r\/ifroglab\/loragateway\/\">\u5728Docker Hub \u9019\u88e1<\/a>\u53d6\u5f97<\/p>\n<h2>\u5167\u5bb9\u6709\uff1a<\/h2>\n<ul>\n<li>LoRa\u00a0Gateway \u7684Service \u00a0Python \u00a0Server \u00a0\u7a0b\u5f0f\uff0c\u5728\u80cc\u666f\u8655\u7406LoRa \u8cc7\u6599\u50b3\u905e\u3002<\/li>\n<li>Dashboard \u986f\u793aLoRa \u6240\u50b3\u904e\u4f86\u7684\u8cc7\u6599\u00a0http:\/\/localhost\/index.php \u4f4d\u7f6e\u5728\/var\/www\/html\/<\/li>\n<li>PHP \u7528Apache2\u7db2\u9801\u986f\u793aDashboard\u7684\u7a0b\u5f0f<\/li>\n<li>MySQL \u5132\u5b58LoRa \u4f86\u7684\u8cc7\u6599, \u5e33\u865fifroglab \u5bc6\u78bcifroglab<\/li>\n<li>myphpadmin\u00a0\u7ba1\u7406\u8cc7\u6599\u5eab, http:\/\/localhost\/myphpadmin \u00a0 \u5e33\u865froot \u5bc6\u78bcroot<\/li>\n<li>MQTT \uff0c\u53ea\u8981\u900f\u904e\u4ee5\u4e0b\u6307\u4ee4\uff0c\u5c31\u80fd\u53d6\u7684gateway \u7684MQTT\u8cc7\u6599\uff0c\u53ea\u8981\u4e0a\u7db2\u5c31\u53ef\u4ee5\u5728iOS, Android, Windows, MAC, Linux \u00a0\u90fd\u53ef\u4ee5\u53ca\u6642\u62ff\u5230LoRa \u8cc7\u6599\uff0c<br \/>\n$ mosquitto_sub -d -t ifroglab\/mqtt -h test.mosquitto.org -h test.mosquitto.org<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7666\" src=\"http:\/\/www.ifroglab.com\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-01-31-at-11.59.42-AM.png\" alt=\"Screen Shot 2017-01-31 at 11.59.42 AM\" width=\"620\" height=\"336\" srcset=\"https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-01-31-at-11.59.42-AM.png 1250w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-01-31-at-11.59.42-AM-600x325.png 600w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-01-31-at-11.59.42-AM-300x163.png 300w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-01-31-at-11.59.42-AM-768x417.png 768w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-01-31-at-11.59.42-AM-1024x555.png 1024w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><\/p>\n<h2>\u4f7f\u7528\u6548\u679c\uff1a<\/h2>\n<p>\u4ee5\u4e0b\u662f\u6253\u958b\u5f8c\uff0c\u8acb\u900f\u904e\u7db2\u9801\u9023\u63a5\u5230http:\/\/\u8a72\u7db2\u8def\u4f4d\u7f6e\uff0c\u5c31\u80fd\u770b\u5230\u5982\u4e0b\u5716\u7684\u6548\u679c\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7877\" src=\"http:\/\/www.ifroglab.com\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-02-14-at-11.15.30-PM-1024x733.png\" alt=\"Screen Shot 2017-02-14 at 11.15.30 PM\" width=\"720\" height=\"515\" srcset=\"https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-02-14-at-11.15.30-PM-1024x733.png 1024w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-02-14-at-11.15.30-PM-600x429.png 600w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-02-14-at-11.15.30-PM-300x215.png 300w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-02-14-at-11.15.30-PM-768x549.png 768w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-02-14-at-11.15.30-PM.png 1188w\" sizes=\"(max-width: 720px) 100vw, 720px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7878\" src=\"http:\/\/www.ifroglab.com\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-02-15-at-10.48.31-PM.png\" alt=\"Screen Shot 2017-02-15 at 10.48.31 PM\" width=\"720\" height=\"432\" srcset=\"https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-02-15-at-10.48.31-PM.png 737w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-02-15-at-10.48.31-PM-600x360.png 600w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-02-15-at-10.48.31-PM-300x180.png 300w\" sizes=\"(max-width: 720px) 100vw, 720px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7675\" src=\"http:\/\/www.ifroglab.com\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-02-01-at-12.08.49-PM.png\" alt=\"Screen Shot 2017-02-01 at 12.08.49 PM\" width=\"720\" height=\"582\" srcset=\"https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-02-01-at-12.08.49-PM.png 793w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-02-01-at-12.08.49-PM-600x485.png 600w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-02-01-at-12.08.49-PM-300x242.png 300w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-02-01-at-12.08.49-PM-768x621.png 768w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-02-01-at-12.08.49-PM-110x90.png 110w\" sizes=\"(max-width: 720px) 100vw, 720px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2>\u4f7f\u7528\u65b9\u6cd5\uff1a<\/h2>\n<p>1.\u8acb\u5148\u5b89\u88ddDocker \u5728\u60a8\u7684Linux \u74b0\u5883\u4e2d\uff0c\u53ef\u4ee5\u53c3\u8003\u6b64\u5f71\u7247\u3002<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/CdUTFvx_wRg\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>2. \u900f\u904e\u4ee5\u4e0b\u7684\u6307\u4ee4\uff0c\u4e0b\u8f09iFrogLab Docker image<br \/>\n$\u00a0sudo docker pull ifroglab\/loragateway:latest<\/p>\n<p>3. \u00a0\u8acb\u628aiFrogLab LoRa USB \u63a5\u5230\u8a72\u8a2d\u5099\uff0c\u4e26\u78ba\u5b9als \/dev\/ttyACM0 \u00a0\u53ef\u4ee5\u770b\u8a72\u8a2d\u5099<\/p>\n<p>4. \u900f\u904e\u4ee5\u4e0b\u7684\u6307\u4ee4\uff0c\u57f7\u884ciFrogLab Docker image<br \/>\n$ sudo docker run -p 80:80 -p 3306:3306 &#8211;device=\/dev\/ttyACM0 -i -t ifroglab\/loragateway:latest \/loragateway.sh<\/p>\n<p>5.\u900f\u904e\u700f\u89bd\u5668\u3002\u6253\u958b\u8a72\u8a2d\u5099\u7684IP \u00a0\u4f8b\u5982\u00a0<a href=\"http:\/\/localhost\/\">http:\/\/localhost<\/a> \u5c31\u80fd\u770b\u5230\u4e86\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>MQTT \u8a2d\u5b9a<\/h2>\n<h3>\u4ec0\u9ebc\u662fMQTT?<\/h3>\n<p>\u5982\u679c\u8981\u4f7f\u7528MQTT (\u4e00\u7a2e\u53ca\u6642\u901a\u8a0a\u7684\u65b9\u6cd5\uff0c\u5c31\u50cf\u662fLine \u4e00\u6a23\uff0c\u99ac\u4e0a\u5c31\u80fd\u62ff\u5230\u8cc7\u6599)<\/p>\n<h3>\u5728\u4f60\u7684\u96fb\u8166\u5b89\u88ddMQTT \uff1a<\/h3>\n<p>Linux lnstall<br \/>\n$ sudo apt-get install mosquitto mosquitto-clients<br \/>\nLinux Get iFrogLab LoRa Gateway MQTT message<br \/>\n$ mosquitto_sub -d -t ifroglab\/mqtt -h test.mosquitto.org<\/p>\n<p>Mac Install<br \/>\n$ brew install mosquitto<br \/>\nMac Get iFrogLab LoRa Gateway MQTT message<br \/>\n$ mosquitto_sub -d -t ifroglab\/mqtt -h test.mosquitto.org<\/p>\n<p>Android, iOS, Raspberry Pi , Linux \u7b49\uff0c\u53ef\u4ee5\u53c3\u8003<a href=\"http:\/\/cheng-min-i-taiwan.blogspot.com\/2015\/03\/raspberry-pimqtt-android.html\">\u6b64\u6587\u7ae0<\/a>\u3002<br \/>\n\u66f4\u591a\u5176\u4ed6\u5e73\u53f0\u7684\u8a2d\u5b9a\uff0c\u53ef\u4ee5\u770b\u5b98\u65b9\u8a2d\u5b9a<a href=\"https:\/\/mosquitto.org\/download\/\">\u9019\u88e1<\/a>\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>\u5982\u679c\u8981\u63a5\u6536MQTT \u7684\u8cc7\u6599\uff1a<\/h3>\n<p>\u6211\u5011\u6703\u628aLoRa \u6240\u6536\u5230\u7684\u8cc7\u6599\uff0c\u900f\u904e test.mosquitto.org \u7684\u7fa4\u7d44ifroglab\/mqtt \u9001\u51fa\uff0c<\/p>\n<p>\u6240\u4ee5\u53ea\u8981\u900f\u904eMQTT Mosquitto\u00a0\u5c31\u80fd\u6536\u5230\uff0c\u4f8b\u5982<\/p>\n<p>mosquitto_sub -d -t ifroglab\/mqtt -h test.mosquitto.org<\/p>\n<p>&nbsp;<\/p>\n<h3>\u5982\u679c\u8981\u4fee\u6539MQTT \u7684\u540d\u7a31\uff1a<\/h3>\n<p>\u8acb\u628a\u6a94\u6848 ap-01-lora-gateway-2-read-httpGet.py \u6253\u958b\u627e\u4e00\u4e0b<\/p>\n<p>mqtt=&#8221; mosquitto_pub -d -t ifroglab\/mqtt \u00a0-m &#8216;%s&#8217; -h test.mosquitto.org&#8221;%(HexString);<\/p>\n<p>\u628aifroglab\/mqtt \u6539\u6210\u4f60\u8981\u7684\u540d\u7a31\uff0c\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>iFrogLab\u7684\u00a0LoRa Gateway\u73fe\u5728\u63d0\u4f9b Docker Contai [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":7666,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[97],"tags":[],"class_list":["post-7665","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-01-ifroglab-lora-gateway"],"_links":{"self":[{"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=\/wp\/v2\/posts\/7665"}],"collection":[{"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7665"}],"version-history":[{"count":10,"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=\/wp\/v2\/posts\/7665\/revisions"}],"predecessor-version":[{"id":8193,"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=\/wp\/v2\/posts\/7665\/revisions\/8193"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=\/wp\/v2\/media\/7666"}],"wp:attachment":[{"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}