This section contains details of the Raspberry Pi and things that you can plug into it. If you want to know about devices that your Raspberry Pi can connect to by wireless, please see the Devices section.

Raspberry Pi

The bridge software, cbridge, will run on Raspberry Pi Models A, B and B+. We recommend either a B or B+, because it's useful to have plenty of USB ports for adding connectivity. Our standard setup today is a Model B+ with a WiFi 802.11N micro-USB dongle, and a Bluetooth 4.0 USB dongle. Inside, we add a Razpberry board for Z-Wave communication.

WiFi dongles

We have used a variety of WiFi USB dongles, including some very cheap ones, and all have worked well. You can't go wrong by buying from one of the Raspberry Pi resellers, who test the dongles they sell with Raspberry Pies. WiFi drivers are included as standard with the Raspbian Linux distribution.

Bluetooth LE (Bluetooth Smart)

As with WiFi dongles, we've used a number of different types and all have worked. There are some reports on the web about people having problems with some dongles, which we have not verified, but it does seem that those using the CSR chipset, often branded as a "Bluetooth CSR 4.0 Dongle" always work well.

Z-Wave

The ContinuumBridge platform uses the z-wave.me Razberry board, which is available from a variety of resellers in different regions. All you need to do is plug the board into your Raspberry Pi and download the software in accordance with the z-wave.me instructions.

Cellular/3G Modems

The ContinuumBridge platform supports connection using USB modems (dongles) as well as via Ethernet and WiFi. We have tested it with a variety of dongles on several mobile networks. We have used the following:

  • Huawei E3131
  • Huawei E3131A
  • ZTE MSM MF112

3G modem software is installed when the cbridge/setup script is run, but you'll need to go through the following steps to set up your USB dongle.

A good post on how to use dongles with the Raspberry Pi can be found here. Based on this, here is how you can determine how to use a particular dongle with cbridge. First, type:

lsusb

This lists all USB devices. Hopefully you'll be able to identify one as your modem. Eg:

Bus 001 Device 010: ID 12d1:14fe Huawei Technologies Co., Ltd.

Next, type the following:

sudo /usr/bin/sg_raw /dev/sr0 11 06 20 00 00 00 00 00 01 00

You'll see some output, and then type lsusb again. Hopefully, you'll see that the device ID has changed:

Bus 001 Device 011: ID 12d1:151d Huawei Technologies Co., Ltd.

In this case, all is well. Now type:

ifconfig

It's likely that several interfaces will be listed, such as eth0, if you're connected via Ethernet, or wlan0, if you're connect via WiFi. You should also see one of eth1 or wwan0:

eth1      Link encap:Ethernet  HWaddr 58:2c:80:13:92:63  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wwan0     Link encap:Ethernet  HWaddr 58:2c:80:13:92:63  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

If you see eth1, then type:

sudo dhclient eth1

If you type ifconfig again, you should see that eth1 now has an IP address:

eth1      Link encap:Ethernet  HWaddr 58:2c:80:13:92:63  
          inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:824 (824.0 B)  TX bytes:824 (824.0 B)

You can then open a web browser and connect it to: http://192.168.1.1. You will then be able to enter you network operator's APN details into the dongle. You may find that they are there already, in which case your modem will already have connected to the Internet by the time you get to this point, if you have network coverage. You only have to do this once, or if you change to using a different SIM.

🚧

Browser-sensitive dongles

We have found that even dongles with the same part number and from the same manufacturer (in particular the Huawei E3131 and E3131A) can behave differently. In part, this can be if a dongle was originally locked to a particular network. One idiosyncrasy that was noticed was that it appeared that network details could not be changed (they were "greyed-out") in Crome and Firefox browsers, but could be changed when Internet Explorer was used. We suggest, therefore, that if you experience this problem you try using IE.

If you see wwan0 rather than eth0, proceed as follows.

sudo cp /opt/cbridge/bridge/bridgeconfig/sakis3g.conf /etc/sakis3g.conf

Then edit the file /etc/sakis3g.conf (eg: using sudo vi /etc/sakis3g.conf). It will look like this:

APN="CUSTOM_APN"
CUSTOM_APN="pp.vodafone.co.uk"
APN_USER="web"
APN_PASS="web"
USBINTERFACE="0"
OTHER="USBMODEM"
USBMODEM="12d1:151d"

This is set up for a Vodafone UK pay-as-you-go APN. Change the CUSTOM_APN, APN_USER AND APN_PASS to those provided by your network operator (if you don't know them, Google your operator and APN. Eg: "GiffGaff APN", for GiffGaff). Finally, change the USBMODEM line to replace "12d1:151d" with the USB ID from the second time you typed "lsusb", above (after running "sudo /usr/bin/sg_raw").

You can test that this wwan0 method is working by typing:

/usr/bin/sakis3g --sudo connect --debug

The --debug prints a lot of information to the screen, which may help you find out what is happening if something has gone wrong. This command may not work the first time you try it. If it doesn't, type it for a second time. Once it has finished, you should be connected, a fact that can be confirmed by typing "ifconfig" again. You should then see a ppp0 entry like this:

ppp0      Link encap:Point-to-Point Protocol  
          inet addr:10.144.73.94  P-t-P:10.64.64.64  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:24 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:1398 (1.3 KiB)  TX bytes:1677 (1.6 KiB)

Once you have done one of the above, cbridge will take care of connecting using your 3G dongle every time you start it with the dongle inserted. We have been asked if these instructions can be used if you're not running cbridge. The answer is yes. You can still get all the necessary software by installing cbridge and just not running it, or you can install the necessary modules separately. You'll need sg3-utils, which installs the sg-raw command, sakis3g and ppp, which you can install with the following:

apt-get install -y sg3-utils
wget "http://raspberry-at-home.com/files/sakis3g.tar.gz"
tar xfz sakis3g.tar.gz
cp sakis3g /usr/bin/sakis3g
apt-get install -y ppp

πŸ“˜

Conman

All the necessary software is also installed if you install the ContinuumBridge connection manager, conman. Conman is installed with cbridge, but if you're not using cbridge you can just install conman by following the instructions here:

https://github.com/ContinuumBridge/conman

Peripherals

We refer to things that plug into the GPIO header on the Raspberry Pi. Examples include various sensors (eg: temperature, humidity) and relays. To a bridge-app, these look like and other devices and, like other devices, they have adaptors. You can write adaptors for peripherals in the same way as you would write an adaptor for any other sort of device. GPIO devices are essentially "discovered" in the same way as other devices, but you need to tell cbridge that they are there. To do this, use the following line in the thisbridge.sh file:

export CB_PERIPHERALS="my_peripheral_1, my_peripheral_2"

The names my_peripheral_1 and my_peripheral_2 must be the same as the names given when you created the device using the "cb --device post" command.

If a bridge has peripherals, the first time the "Connect to a Device" button is pressed on the portal, the first peripheral will be "discovered" and any other peripherals will be "discovered" on subsequent presses of the button until they are all in the devices list. You can give peripherals friendly names in the same way that you can for any other type of device and then apps can use them in the same way as other devices.

Note that you can plug things into the GPIO header that are not "peripherals". An example is the z-wave.me Razberry board. The difference is that this board is used to communicate with other devices rather than being a device in its own right.

Next ...