{"id":2196,"date":"2016-05-29T18:06:46","date_gmt":"2016-05-29T09:06:46","guid":{"rendered":"https:\/\/hack.gpl.jp\/?p=2196"},"modified":"2016-05-29T18:06:46","modified_gmt":"2016-05-29T09:06:46","slug":"post-2196","status":"publish","type":"post","link":"https:\/\/hack.gpl.jp\/2016\/05\/29\/post-2196.html","title":{"rendered":"Soracom \u3067 IoT \u306f\u3058\u3081\u307e\u3057\u305f"},"content":{"rendered":"<\/p>\n

\u79fb\u52d5\u3057\u3066\u3044\u308b\u4e2d\u3001IoT \u30c7\u30fc\u30bf\u3092\u9001\u4fe1\u3057\u305f\u3044\u306a\u3068\u3002\u3053\u306e\u5834\u5408\u3001WIFI \u304c\u306a\u3044\u3093\u3067\u3059\u3088\u306d\u3002<\/p>\n

IoT \u30c7\u30d0\u30a4\u30b9\u304b\u3089\u306f\u30d6\u30eb\u30fc\u30c8\u30a5\u30fc\u30b9\u3084WiFi \u3067\u30cd\u30c3\u30c8\u7d4c\u7531\u3078\u30c7\u30fc\u30bf\u306f\u51fa\u305b\u308b\u306e\u3067\u3059\u304c\u3001\u3069\u3053\u3067\u3082\u3001\u6295\u3052\u305f\u3044\u306e\u3067 Soracom Air \u306e SIM \u3092\u4f7f\u3044\u59cb\u3081\u307e\u3057\u305f\u3002<\/p>\n

 <\/p>\n

\"soracom_air\"<\/a> <\/p>\n

\u96fb\u6ce2\u304c\u5c4a\u304f\u7bc4\u56f2\u306a\u3089\u3001\u3069\u3053\u3067\u3082\u3001\u30c7\u30fc\u30bf\u3092\u6295\u3052\u3066\u8a18\u9332\u304c\u53d6\u308c\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u307e\u305a\u306f\u683c\u5b89\u306e Linux \u30dc\u30fc\u30c9\u3067 Soracom \u306b\u63a5\u7d9a\u3057\u5358\u7d14\u306a\u30c7\u30fc\u30bf\u3092\u9001\u4fe1\u3059\u308b\u3068\u3053\u308d\u307e\u3067\u3084\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n

\u4eca\u56de\u306e\u76ee\u6a19\u306f\u3001\u300cSoracom \u7d4c\u7531\u3067\u3001Linux \u306e CPU  \u6e29\u5ea6\u3092 ThingSpeak \u306b\u9001\u4fe1\u3057\u30b0\u30e9\u30d5\u5316\u3055\u305b\u308b\u300d\u306e\u304c\u76ee\u6a19\u3067\u3059\u3002<\/p>\n

ThingSpeak \u3068\u306f\u3001IoT \u30c7\u30fc\u30bf\u3092\u8a18\u9332\u3057\u3001\u30b0\u30e9\u30d5\u8868\u793a\u3059\u308bWEB\u30b5\u30fc\u30d3\u30b9\u3067\u3059\u3002\u3053\u306e\u30b5\u30fc\u30d3\u30b9\u306f\u3001\u81ea\u524d\u3067\u3082\u69cb\u7bc9\u53ef\u80fd<\/a>\u3067\u3059\u306e\u3067\u6700\u7d42\u7684\u306b\u306f\u30c7\u30fc\u30bf\u84c4\u7a4d\u3059\u308b\u30b5\u30fc\u30d0\u3092\u69cb\u7bc9\u3057\u3066\u3082\u826f\u3055\u305d\u3046\u3067\u3059\u3002<\/p>\n

\u3053\u308c\u304c\u5b9f\u73fe\u3067\u304d\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b0\u30e9\u30d5\u304c\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u8a18\u9332\u3055\u308c\u307e\u3059\u3002<\/p>\n

\"test_-_ThingSpeak\"<\/p>\n

\u3053\u308c\u3092\u5b9f\u73fe\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u6e96\u5099\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n

 <\/p>\n

\u30fbLinux \u30dc\u30fc\u30c9\u306e\u6e96\u5099\u3068\u3001\u305d\u306e OS \u306e\u9078\u5b9a<\/p>\n

\u30fbsoracom sim \u306e\u6e96\u5099\u3068 Linux \u5074\u304b\u3089 PPP \u63a5\u7d9a\u3059\u308b\u305f\u3081\u306e USB \u30e2\u30c7\u30e0\u306e\u8a2d\u5b9a<\/p>\n

\u30fbCPU \u6e29\u5ea6\u3092\u53d6\u5f97\u3057\u3066 thingspeak \u306b\u30c7\u30fc\u30bf\u3092\u6295\u3052\u308b\u30b9\u30af\u30ea\u30d7\u30c8<\/p>\n

\u30fbthingspeak \u5074\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306a\u3069\u306e\u6e96\u5099<\/p>\n

\u6700\u7d42\u7684\u306b\u306f\u3001\u81ea\u7acb\u3057\u3066\u7a3c\u52d5\u3055\u305b\u305f\u3044\u306e\u3067\u96fb\u6e90\u5468\u308a\u3092\u3069\u3046\u3057\u3088\u3046\u304b\u8ab2\u984c\u306f\u6b8b\u308a\u307e\u3059\u3002<\/p>\n

\u30fb\u72ec\u7acb\u3057\u305f\u96fb\u6e90\u307e\u308f\u308a\u306e\u6e96\u5099<\/p>\n

\u30fb\u96fb\u6e90\u306b\u5145\u96fb\u3055\u305b\u308b\u4ed5\u7d44<\/p>\n

 <\/p>\n

\u4eca\u56de Soracom \u7d4c\u7531\u3067\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u306b\u63a5\u7d9a\u306b\u5229\u7528\u3059\u308b\u6bcd\u8266\u306e Linux \u30dc\u30fc\u30c9\u306f\u3001Orange Pi PC \u3067\u3059\u3002\u30e9\u30ba\u30d9\u30ea\u30fc\u30d1\u30a4\u306f\u3001\u4fa1\u683c\u306f5000\u5186\u524d\u5f8c\u3057\u307e\u3059\u306e\u3067\u5c4b\u5916\u3067\u3076\u3063\u58ca\u308c\u305f\u3068\u304d\u306b\u30b7\u30e7\u30c3\u30af\u306a\u306e\u3067\u3001\u30b3\u30b9\u30c8\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u826f\u3044 Orange Pi \u3067\u3084\u308b\u3053\u3068\u306b\u3002<\/p>\n

 <\/p>\n

Orange Pi<\/a> \u30b7\u30ea\u30fc\u30ba\u306f\u3001\u904e\u53bb\u306b\u3082\u7d39\u4ecb\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u7a2e\u985e\u304c\u7d50\u69cb\u3042\u308a\u307e\u3059\u3002\u6700\u8fd1\u767a\u58f2\u3055\u308c\u305f WiFi \u304c\u4ed8\u3044\u3066\u3055\u3089\u306b\u683c\u5b89\u306e Orange Pi Lite<\/a> \u3068\u3044\u3046\u3082\u306e\u3082\u3042\u308a\u307e\u3059\u3002\u3053\u3061\u3089\u306f\u7d041700\u5186\u7a0b\u5ea6\u3067\u8cfc\u5165\u3067\u304d\u307e\u3059\u3002\u4eba\u67f1\u7684\u306b\u3001\u3053\u306e\u30dc\u30fc\u30c9\u3082\u5165\u624b\u4e2d\u3067\u3059\u306e\u3067\u3001\u5230\u7740\u3057\u305f\u3089\u6539\u3081\u3066\u30ec\u30dd\u30fc\u30c8\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n

 <\/p>\n

\u3055\u3066\u3001soracom \u3068 3G \u901a\u4fe1\u3059\u308b\u305f\u3081\u306b\u30e2\u30c7\u30e0\u304c\u5fc5\u8981\u3067\u3059\u304c\u3001LG\u30a8\u30ec\u30af\u30c8\u30ed\u30cb\u30af\u30b9\u30fb\u30b8\u30e3\u30d1\u30f3\u88fd\u3067\u3001OEM \u3067\u306f DoCoMo \u304b\u3089\u51fa\u3066\u3044\u308b L-05A \u3092\u4f7f\u3044\u307e\u3057\u305f\u3002amazon \u3067\u4e2d\u53e4\u3067\u30b2\u30c3\u30c8\u3057\u307e\u3057\u305f\u3002osx \u3067\u3082\u4f7f\u3048\u308b\u3068\u3044\u3046\u306e\u304c\u307d\u3061\u3063\u305f\u30dd\u30a4\u30f3\u30c8\u3067\u3057\u305f\u3002<\/p>\n

\"IMG_2782\" <\/p>\n<\/p>\n

\u6700\u7d42\u7684\u306b\u306f\u3001\u3082\u3046\u5c11\u3057\u30b3\u30f3\u30d1\u30af\u30c8\u306b\u3057\u3066\u96fb\u6c60\u3092\u7d44\u307f\u8fbc\u3080\u4e88\u5b9a\u3067\u3059\u3002\u5fdc\u7528\u3059\u308c\u3070 GPS \u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u63a5\u7d9a\u3057\u3066\u3001\u4f4d\u7f6e\u3092\u88dc\u8db3\u3059\u308b IoT \u30c7\u30d0\u30a4\u30b9\u3082\u4f5c\u308c\u305d\u3046\u3067\u3059\u3002<\/p>\n

 <\/p>\n

soracom \u306e\u7ba1\u7406\u30b3\u30f3\u30bd\u30fc\u30eb\u304b\u3089\u306f\u3001\u30c7\u30fc\u30bf\u8ee2\u9001\u91cf\u3082\u898b\u3048\u3066\u7ba1\u7406\u3057\u3084\u3059\u305d\u3046\u3067\u3059\u3002<\/p>\n

\"SORACOM_\u30e6\u30fc\u30b6\u30fc\u30b3\u30f3\u30bd\u30fc\u30eb\"<\/p>\n

\u3067\u306f\u3001\u9806\u306b\u30dd\u30a4\u30f3\u30c8\u3068\u52d8\u6240\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n

 <\/p>\n

Linux \u30dc\u30fc\u30c9\u306e\u6e96\u5099\u3068\u3001\u305d\u306e OS \u306e\u9078\u5b9a<\/h3>\n

 <\/p>\n

\u307e\u305a\u3001\u6bcd\u8266\u306e\u6e96\u5099\u3067\u3059\u3002Orange PI PC \u3092\u7528\u610f\u3057\u307e\u3057\u305f\u3002<\/p>\n

http:\/\/www.orangepi.org\/orangepipc\/<\/a><\/p>\n

\u30aa\u30d5\u30a3\u30b7\u30e3\u30eb\u30b5\u30a4\u30c8\u304b\u3089\u3001\u30e1\u30fc\u30ab\u30fc\u76f4\u8ca9\u306e aliexpress \u306e\u8ca9\u58f2\u30b5\u30a4\u30c8\u306b\u3044\u3051\u307e\u3059\u3002\u30e1\u30e2\u30ea512M \u3067\u3082\u8981\u6c42\u306f\u6e80\u305f\u3057\u307e\u3059\u306e\u3067\u3001one \u3068\u304b lite \u3067\u3082\u3088\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n

\"orangepipc\" <\/p>\n

OS \u306f\u3001ARMBIAN \u3068\u3044\u3046\u3082\u306e\u3092\u4eca\u56de\u306f\u63a1\u7528\u3002Debian \u7cfb\u306e OS \u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n

http:\/\/www.armbian.com\/orange-pi-pc\/<\/a><\/p>\n

8GB \u306e SDCard \u306b\u66f8\u304d\u8fbc\u307f\u3057\u3001IP \u3092\u56fa\u5b9a\u3057\u3066\u304a\u304d\u307e\u3059\u3002\u96fb\u6e90\u306f\u3001\u30e9\u30ba\u30d9\u30ea\u30fc\u30d1\u30a4\u3068\u306f\u9055\u3044\u3001\u30de\u30a4\u30af\u30edUSB\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u306e\u3067\u3001\u5225\u9014 4mm \u3067\u3001\u30bb\u30f3\u30bf\u30fc\u30d4\u30f3\u304c 1.7mm \u306eDC \u30b8\u30e3\u30c3\u30af\u3092\u7528\u610f\u3057\u3066\u304a\u304d\u307e\u3059\u3002\u3053\u308c\u306f\u3001PSP\u7528USB\u5145\u96fb\u30b1\u30fc\u30d6\u30eb\u3068\u540c\u3058\u306a\u306e\u3067\u3001100\u5186\u5747\u4e00\u306a\u3069\u3067\u3082\u30b2\u30c3\u30c8\u3067\u304d\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002\u81ea\u5206\u306f\u3001\u30b8\u30e3\u30c3\u30af\u3092\u5225\u9014\u8cfc\u5165\u3057\u96fb\u6e90\u30b1\u30fc\u30d6\u30eb\u306f\u81ea\u4f5c\u3067\u3059\u3002<\/p>\n

\u306a\u304a\u3001\u4eca\u56de\u306fCPU \u30d2\u30fc\u30c8\u30b7\u30f3\u30af\u3068\u30d5\u30a1\u30f3\u3092\u5b9f\u88c5\u3057\u307e\u3057\u305f\u3002\u8a2d\u5b9a\u306b\u3088\u3063\u3066\u306f\u3001\u30d2\u30fc\u30c8\u30b7\u30f3\u30af\u306e\u307f\u3084\u3001\u7121\u3057\u3067\u3082\u904b\u7528\u53ef\u80fd\u3067\u3059\u3002<\/p>\n

\u8a2d\u5b9a\u306b\u3088\u308a\u307e\u3059\u304c\u3001\u6700\u9ad8\u3067100\u5ea6\u8fd1\u304f\u307e\u3067 CPU \u304c\u767a\u71b1\u3057\u307e\u3059\u306e\u3067\u5bff\u547d\u304c\u77ed\u304f\u306a\u308b\u304b\u58ca\u308c\u308b\u4e8b\u3082\u3042\u308a\u307e\u3059\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n

 <\/p>\n

\n

\u904e\u53bb\u306b\u30d2\u30fc\u30c8\u30b7\u30f3\u30af\u3092\u4ed8\u3051\u305f\u8a18\u4e8b\u3092\u66f8\u3044\u3066\u3044\u307e\u3059\u306e\u3067\u3054\u53c2\u8003\u306b\u3002<\/p>\n

OrangePi One \u306bFan \u3092\u4ed8\u3051\u3066\u5168\u958b\u30d9\u30f3\u30c1\u30de\u30fc\u30af<\/a><\/p>\n<\/blockquote>\n

 <\/p>\n

soracom sim \u306e\u6e96\u5099<\/h3>\n

\u6b21\u306f\u3001soracom \u306e sim \u3092 USB \u30e2\u30c7\u30e0\u3067\u4f7f\u3046\u305f\u3081\u306e\u6e96\u5099\u3067\u3059\u3002USB \u30e2\u30c7\u30e0\u306f\u3001\u4eca\u56de\u4e2d\u53e4\u3067 L-05A \u3092\u8cfc\u5165\u3057\u3066\u304a\u304d\u307e\u3057\u305f\u3002<\/p>\n

\u307e\u305a\u306f\u3001soracom \u306e sim \u3092\u30a2\u30af\u30c6\u30a3\u30d9\u30fc\u30c8\u3057\u3066\u304a\u304d\u307e\u3059\u3002\u7ba1\u7406\u30b3\u30f3\u30bd\u30fc\u30eb\u3088\u308a\u30ed\u30b0\u30a4\u30f3\u3057\u3001sim \u306e\u64cd\u4f5c\u3067\u53ef\u80fd\u3067\u3059\u3002<\/p>\n

\"soracomlogin\" <\/p>\n

 <\/p>\n

\u306a\u304b\u306a\u304b\u7c21\u5358\u64cd\u4f5c\u3067\u3059\u3002\u3059\u3070\u3089\u3057\u3044\u3002\u901f\u5ea6\u30af\u30e9\u30b9\u306f\u3001\u3068\u308a\u3042\u3048\u305a s1.minimum \u306b\u3057\u3066\u304a\u304d\u307e\u3057\u305f\u3002<\/p>\n<\/p>\n<\/p>\n

\"soracom2\" <\/p>\n

\u30c7\u30fc\u30bf\u901a\u4fe1\u91cf\u304c 150MiB \u3092\u8d85\u3048\u305f\u3089\u30e1\u30fc\u30eb\u3057\u3066\u304f\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304d\u307e\u3057\u305f\u3002\u6709\u52b9\u671f\u9650\u306a\u3069\u3082\u8a2d\u5b9a\u3067\u304d\u308b\u3088\u3046\u3067\u3059\u306d\u3002\u30ad\u30e3\u30ea\u30a2\u306b\u306a\u3063\u305f\u6c17\u5206\u3067\u3059\u3002<\/p>\n

 <\/p>\n

Linux \u5074\u304b\u3089 PPP \u63a5\u7d9a\u3059\u308b\u305f\u3081\u306e USB \u30e2\u30c7\u30e0\u306e\u8a2d\u5b9a<\/h3>\n

\u6b21\u306b\u3001sim \u3092 USB \u30e2\u30c7\u30e0\u306b\u5dee\u8fbc\u3001Linux \u6a5f\u306b\u53d6\u308a\u4ed8\u3051\u307e\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u3001CD-ROM\u30c9\u30e9\u30a4\u30d6\u3068\u3057\u3066\u8a8d\u8b58\u3055\u308c\u308b\u3088\u3046\u3067\u3059\u304c\u3001\u3053\u308c\u306f AT \u30b3\u30de\u30f3\u30c9\u3067\u6319\u52d5\u3092\u5236\u5fa1\u3067\u304d\u308b\u3088\u3046\u3067\u3059\u3002\/dev\/sr0 \u3092\u4e00\u5ea6\u30a4\u30b8\u30a7\u30af\u30c8\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n

 <\/p>\n

[root@opi 22:34:04 ~]# eject \/dev\/sr0\neject: unable to eject, last error: Invalid argument\n[root@opi 22:34:12 ~]# ll \/dev\/ | grep ACM\ncrw-rw---- 1 root dialout 166,   0 May 26 22:34 ttyACM0\ncrw-rw---- 1 root dialout 166,   1 May 26 22:34 ttyACM1\ncrw-rw---- 1 root dialout 166,   2 May 26 22:34 ttyACM2\n[root@opi 22:34:30 ~]# <\/pre>\n

  <\/p>\n

\u305d\u3057\u3066\u3001AT \u30b3\u30de\u30f3\u30c9\u3067 CD-ROM \u30c9\u30e9\u30a4\u30d6\u3068\u3057\u3066\u8a8d\u8b58\u3057\u306a\u3044\u3088\u3046\u8a2d\u5b9a\u3057\u3066\u304a\u304d\u307e\u3059\u3002 <\/p>\n

 <\/p>\n

[root@opi 22:34:49 ~]# screen \/dev\/ttyACM0\nATZ\nOK\nAT%USBMODEM=0\n[0] MODEM DRIVER\n\nOK\nATZ0\nOK<\/pre>\n

  <\/p>\n

\u3042\u3068\u306f\u3001ppp \u63a5\u7d9a\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\u3092\u3057\u3066\u304a\u304d\u307e\u3059\u3002wvdial \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u5c0e\u5165\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n

 <\/p>\n

[root@opi 15:57:33 log]# apt-get install wvdial<\/p>\n

 <\/p>\n

\u8a2d\u5b9a\u3067\u3059\u3002<\/p>\n

 <\/p>\n

----- \/etc\/wvdial.conf \n[Dialer Defaults]\nInit1 = ATZ\nInit2 = ATQ0 V1 E1 S0=0 &C1 &D2\nInit3 = AT+CGDCONT=1,"IP","soracom.io"\nDial Attempts = 3\nModem Type = Analog Modem\nDial Command = ATD\nStupid Mode = yes\nBaud = 460800\nNew PPPD = yes\nModem = \/dev\/ttyACM0\nISDN = 0\nPhone = *99***1#\nAPN = soracom.io\nUsername = sora\nPassword = sora\nCarrier Check = no\nAuto DNS = 1\nCheck Def Route = 1<\/pre>\n

 <\/p>\n

systemctl \u3067\u8d77\u52d5\u3067\u304d\u308b\u3088\u3046\u8a2d\u5b9a\u3057\u3066\u304a\u304d\u307e\u3059\u3002\u30b7\u30b9\u30c6\u30e0\u8d77\u52d5\u6642\u306b\u8d77\u52d5\u3059\u308b\u8a2d\u5b9a\u306b\u306f\u307e\u3060\u3057\u3066\u3044\u307e\u305b\u3093\u3002enable \u306b\u3059\u308b\u3060\u3051\u3067\u3059\u304c\u3002<\/p>\n

 <\/p>\n

---- \/etc\/systemd\/system\/wvdial.service\n[Unit]\nDescription=wvdial service\nWants=network.target\n\n[Service]\nType=simple\nExecStartPre=\/sbin\/route del default gw 192.168.1.1\nExecStopPost=\/sbin\/route add default gw 192.168.1.1\nExecStart=\/usr\/bin\/wvdial\nExecStop=\/bin\/kill -HUP $MAINPID\n\n[Install]\nWantedBy=multi-user.target<\/pre>\n

 <\/p>\n

\u4ee5\u4e0a\u3067\u8a2d\u5b9a\u306f\u7d42\u308f\u308a\u3002\u63a5\u7d9a\u306e\u78ba\u8a8d\u3092\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n

 <\/p>\n

[root@opi 16:02:24 log]# systemctl start wvdial<\/p>\n

 <\/p>\n

\u52d5\u4f5c\u3057\u305f\u304b\u3069\u3046\u304b\u306f\u3001status \u3067\u898b\u3066\u307f\u307e\u3059\u3002USB \u30e2\u30c7\u30e0\u306e LED \u304c\u7dd1\u304b\u3089\u9752\u8272\u306b\u306a\u3063\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n

 <\/p>\n

[root@opi 16:03:29 log]# systemctl status wvdial<\/p>\n

::<\/p>\n

May 28 16:02:37 orangepipc pppd[19681]: local  IP address 10.182.126.96
\n
May 28 16:02:37 orangepipc pppd[19681]: remote IP address 10.64.64.64 <\/p>\n

May 28 16:02:37 orangepipc pppd[19681]: primary   DNS address 100.127.0.53 <\/p>\n

May 28 16:02:37 orangepipc pppd[19681]: secondary DNS address 100.127.1.53 <\/p>\n

May 28 16:02:37 orangepipc wvdial[19679]: –> local  IP address 10.182.126.96 <\/p>\n

May 28 16:02:37 orangepipc wvdial[19679]: –> remote IP address 10.64.64.64 <\/p>\n

May 28 16:02:37 orangepipc wvdial[19679]: –> primary   DNS address 100.127.0.53 <\/p>\n

May 28 16:02:37 orangepipc wvdial[19679]: –> secondary DNS address 100.127.1.53 <\/p>\n

 <\/p>\n

\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u306a\u30af\u30e9\u30b9A\u306e IP \u304c\u5272\u308a\u632f\u3089\u308c\u308b\u3088\u3046\u3067\u3059\u306d\u3002ppp0 \u306e\u72b6\u614b\u3092\u898b\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u3067\u3059\u3002<\/p>\n

 <\/p>\n

[root@opi 16:07:38 log]# ifconfig ppp0
\n
ppp0      Link encap:Point-to-Point Protocol 
          inet addr:10.182.126.96  P-t-P:10.64.64.64  Mask:255.255.255.255 <\/p>\n

          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1 <\/p>\n

          RX packets:83 errors:0 dropped:0 overruns:0 frame:0 <\/p>\n

          TX packets:83 errors:0 dropped:0 overruns:0 carrier:0 <\/p>\n

          collisions:0 txqueuelen:3 <\/p>\n

          RX bytes:10339 (10.0 KiB)  TX bytes:14232 (13.8 KiB) <\/p>\n

[root@opi 16:07:43 log]# <\/p>\n

 <\/p>\n

eth0 \u3082\u7e4b\u304c\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u60c5\u5831\u304c\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308c\u3070\u3001ppp0 \u7d4c\u7531\u3067\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u306b\u63a5\u7d9a\u53ef\u80fd\u3067\u3059\u3002<\/p>\n

 <\/p>\n

[root@opi 16:09:42 log]# route -n
\n
Kernel IP routing table <\/p>\n

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface <\/p>\n

0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0 <\/p>\n

10.64.64.64     0.0.0.0         255.255.255.255 UH    0      0        0 ppp0 <\/p>\n

192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0 <\/p>\n

[root@opi 16:09:44 log]# <\/p>\n

 <\/p>\n

google \u307e\u3067\u30c8\u30ec\u30fc\u30b9\u30eb\u30fc\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n

 <\/p>\n

[root@opi 16:11:03 log]# traceroute www.google.com
\n
traceroute to www.google.com (172.217.25.68), 30 hops max, 60 byte packets <\/p>\n

1  ec2-175-41-192-232.ap-northeast-1.compute.amazonaws.com (175.41.192.232)  97.266 ms  106.862 ms  106.923 ms <\/p>\n

2  27.0.0.71 (27.0.0.71)  116.491 ms  136.763 ms  136.841 ms <\/p>\n

3  52.95.30.79 (52.95.30.79)  146.299 ms 52.95.30.77 (52.95.30.77)  156.162 ms 52.95.30.83 (52.95.30.83)  166.192 ms <\/p>\n

4  52.95.30.150 (52.95.30.150)  166.290 ms 52.95.30.144 (52.95.30.144)  166.450 ms 52.95.30.150 (52.95.30.150)  205.754 ms <\/p>\n

5  52.95.216.117 (52.95.216.117)  185.674 ms  195.447 ms  205.659 ms <\/p>\n

6  216.239.54.13 (216.239.54.13)  215.216 ms  79.420 ms  97.653 ms <\/p>\n

7  108.170.233.79 (108.170.233.79)  117.188 ms  127.330 ms  146.963 ms <\/p>\n

8  nrt13s50-in-f4.1e100.net (172.217.25.68)  156.867 ms  187.089 ms  196.809 ms <\/p>\n

[root@opi 16:11:26 log]# <\/p>\n

 <\/p>\n

soracom \u306e\u30b3\u30f3\u30bd\u30fc\u30eb\u3067 1 \u6642\u9593\u3054\u3068\u306e\u4f7f\u7528\u91cf\u3092\u898b\u308b\u3068\u3001\u8a18\u9332\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n

\"soracom1h\" <\/p>\n

 <\/p>\n

CPU \u6e29\u5ea6\u3092\u53d6\u5f97\u3057\u3066 thingspeak \u306b\u30c7\u30fc\u30bf\u3092\u6295\u3052\u308b\u30b9\u30af\u30ea\u30d7\u30c8<\/h3>\n

\u6b21\u306f\u3001cpu \u6e29\u5ea6\u3092\u53d6\u5f97\u3057\u3001\u30c7\u30fc\u30bf\u3092\u98db\u3070\u3059\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u308a\u307e\u3059\u3002python \u3067\u4f5c\u308a\u307e\u3057\u305f\u3002<\/p>\n

 <\/p>\n

#!\/usr\/bin\/python\n# coding: utf-8\n\nimport requests\n#from time import sleep\nimport time\napi_key='your api key'\n\ndef sender():\n  while True:\n    f = open("\/sys\/class\/thermal\/thermal_zone0\/temp","r")\n    t = f.read()\n    payload = {'api_key': api_key, 'field1': str(t)}\n    f.close()\n    print "CPU Temp is:%s"%t ,\n    r = requests.get('http:\/\/52.7.53.111\/update', params=payload)\n    print "Result: ", r.text\n    time.sleep(1.0)\n\ndef main():\n    sender()\n\nif __name__ == '__main__':\n  main()<\/pre>\n

 <\/p>\n

\u7c21\u5358\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u88dc\u8db3\u3057\u307e\u3059\u3002<\/p>\n

python \u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5165\u308c\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n

 <\/p>\n

# apt-get install python-dev
\n
# apt-get install python-pip <\/p>\n

# pip install requests <\/p>\n

 <\/p>\n

api_key \u306b\u306f\u3001\u66f8\u304d\u8fbc\u307f\u306eAPI Key \u3092\u5165\u308c\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n

 <\/p>\n

\"Channels_-_ThingSpeak\" <\/p>\n

\u30c7\u30fc\u30bf\u3092https (SSL)\u7d4c\u7531\u306e post \u3067\u6295\u3052\u308b\u3068\u30d1\u30b1\u30c3\u30c8\u304c\u6d88\u8cbb\u3055\u308c\u308b\u306e\u3067\u3001\u3053\u3053\u3067\u306f\u3001get \u3067\u6295\u3052\u3066\u3044\u307e\u3059\u3002<\/p>\n

api.thingspeak.com \u3092\u540d\u524d\u89e3\u6c7a\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\uff12\u3064IP\u304c\u51fa\u307e\u3059\u306e\u3067\u3001\u3053\u3053\u3067\u306f\u7247\u65b9\u306eIP\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002\u76f8\u624b\u5074\u306e\u4e8b\u60c5\u3067IP \u304c\u5909\u308f\u308b\u3053\u3068\u3082\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n

 <\/p>\n

# dig api.thingspeak.com <\/p>\n

:: <\/p>\n

;; ANSWER SECTION:
\n
api.thingspeak.com.    60    IN    A    52.200.157.52 <\/p>\n

api.thingspeak.com.    60    IN    A    52.7.53.111 <\/p>\n

 <\/p>\n

\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n

 <\/p>\n

[root@opi 18:20:46 work]# python t.py<\/p>\n

 <\/p>\n

\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n

 <\/p>\n

[root@opi 18:20:46 work]# python t.py
\n
CPU Temp is:38 <\/p>\n

Result:  401 <\/p>\n

CPU Temp is:38 <\/p>\n

Result:  0 <\/p>\n

CPU Temp is:38 <\/p>\n

Result:  0 <\/p>\n

CPU Temp is:38 <\/p>\n

Result:  0 <\/p>\n

CPU Temp is:38 <\/p>\n

Result:  0 <\/p>\n

 <\/p>\n

CPU \u306e\u6e29\u5ea6\u3092\u4e0a\u3052\u308b\u305f\u3081\u3001\u8ca0\u8377\u3092 UnixBench \u3067\u304b\u3051\u3066\u307f\u307e\u3059\u3002<\/p>\n

 <\/p>\n

[root@opi 18:08:33 UnixBench]# .\/Run -c 4<\/p>\n

 <\/p>\n

\u30b0\u30e9\u30d5\u8868\u793a\u306f\u3001\u3053\u3093\u306a\u611f\u3058\u3067\u51fa\u3066\u3044\u307e\u3059\u3002<\/p>\n

\"test_-_ThingSpeak <\/p>\n

CPU \u6e29\u5ea6\u304c\u3053\u308c\u30671\u79d2\u3054\u3068\u306b\u8a18\u9332\u3055\u308c\u3066\u3044\u304d\u307e\u3059\u304c\u3001600\u79d2\u306b\u4e00\u5ea6\u304f\u3089\u3044\u3067\u3044\u3044\u306e\u3067\u3001\u4fee\u6b63\u3057\u3001\u30ed\u30b0\u30aa\u30d5\u5f8c\u3082\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u52d5\u4f5c\u3059\u308b\u3088\u3046\u4ee5\u4e0b\u306e\u3088\u3046\u306b nohup \u3067\u5b9f\u884c\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n

 <\/p>\n

[root@opi 18:34:08 work]# nohup python t.py &
\n
[1] 13673 <\/p>\n

[root@opi 18:34:28 work]# nohup: ignoring input and appending output to \u2018nohup.out\u2019 <\/p>\n

[root@opi 18:34:32 work]# ps axu | grep python
\n
:: <\/p>\n

root     13673  4.1  0.8  13796  8428 pts\/0    S    18:34   0:00 python t.py <\/p>\n

 <\/p>\n

\u306a\u304a\u3001\u4eca\u306e\u3068\u3053\u308d soracom \u306e\u63a5\u7d9a\u6599\u91d1\u306f 119 \u5186\u306e\u3088\u3046\u3067\u3059\u3002<\/p>\n

\"soracompay\" <\/p>\n

 <\/p>\n

\u3057\u3070\u3089\u304f\u3001CPU \u6e29\u5ea6\u3092\u8a18\u9332\u3055\u305b\u3066\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b\u3053\u3068\u306b\u3002GPIO \u304b\u3089\u30bb\u30f3\u30b5\u30fc\u3092\u53d6\u308a\u4ed8\u3051\u308c\u3070\u3001\u5916\u6c17\u6e29\u3084\u6e7f\u5ea6\u3001\u660e\u308b\u3055\u3084\u3001PM2.5 \u306a\u3069\u8a18\u9332\u3057\u305f\u3044\u3082\u306e\u3092\u6295\u3052\u308c\u307e\u3059\u3002<\/p>\n

\u3061\u306a\u307f\u306b\u30011\u65e5\u7d4c\u904e\u5f8c\u3001\u8ab2\u91d1\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u3067\u3059\u3002<\/p>\n

\"soracom_2\" <\/p>\n

\u3053\u306e\u6bcd\u8266\u3092\u5229\u7528\u3057\u3001WiFi \u7d4c\u7531\u3067 \u30bb\u30f3\u30b5\u30fc\u30c7\u30d0\u30a4\u30b9\u3092\u4f5c\u308b\u306e\u304c\u5b9f\u7528\u7684\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u7d44\u307f\u5408\u308f\u306f\u3044\u308d\u3044\u308d\u3042\u308a\u307e\u3059\u306d\u3002<\/p>\n

\u3053\u306e\u7d9a\u304d\u306f\u307e\u305f\u306e\u6a5f\u4f1a\u306b\u3002<\/p>\n

 <\/p>\n

\n\n\n\n
<\/font><\/span><\/a> <\/td>\n<\/font><\/span><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"

\u79fb\u52d5\u3057\u3066\u3044\u308b\u4e2d\u3001IoT \u30c7\u30fc\u30bf\u3092\u9001\u4fe1\u3057\u305f\u3044\u306a\u3068\u3002\u3053\u306e\u5834\u5408\u3001WIFI \u304c\u306a\u3044\u3093\u3067\u3059\u3088\u306d\u3002 IoT \u30c7\u30d0\u30a4\u30b9\u304b\u3089\u306f\u30d6\u30eb\u30fc\u30c8\u30a5\u30fc\u30b9\u3084WiFi \u3067\u30cd\u30c3\u30c8\u7d4c\u7531\u3078\u30c7\u30fc\u30bf\u306f\u51fa\u305b\u308b\u306e\u3067\u3059\u304c\u3001\u3069\u3053\u3067\u3082\u3001\u6295\u3052\u305f\u3044\u306e\u3067 Soracom Air […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","footnotes":""},"categories":[57,60,72],"tags":[],"acf":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"post-thumbnail":false},"uagb_author_info":{"display_name":"JunkHack","author_link":"https:\/\/hack.gpl.jp\/author\/junkhack\/"},"uagb_comment_info":0,"uagb_excerpt":"\u79fb\u52d5\u3057\u3066\u3044\u308b\u4e2d\u3001IoT \u30c7\u30fc\u30bf\u3092\u9001\u4fe1\u3057\u305f\u3044\u306a\u3068\u3002\u3053\u306e\u5834\u5408\u3001WIFI \u304c\u306a\u3044\u3093\u3067\u3059\u3088\u306d\u3002 IoT \u30c7\u30d0\u30a4\u30b9\u304b\u3089\u306f…","_links":{"self":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/posts\/2196"}],"collection":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/comments?post=2196"}],"version-history":[{"count":0,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/posts\/2196\/revisions"}],"wp:attachment":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/media?parent=2196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/categories?post=2196"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/tags?post=2196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}