MVNOã®æ ¼å®SIMã使ã£ã¦Raspberry Piã§LTE3Gã¢ãã¤ã«ã«ã¼ã¿ãä½ã£ã¦ã¿ããï¼
ã¢ãã¤ã«ã«ã¼ã¿ãä½ããï¼
æè¿ããè³ã«ããããã«ãªã£ã¦ããæ ¼å®SIMã¯
æé¡1000å以ä¸ã¨ããä½ä¾¡æ ¼ã§å®é¡ãã±ããéä¿¡ãå©ç¨ãããã¨ãã§ãã¾ãã
ä¸ã«ã¯æé¡500åãåããã®ãããã¾ãã
æ¥æ¬å
¨å½ã»ã¨ãã©ã©ãã§ãéä¿¡å¯è½ãªdocomoãããã¯ã¼ã¯ã
ãããªã«å®ãå¤æ®µã§ä½¿ãã¦ãã¾ã£ã¦ããã®ã§ããããï¼
æ ¼å®SIMã使ãããã«ã¯SIMãæ¿ãã¦ä½¿ã
æºå¸¯ç«¯æ«ãã¢ãã¤ã«ã«ã¼ã¿ãå¿
è¦ã§ãã
ãã®ç«¯æ«ããããªãã«é«ãããã§ã»ã»ã»
ä»åã¯5000å以ä¸ã§å
¥æå¯è½ãªæ¿å®ç«¯æ«RaspberryPiã
æ ¼å®SIMãæ¿å
¥å¯è½ãªã¢ãã¤ã«ã«ã¼ã¿ã«ãã¦ã¿ã¾ãã
è¦æ±ä»æ§ã¯ä¸è¨ã®éãã¨ãã¾ãã
- äºç®1ä¸å以å ï¼SIM代ã¯é¤ãï¼
- è¤æ°ç¡ç·ç«¯æ«ããåææ¥ç¶å¯è½
- docomoãããã¯ã¼ã¯ã®LTEæ¥ç¶å¯è½
- ã¢ãã¤ã«ããããªã¼ã§é§åå¯è½
- æç·LANã®ãããã¯ã¼ã¯ã«ã対å¿
- ã«ãã³ã®ä¸ã«ç´ã¾ããµã¤ãº
æ®éã«ä¸è¨ã¹ããã¯ã®ã¢ãã¤ã«ã«ã¼ã¿ã¯2ä¸å以ä¸ã¯ãã¾ãã
ããªããå¾ã«ä½ãã¾ããï¼ï¼
ã·ã¹ãã æ§æ
ä¸è¨ã«ã·ã¹ãã æ§æå³ã示ãã¾ãã
LTE3Gå¤é¨ãããã¯ã¼ã¯ã¸ã¯docomoã®USBãã¼ã¿é信端æ«
ãL-02Cãã使ã£ã¦æ¥ç¶ãã¾ãã
å
é¨ãããã¯ã¼ã¯ã®åç¡ç·ç«¯æ«ã¨ã®éä¿¡ã¯
USBç¡ç·ã¢ããã¿ãWLI-UC-GNMãã使ãã¾ãã
ãã®ä»ã100åã®ã±ã¼ã¹ãã±ã¼ãã«ãå å·¥ã使ãã¾ããã
ã¢ãã¤ã«ããããªã¼ã¯2Aã¯ã©ã¹ã®åºåãå¯è½ãªãã®ãã
æºåãããã®
- Raspberry Piæ¬ä½ï¼3800åï¼
- åºç社/ã¡ã¼ã«ã¼: raspberrypi.org
- ã¡ãã£ã¢: ã¨ã¬ã¯ãããã¯ã¹
- ãã®ååãå«ãããã° (2件) ãè¦ã
- L-02Cï¼ã¤ããªã¯!ã§2000åç¨åº¦ï¼
- åºç社/ã¡ã¼ã«ã¼: LG Electronics Inc.
- ã¡ãã£ã¢: ã¨ã¬ã¯ãããã¯ã¹
- ãã®ååãå«ãããã° (2件) ãè¦ã
- ç¡ç·LANã¢ããã¿ï¼WLI-UC-GNMï¼ï¼700åï¼
BUFFALO ç¡ç·LANåæ© ã³ã³ãã¯ãã¢ãã« 11næè¡ã»11g/bå¯¾å¿ WLI-UC-GNM
- åºç社/ã¡ã¼ã«ã¼: ãããã¡ãã¼
- çºå£²æ¥: 2010/06/25
- ã¡ãã£ã¢: Personal Computers
- è³¼å ¥: 44人 ã¯ãªãã¯: 226å
- ãã®ååãå«ãããã° (27件) ãè¦ã
- SDã«ã¼ãï¼4GB以ä¸ã®ãã®ï¼ï¼800åï¼
- åºç社/ã¡ã¼ã«ã¼: ãã©ã³ã»ã³ãã»ã¸ã£ãã³
- ã¡ãã£ã¢: Personal Computers
- ãã®ååãå«ãããã°ãè¦ã
- ã¢ãã¤ã«ããããªã¼ï¼1350åï¼
- æ ¼å®SIMã«ã¼ãï¼OCNã¢ãã¤ã«åæï¼
OCN ã¢ãã¤ã« ONEãSMS対å¿ããã¤ã¯ãSIM æé¡1,020å(ç¨æ)~
- åºç社/ã¡ã¼ã«ã¼: NTTã³ãã¥ãã±ã¼ã·ã§ã³ãº
- çºå£²æ¥: 2013/12/17
- ã¡ãã£ã¢: ã¨ã¬ã¯ãããã¯ã¹
- ãã®ååãå«ãããã° (6件) ãè¦ã
ç·é¡ã8650åããª
ææ°ã®RaspberryPiï¼ã¢ãã«ã¯SDã«ã¼ãã§ã¯ãªã
microSDã«ã¼ã対å¿ã«ãªã£ã¦ã¾ãã®ã§ã注æãã ããã
å種è¨å®
以ä¸ã®è¨å®ã¯RaspberryPiãæç·LANã«æ¥ç¶ãã
åä¸ãããã¯ã¼ã¯ã«ã¤ãªãããã¹ã¯ãããPCçããè¡ãã¾ãã
ä¸ããå°å ¥ãç¥ãããæ¹ã¯ä¸è¨ãµã¤ããªã©ãåèã«ãã¦ãã ããã
RaspberryPiでドライブレコーダ 【RaspberryPiセットアップ】 - My Linux Diary
ï¼ï¼ã¢ã¯ã»ã¹ãã¤ã³ãæ©è½ï¼hostapd)å°å ¥
ã¾ãã¯ææã¡ã®åæºå¸¯ç«¯æ«ã¨RaspberryPiãç¡ç·ã§æ¥ç¶ã§ããããã«
ã¢ã¯ã»ã¹ãã¤ã³ãæ©è½ãå°å
¥ããDHCPãµã¼ãã¼ãç«ã¡ä¸ãã¾ãã
æç·LANå´eth0ã¯DHCPã§IPã¢ãã¬ã¹ãèªåå²ãå½ã¦ã
ç¡ç·LANå´wlan0ã¯åºå®IPã¢ãã¬ã¹ãå²ãå½ã¦ã¾ãã
$ sudo vi /etc/network/interfaces
ã
auto lo
ã
iface lo inet loopback
iface eth0 inet dhcp
ã
allow-hotplug wlan0
auto wlan0
iface wlan0 inet static
address 192.168.100.1
network 192.168.100.0
netmask 255.255.255.0
gateway 192.168.11.1
次ã«hostapdãã¤ã³ã¹ãã¼ã«ãã¾ãã
$ sudo apt-get install hostapd
WLI-UC-GNMã¯hostapdã®ãã¼ã¸ã§ã³ãå¤ã対å¿ãã¦ãã¾ããã
æ°ããæ¬å®¶ã®ãµã¤ãããææ°çããã¦ã³ãã¼ããã¾ãã
http://w1.fi/hostapd/ ããã½ã¼ã¹ãã¡ã¤ã«
(hostad-2.0.tar.gz)ããã¦ã³ãã¼ããå±éãã¾ãã
é¢é£ã©ã¤ãã©ãªãã¤ã³ã¹ãã¼ã«ãã¾ãããã
$ wget http://w1.fi/releases/hostapd-2.0.tar.gz
$ tar xvf hostapd-2.0.tar.gz
$ sudo apt-get libnl-genl-3-dev libssl-dev
ã³ã³ãã¤ã«ãè¡ãã¾ãã
$ cd hostapd-2.0/hostapd
$ cp defconfig .config
$ echo CONFIG_LIBNL32=y >> .config
$ make
ã³ã³ãã¤ã«ããhostapdãç½®ãæãã¾ãã
$ sudo mv /usr/sbin/hostapd{,.orig}
$ sudo mv hostapd /usr/sbin/
è¨å®ãã¡ã¤ã«ï¼hostapd.confï¼ãæ¸ãæãã¾ãã
SSIDã¨ãã¹ã¯ã¼ãã¯é©å®æ¸ãæãã¦ãã ããã
$ vi /etc/hostapd/hostapd.conf
ã
interface=wlan0
driver=nl80211
ssid=myraspberrypi
hw_mode=g
channel=1
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=mypasswords
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
hostapdã®èµ·åè¨å®ããã¾ãã
$ vi /etc/default/hostapd
DAEMON_CONF="/etc/hostapd/hostapd.conf"
WPASupplicantãç¡å¹ã«ãã¦ããã¾ãã
$ sudo mv /usr/share/dbus-1/system-services/fi.epitest.hostap.WPASupplicant.service ~/
ä¸è¨ã³ãã³ãã§ãã¼ã¢ã³ã¨ãã¦èµ·åãã¾ãã
$ sudo service hostapd start
ããã§åºå®IPã§ã®å端æ«ããã®æ¥ç¶ã¯å¯è½ã¨ãªãã¾ããã
DHCPæ©è½ããªããããã¾ã èªåçã«IPã¢ãã¬ã¹ãå²ãæ¯ããã¾ããã
èµ·åæ¯ã«hostapdãç«ã¡ä¸ããããã«ãã¾ãã
$ sudo update-rc.d hostapd enable
ï¼ï¼DHCPãµã¼ãã¼ï¼isc-dhcp-serverï¼å°å ¥
ã¾ãã¯ã¤ã³ã¹ãã¼ã«ãã¾ãã
$ sudo apt-get update
$ sudo apt-get install isc-dhcp-server
è¨å®ãã¡ã¤ã«ï¼dhcp.confï¼ãç·¨éãã¾ãã
$ vi /etc/dhcp/dhcpd.conf
ã
#ã³ã¡ã³ãã¢ã¦ã
#option domain-name "example.org";
#option domain-name-servers ns1.example.org, ns2.example.org;
ã
authoritative;
ã
subnet 192.168.100.0 netmask 255.255.255.0 {
range 192.168.100.10 192.168.100.50;
option broadcast-address 192.168.100.255;
default-lease-time 600;
max-lease-time 7200;
option routers 192.168.100.1;
option domain-name "local";
option domain-name-servers 8.8.8.8, 8.8.4.4;
}
DHCPãµã¼ãã¼ã®èµ·åè¨å®ããã¾ãã
$ vi /etc/default/isc-dhcp-server
ã
INTERFACES="wlan0"
DHCPãµã¼ãã¼ãèµ·åãã¾ãã
$ sudo service isc-dhcp-server start
ããã§åæºå¸¯ç«¯æ«ããèªåçã«æ¥ç¶å¯è½ã¨ãªãã¾ããã
èµ·åæ¯ã«DHCPãµã¼ãã¼ãç«ã¡ä¸ããããä¸è¨ãè¨å®ãã¾ãã
$ sudo update-rc.d isc-dhcp-server enable
ï¼ï¼IPãã¹ã«ã¬ã¼ãã®è¨å®
ãã®ç¶æ
ã§åæºå¸¯ç«¯æ«ããæç·LANçµç±ã§
å¤é¨ãããã¯ã¼ã¯ã«æ¥ç¶ã§ããããã«ãã¾ãã
ãã±ããã転éã§ããããã«ã·ã¹ãã è¨å®ãã¾ãã
$ sudo vi /etc/sysctl.conf
ã
net.ipv4.ip_forward=1$ sudo reboot
iptablesã®è¨å®ã«ããIPãã¹ã«ã¬ã¼ããæå¹ã«ãã¾ãã
$ sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
ããã§æç·ã¢ãã¤ã«ã«ã¼ã¿ã¨ãã¦æ©è½ããããã«ãªãã¾ããï¼
ï¼ï¼LTE/3Gç¡ç·ãããã¯ã¼ã¯æ¥ç¶
ããããRaspberry PiãLTEãããã¯ã¼ã¯ã«æ¥ç¶ãã¾ãã
ãªããL-02CãRaspberryã«æ¥ç¶ããã¨CD-ROMã¨èªèããã¾ãã
$ dmesg
ã
[ 718.387690] usb 1-1.2: new high-speed USB device number 5 using dwc_otg
[ 718.490575] usb 1-1.2: New USB device found, idVendor=1004, idProduct=61dd
[ 718.490610] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 718.490626] usb 1-1.2: Product: docomo L02C
[ 718.490640] usb 1-1.2: Manufacturer: NTT DOCOMO, INC.
[ 718.490654] usb 1-1.2: SerialNumber: 353168043428010
[ 718.500367] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[ 718.506959] scsi host0: usb-storage 1-1.2:1.0
[ 718.533685] usbcore: registered new interface driver uas
[ 719.509159] scsi 0:0:0:0: CD-ROM LG Autorun 2.00 PQ: 0 ANSI: 0
[ 719.557418] sr 0:0:0:0: [sr0] scsi-1 drive
[ 719.557457] cdrom: Uniform CD-ROM driver Revision: 3.20
[ 719.562875] sr 0:0:0:0: Attached scsi CD-ROM sr0
[ 719.592345] sr 0:0:0:0: Attached scsi generic sg0 type 5
CD-ROMãejectããããã®ã³ãã³ããã¤ã³ã¹ãã¼ã«ãã¾ãã
$ sudo apt-get install eject
CD-ROMãejectããã¨ã»ã»ã»
$ eject sr0
ä»åº¦ã¯æ£ããèªèããã¾ãã
$ dmesg
ã
[ 839.523291] usb 1-1.2: USB disconnect, device number 5
[ 839.525094] scsi 0:0:0:0: rejecting I/O to offline device
[ 839.525131] scsi 0:0:0:0: killing request
[ 839.932198] usb 1-1.2: new high-speed USB device number 6 using dwc_otg
[ 840.034681] usb 1-1.2: New USB device found, idVendor=1004, idProduct=618f
[ 840.034716] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 840.034733] usb 1-1.2: Product: docomo L02C
[ 840.034748] usb 1-1.2: Manufacturer: NTT DOCOMO, INC.
[ 840.140872] usbcore: registered new interface driver usbserial
[ 840.144246] usbcore: registered new interface driver usbserial_generic
[ 840.144999] usbserial: USB Serial support registered for generic
[ 840.186171] usbcore: registered new interface driver option
[ 840.188284] usbserial: USB Serial support registered for GSM modem (1-port)
[ 840.189350] option 1-1.2:1.0: GSM modem (1-port) converter detected
[ 840.194371] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB0
[ 840.195086] option 1-1.2:1.1: GSM modem (1-port) converter detected
[ 840.196391] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB1
[ 840.197081] option 1-1.2:1.2: GSM modem (1-port) converter detected
[ 840.200921] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB2
[ 840.201625] option 1-1.2:1.3: GSM modem (1-port) converter detected
[ 840.204714] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB3
wvdialã¨ããããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ãã¾ãã
$ sudo apt-get install wvdial
wvdialã®è¨å®ãã¡ã¤ã«ãä½æãã¾ãã
ä¸è¨ã¯OCNã¢ãã¤ã«ã®å ´åãæ³å®ãã¦ãã¾ãã
èªèº«ã®MVNOã«åããã¦æ¸ãæãã¦ãã ããã
$ sudo vi /etc/wvdial.conf
ã
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Dial Attempts = 3
Stupid Mode = 1
Modem Type = Analog Modem
Dial Command = ATD
Stupid Mode = yes
Baud = 460800
New PPPD = yes
APN = lte-d.ocn.ne.jp
Modem = /dev/ttyUSB2
ISDN = 0
Phone = *99***1#
Password = mobile
Username = mobileid@ocn
Carrier Check = no
ä¸è¨ã®ã³ãã³ãã§æ¥ç¶ãã¾ãã
$ sudo wvdial
ã
ï¼> WvDial: Internet dialer version 1.61
ï¼> Initializing modem.
ï¼> Sending: ATZ
ATZ
OK
ï¼> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
ï¼> Modem initialized.
ï¼> Sending: ATD*99***1#
ï¼> Waiting for carrier.
ATD*99***1#
CONNECT
ï¼> Carrier detected. Starting PPP immediately.
ï¼> Starting pppd at **
ï¼> Pid of pppd: 2954
ï¼> Using interface ppp0
ï¼> local IP address **.**.**.**
ï¼> remote IP address **.**.**.**
ï¼> primary DNS address **.**.**.**
ï¼> secondary DNS address **.**.**.**
PPPæ¥ç¶ã確ç«ããã¦ãããã¨ã確èªã§ãã¾ãã
$ ifconfig ppp0
ã
ï¼ ppp0 Link encap:Point-to-Point Protocol
inet addr:153.157.141.198 P-t-P:10.64.64.64 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:151 errors:0 dropped:0 overruns:0 frame:0
TX packets:175 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:47872 (46.7 KiB) TX bytes:28680 (28.0 KiB)
iptablesã®è¨å®ã«ããIPãã¹ã«ã¬ã¼ããæå¹ã«ãã¾ãã
$ sudo iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
ããã§LTEã¢ãã¤ã«ã«ã¼ã¿ã¨ãã¦æ©è½ããããã«ãªãã¾ããï¼
èµ·åæ¯ã«PPPæ¥ç¶ã確ç«ãããããã«ãã¾ãã
$ sudo vi /etc/init.d/wvdialloop.sh
ã
#!/bin/bashLOG='/var/log/wvdial'
eject /dev/sr0
(
while : ; do
wvdial 2>&1
sleep 15
done
) 2>&1 > ${LOG} < /dev/null &
$ sudo chmod +x /etc/init.d/wvdialloop.sh
$ update-rc.d wvdialloop.sh defaults
rc.localã«IPãã¹ã«ã¬ã¼ãã®è¨å®ã追å ãã¾ãã
$ sudo vi /etc/rc.local
ã
# exit 0 ã®åã«è¿½å
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
ããã§é»æºæå
¥æã«èªåçã«PPPæ¥ç¶ã確ç«ããã
ã¢ãã¤ã«ã«ã¼ã¿ã¨ãã¦æ©è½ããããã«ãªãã¾ãã
LTEéä¿¡ä¸ã®ç·æ¶è²»é»æµã¯0.9Aå¼±ã
çµæ§çºç±ãã¾ããã»ã»ã»
ã¢ãã¤ã«ããããªã¼ã§ããã£ããé§åãã¾ãã
RaspberryPiã§å¦ã¶ ARMããã¤ã¹ãã©ã¤ãã¼ããã°ã©ãã³ã°
- ä½è : ç±³ç°è¡
- åºç社/ã¡ã¼ã«ã¼: ã½ã·ã
- çºå£²æ¥: 2014/09/24
- ã¡ãã£ã¢: åè¡æ¬
- ãã®ååãå«ãããã° (1件) ãè¦ã
ã¾ã¨ã
æ¿å®PCã®å
é§ãã¨ãªãRaspberryPiã使ã£ã¦å®ä¾¡ã«
LTEã¢ãã¤ã«ã«ã¼ã¿ãæ§ç¯ããä»çµã¿ãç´¹ä»ãã¾ããã
ä»å使ã£ãæè¡ã¯è²ã ãªå¿ç¨ãèãããã¾ãã
ç¹ã«LTEãããã¯ã¼ã¯ã«æ¥ç¶ã§ããç¹ã¯å¤§ããã§ããã
GPSã¨é£æºãã¦ã°ã¼ã°ã«ãããã表示ãããã
ã«ã¡ã©ã¨é£æºããã¦è¦å®ãã·ã¹ãã ãæ§ç¯ããã
å¯è½æ§ã¯ç¡é大ã§ãã
ã°ãã¼ãã«IPãåå¾ã§ããã°é éæä½çã®å¿ç¨ãå¯è½ã§ãã
ã¨ã«ãããã¢ãã®ã¤ã³ã¿ã¼ãããï¼IoTï¼ãã®æ代ã¯
ããããã¾ã§æ¥ã¦ãã£ã¦æãã§ãã
ããããªããç¡éã®å¯è½æ§ã«ãã£ã¬ã³ã¸ãã¦ã¿ã¦ã¯ï¼