Difference between revisions of "Cellular Communication"
(Internet setup with Sakis3G communication) |
|||
Line 19: | Line 19: | ||
1. Only one hive connecting<br> | 1. Only one hive connecting<br> | ||
− | |||
− | Check that you can see the USB modem: | + | Connect USB modem to pi<br> |
− | $ lsusb | + | Check that you can see the USB modem:<br> |
− | Bus 001 Device 004: ID 0c45:7401 Microdia | + | $ lsusb<br> |
− | Bus 001 Device 006: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E230/E270/E870 HSDPA/HSUPA Modem | + | Bus 001 Device 004: ID 0c45:7401 Microdia<br> |
− | Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter | + | Bus 001 Device 006: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E230/E270/E870 HSDPA/HSUPA Modem<br> |
− | Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. LAN9500 Ethernet 10/100 Adapter / SMSC9512/9514 Hub | + | Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter<br> |
− | Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub | + | Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. LAN9500 Ethernet 10/100 Adapter / SMSC9512/9514 Hub<br> |
− | + | Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br> | |
− | Update to latest versions | + | <br> |
− | $ sudo apt-get update | + | Update to latest versions<br> |
− | + | $ sudo apt-get update<br> | |
− | Add program for connection to modem with disk partition | + | <br> |
− | $ sudo apt-get install usb-modeswitch | + | Add program for connection to modem with disk partition<br> |
− | + | $ sudo apt-get install usb-modeswitch<br> | |
− | Install PPP driver | + | <br> |
− | $ sudo apt-get install ppp | + | Install PPP driver<br> |
− | + | $ sudo apt-get install ppp<br> | |
− | Download and install Sakis3G application, this is stable, and easy to configure, more info on www.sakis3g.com | + | <br> |
− | $ sudo wget "http://www.sakis3g.com/downloads/sakis3g.tar.gz" -O sakis3g.tar.gz | + | Download and install Sakis3G application, this is stable, and easy to configure, more info on www.sakis3g.com<br> |
− | Unpack files | + | $ sudo wget "http://www.sakis3g.com/downloads/sakis3g.tar.gz" -O sakis3g.tar.gz<br> |
− | $ sudo tar -xzvf sakis3g.tar.gz | + | Unpack files<br> |
− | Make file executable | + | $ sudo tar -xzvf sakis3g.tar.gz<br> |
− | $ sudo chmod +x sakis3g | + | Make file executable<br> |
− | + | $ sudo chmod +x sakis3g<br> | |
− | Test connection (Use sudo, otherwise it maybe fails to open ports) | + | <br> |
− | $ sudo ./sakis3g --interactive | + | Test connection (Use sudo, otherwise it maybe fails to open ports)<br> |
− | 1. Connect with 3G | + | $ sudo ./sakis3g --interactive<br> |
− | 1. USB device | + | 1. Connect with 3G<br> |
− | 3. HUAWEI Mobile | + | 1. USB device<br> |
− | 1. (internet) - (APN, maybe it differ at your mobile provider) | + | 3. HUAWEI Mobile<br> |
− | E180 connected to Phonero (24201). - Connected to internet | + | 1. (internet) - (APN, maybe it differ at your mobile provider)<br> |
− | + | E180 connected to Phonero (24201). - Connected to internet<br> | |
− | Check connection information | + | <br> |
− | + | Check connection information<br> | |
− | Interface: P-t-P (ppp0) | + | <br> |
− | Connected since: 2016-01-18 14:39 | + | Interface: P-t-P (ppp0)<br> |
− | Kilobytes received: 24 | + | Connected since: 2016-01-18 14:39<br> |
− | Kilobytes sent: 6 | + | Kilobytes received: 24<br> |
− | Network ID: 24201 | + | Kilobytes sent: 6<br> |
− | Operator name: Phonero | + | Network ID: 24201<br> |
− | APN: internet | + | Operator name: Phonero<br> |
− | Modem: E180 | + | APN: internet<br> |
− | Modem type: USB | + | Modem: E180<br> |
− | Kernel driver: option | + | Modem type: USB<br> |
− | Device: /dev/ttyUSB0 | + | Kernel driver: option<br> |
− | + | Device: /dev/ttyUSB0<br> | |
− | Make your own connection command | + | <br> |
− | + | Make your own connection command<br> | |
− | After | + | <br> |
− | + | After testing internet connection, disconnect modem from menu<br> | |
− | $ sudo ./sakis3g connect | + | <br> |
− | Please select modem type by using OTHER variable, or by enabling interactive mode. | + | $ sudo ./sakis3g connect<br> |
+ | Please select modem type by using OTHER variable, or by enabling interactive mode.<br> | ||
$ /home/pi/sakis3g --interactive "connect" | $ /home/pi/sakis3g --interactive "connect" | ||
− | Available options are: | + | Available options are:<br> |
− | USBMODEM USB device | + | USBMODEM USB device<br> |
− | BLUETOOTH Bluetooth modem | + | BLUETOOTH Bluetooth modem<br> |
− | CUSTOM_TTY Custom tty... | + | CUSTOM_TTY Custom tty...<br> |
Example: | Example: | ||
$ /home/pi/sakis3g OTHER="USBMODEM" | $ /home/pi/sakis3g OTHER="USBMODEM" | ||
− | $ sudo ./sakis3g OTHER="USBMODEM" connect | + | $ sudo ./sakis3g OTHER="USBMODEM" connect<br> |
− | Please select USB modem by using USBMODEM variable, or by enabling interactive mode. | + | Please select USB modem by using USBMODEM variable, or by enabling interactive mode.<br> |
$ /home/pi/sakis3g --interactive "OTHER=USBMODEM" "connect" | $ /home/pi/sakis3g --interactive "OTHER=USBMODEM" "connect" | ||
− | Available options are: | + | Available options are:<br> |
− | 0424:9512 BUSNUM=001 | + | 0424:9512 BUSNUM=001<br> |
− | 0424:ec00 BUSNUM=001 | + | 0424:ec00 BUSNUM=001<br> |
− | 12d1:1003 HUAWEI Mobile | + | 12d1:1003 HUAWEI Mobile<br> |
− | 1d6b:0002 DWC OTG Controller | + | 1d6b:0002 DWC OTG Controller<br> |
Example: | Example: | ||
$ /home/pi/sakis3g USBMODEM="0424:9512" | $ /home/pi/sakis3g USBMODEM="0424:9512" | ||
− | $ sudo ./sakis3g OTHER="USBMODEM" USBMODEM="12d1:1003" connect | + | $ sudo ./sakis3g OTHER="USBMODEM" USBMODEM="12d1:1003" connect<br> |
Please select APN by using APN variable, or by enabling interactive mode. | Please select APN by using APN variable, or by enabling interactive mode. | ||
$ /home/pi/sakis3g --interactive "OTHER=USBMODEM" "USBMODEM=12d1:1003" "connect" | $ /home/pi/sakis3g --interactive "OTHER=USBMODEM" "USBMODEM=12d1:1003" "connect" | ||
− | Available options are: | + | Available options are:<br> |
− | internet (internet) | + | internet (internet)<br> |
− | CUSTOM_APN Custom APN… | + | CUSTOM_APN Custom APN… <br> |
Example: | Example: | ||
$ /home/pi/sakis3g APN="internet" | $ /home/pi/sakis3g APN="internet" | ||
− | $ sudo ./sakis3g OTHER="USBMODEM" USBMODEM="12d1:1003" APN="internet" connect | + | $ sudo ./sakis3g OTHER="USBMODEM" USBMODEM="12d1:1003" APN="internet" connect<br> |
− | E180 connected to Phonero (24201). | + | E180 connected to Phonero (24201).<br> |
− | $ sudo ./sakis3g OTHER="USBMODEM" USBMODEM="12d1:1003" APN="internet" disconnect | + | $ sudo ./sakis3g OTHER="USBMODEM" USBMODEM="12d1:1003" APN="internet" disconnect<br> |
− | Disconnected. | + | Disconnected.<br> |
Revision as of 12:46, 18 January 2016
The main goal for this is to have a hive sending data in areas not covered with network cable to house or outside WiFi range. There is also a problem with sites without AC power. This is also covered in the section for Solar Panel.
My setup for this is:
- Raspberry Pi
- HAT board
- Weighing cells
- 2 x DHT22 Temperatur / Humidity sensors
- TSL2591 Lux sensor
- Edimax E180 3G modem
- WiFi from Raspberry
There are several things to think about
- Is this the only hive to be connected to internet.
- If there is more that one, you need to set it up as a router.
- If there is only two hives a ethernet cable between would be the most power effeciant.
- If there is more than two, you need a ethernet hub or using wifi between hives (wifi use a lot of power)
1. Only one hive connecting
Connect USB modem to pi
Check that you can see the USB modem:
$ lsusb
Bus 001 Device 004: ID 0c45:7401 Microdia
Bus 001 Device 006: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E230/E270/E870 HSDPA/HSUPA Modem
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. LAN9500 Ethernet 10/100 Adapter / SMSC9512/9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Update to latest versions
$ sudo apt-get update
Add program for connection to modem with disk partition
$ sudo apt-get install usb-modeswitch
Install PPP driver
$ sudo apt-get install ppp
Download and install Sakis3G application, this is stable, and easy to configure, more info on www.sakis3g.com
$ sudo wget "http://www.sakis3g.com/downloads/sakis3g.tar.gz" -O sakis3g.tar.gz
Unpack files
$ sudo tar -xzvf sakis3g.tar.gz
Make file executable
$ sudo chmod +x sakis3g
Test connection (Use sudo, otherwise it maybe fails to open ports)
$ sudo ./sakis3g --interactive
1. Connect with 3G
1. USB device
3. HUAWEI Mobile
1. (internet) - (APN, maybe it differ at your mobile provider)
E180 connected to Phonero (24201). - Connected to internet
Check connection information
Interface: P-t-P (ppp0)
Connected since: 2016-01-18 14:39
Kilobytes received: 24
Kilobytes sent: 6
Network ID: 24201
Operator name: Phonero
APN: internet
Modem: E180
Modem type: USB
Kernel driver: option
Device: /dev/ttyUSB0
Make your own connection command
After testing internet connection, disconnect modem from menu
$ sudo ./sakis3g connect
Please select modem type by using OTHER variable, or by enabling interactive mode.
$ /home/pi/sakis3g --interactive "connect"
Available options are:
USBMODEM USB device
BLUETOOTH Bluetooth modem
CUSTOM_TTY Custom tty...
Example:
$ /home/pi/sakis3g OTHER="USBMODEM"
$ sudo ./sakis3g OTHER="USBMODEM" connect
Please select USB modem by using USBMODEM variable, or by enabling interactive mode.
$ /home/pi/sakis3g --interactive "OTHER=USBMODEM" "connect"
Available options are:
0424:9512 BUSNUM=001
0424:ec00 BUSNUM=001
12d1:1003 HUAWEI Mobile
1d6b:0002 DWC OTG Controller
Example:
$ /home/pi/sakis3g USBMODEM="0424:9512"
$ sudo ./sakis3g OTHER="USBMODEM" USBMODEM="12d1:1003" connect
Please select APN by using APN variable, or by enabling interactive mode.
$ /home/pi/sakis3g --interactive "OTHER=USBMODEM" "USBMODEM=12d1:1003" "connect"
Available options are:
internet (internet)
CUSTOM_APN Custom APN…
Example:
$ /home/pi/sakis3g APN="internet"
$ sudo ./sakis3g OTHER="USBMODEM" USBMODEM="12d1:1003" APN="internet" connect
E180 connected to Phonero (24201).
$ sudo ./sakis3g OTHER="USBMODEM" USBMODEM="12d1:1003" APN="internet" disconnect
Disconnected.