Connect BeagleBone Black to Cellular with Huawei E303 Modem

Sometimes your BeagleBone project needs to be mobile and connect to the cloud. This tutorial walks through setting up a USB modem.

Categories: Beginner

This tutorial will guide you through connecting a BeagleBone Black to the Hologram cellular network. The BeagleBone has some complications that make this a little more difficult than the Raspberry Pi:

  • There is only a single USB host port, so you can’t plug in a keyboard and mouse at the same time as the modem without a USB hub.
  • The default OS image does not support creating an Ethernet device for the modem in HiLink mode.

To get around the first issue, we’ll be using another PC for the bulk of the configuration, and using SSH over the USB client port to finish the setup. For the second issue, we’ll need to boot the BeagleBone off of a MicroSD card with a newer OS image on it.

Activate your SIM

If you haven’t already,
create a Hologram account
to manage your devices and billing. From the
Hologram Dashboard,
click the
Activate SIM
button in the top-right corner.

Hologram SIM activation is cake!

Every SIM card has an 18-22 digit unique ID printed on it. Enter your SIM’s ID in the activation form.

Then, choose your data plan and zone according to your needs. If you aren’t sure which plan is right for you, start with pay-as-you-go. See our
pricing page
for more details on plans and zones.

Set up the E303 Modem using another PC

The Huawei E303 USB modem is an extraordinary cellular modem for development and testing work. You can buy the E303 from
our online store.

The E303 supports two modes: in the default HiLink Mode, the device acts as a standard ethernet network interface, and you can configure the basic modem options through a web UI. In serial mode, the device exposes a low-level serial interface which allows for more control over the behavior of the modem.

HiLink Mode (Windows and MacOS)

  • Slide the cover off of the Huawei E303 Modem and insert your Hologram SIM card with the full-size SIM insert.

  • Plug the modem into your computer. The modem will mount itself as a storage device with the appropriate drivers on it. Install the drivers from the device, or download and install the latest drivers from the
    Downloads
    section of the
    E303 product page.
  • When the install is finished, a web browser should automatically open to the Huawei HiLink settings page. If this doesn’t happen, navigate to
    192.168.1.1
  • Click
    Settings->Profile Management->New
    and add a profile for the Hologram APN (
    hologram
    ) as shown here:

APN setup, username and password stay blank

  • Save all that and then go to the Connection Settings page. Enable all of the auto connect options as shown here:

  • Finally click back to the Home page and click the connect button. You should now be connected to the internet via cellular.

HiLink Mode (Linux)

NOTE
: These steps assume a graphical interface so you can configure the modem via a web UI. If you are working with an embedded Linux device with only a command line interface, you can set up the profile on another computer, then plug the modem into the embedded device.

  • Install the
    usb-modeswitch
    utility, which will handle switching the modem from storage mode to modem mode. For Debian-based distributions (e.g. Ubuntu and Raspbian), this package can be installed from the standard repositories with:
sudo apt-get update 

sudo apt-get install usb-modeswitch


  • Then reboot your PC.
  • Slide the cover off of the Huawei E303 Modem and insert your Hologram SIM card with the full-size SIM insert.

Then plug the modem into a USB port on your Linux machine.

  • Run
    ifconfig
    to find the
    eth*
    device corresponding to the modem. If you are unsure which
    eth
    device is the right one, you can unplug the modem and see which one disappears when running
    ifconfig
    again.

  • If the network interface doesn’t have an IP address assigned (no
    inet addr
    entry in
    ifconfig
    ), run the DHCP client to acquire an address:
    sudo dhclient eth1
    where
    eth1
    should be replaced with the modem’s device name.
  • Open a web browser to
    192.168.1.1
    to configure the modem via web UI. Set up the Hologram APN profile and connection settings as described in the Windows/Mac instructions above, then click the
    Connect
    button on the device home page.
  • Disable or unplug your PC’s other network connections (Ethernet or wireless), then test your internet connection:
    ping -c1 hologram.io
  • If you get an error, you may need to add a route configuration so that network traffic is routed to the new cellular interface. From the command line, enter:
    sudo route add default gw 192.168.1.1 eth1
    where
    eth1
    should be replaced with the modem’s device name. Then retry the
    ping
    .

To automatically enable the modem whenever it’s plugged in and across restarts, you’ll need to modify the networking config. In Debian-based distributions, add the following lines at the end of the file
/etc/network/interfaces
:

allow-hotplug eth1

iface eth1 inet dhcp


Where
eth1
should be replaced with the modem’s device name.

Comments are not currently available for this post.