You are here
Home > BBGW >

How To Connect BBGW To Internet

This post covers getting started with Beaglebone Green Wireless and connecting to internet using BBGW Wi-Fi. Received BBGW (BeagleBone Green Wireless) a customized BeagleBone from SeeedStudio. If you have used BBB (BeagleBone Black) then you might notice few difference like there is no 5V DC Jack socket in BBGW. I had trouble connecting to internet from BBGW. Lets get started with How To Connect BBGW To Internet.

If you have LCD cape and USB keyboard, you can setup Wi-Fi easily on BBGW. Lets get started with setting up without LCD cape and using command line.

Contents

First Power Up BBGW

There are lot of guide on setting up BBGW via USB. It is pretty straightforward, connect the USB to your computer/laptop, It will boot Linux from onboard eMMC. Wait for some time to see Wi-Fi access point on Wi-Fi, it will appear as “BeagleBoneXXXXXX”. Connect to this Wi-Fi and you will get default page asking for SSID of your Wi-Fi and enter the password.

BeagleBone Green Wireless Setup

This will setup your BBGW. Note down the IP address from this page as you will require to ssh. The detailed steps are available at seedstudio wiki. So far it is good and all steps works as mentioned. Once you press “done” it will redirect to “support” page. On this page you can connect to your BBGW board and run LED blink program from the browser itself. Its pretty cool to use BoneScript provided by BBGW to try and test your LED blink program.

Connect To BBGW

Here will check different ways to connect to BBGW. I had connected using default steps. I had verified if BBGW is connected or not. It will show display at the top of the BeagleBoard page like this:

Connect using Cloud9 IDE – You can connect to BBGW using Cloud9 IDE as well, just type http://192.168.8.1:3000 and you are connected to BBGW.

Cloud9 connected to BBGW

Connect using SSH – From the previous section you can easily ssh to BBGW.

Use ifconfig to find your BBGW network address.

beaglebone# ifconfig 

Now use your favorite desktop terminal client program either Putty or teraterm or mobxterm to ssh to BBGW with the IP, In my case BBGW IP address is 192.168.0.106, this might be different in your case.

$ ssh root@192.168.0.106

Just hit enter, as there is no default password for root. If you are doing ssh using default. The default username:password is [debian:temppwd].

BeagleBone Green Wireless Connect To Internet

So far, everything went rather smoothly, but setting up networking was more of a challenge. Before we get into details, I have tried to upgrade flasher image to latest image.

My default image on BBGW is “BeagleBoard.org Debian Image 2016-06-14”. The command dog cat will tell you what image you are at in BBGW, “cat /etc/dogtag”. The default Wi-Fi access point password for latest flasher images is “BeagleBone”.

When I tried to run apt-get update

@beaglebone:~# sudo apt-get update
Ign http://security.debian.org jessie/updates InRelease
Ign https://deb.nodesource.com jessie InRelease
Ign http://repos.rcn-ee.com jessie InRelease
Ign http://httpredir.debian.org jessie InRelease
Ign http://httpredir.debian.org jessie-updates InRelease
Err http://security.debian.org jessie/updates Release.gpg
Unable to connect to security.debian.org:http:

It is saying “unable to connect to repos.rcn-ee.com. The next thing I tried is to ping “googl.com” but with no response.

@beaglebone:~# ping google.com
PING google.com (172.1.8.1) 56(84) bytes of data.
From 192.168.0.105 icmp_seq=1 Destination Host Unreachable
From 192.168.0.105 icmp_seq=2 Destination Host Unreachable
From 192.168.0.105 icmp_seq=3 Destination Host Unreachable

This start to google and verify network settings for BBGW. I had two options: change the routing table or route the traffic through my laptop. Wi-Fi settings can be verified using “connmanctl”.

connmanctl> enable wifi
Error wifi: Already enabled
connmanctl> scan wifi
Scan completed for wifi
connmanctl> services
*AO SARVESH              wifi_2cf7f106b7a1_53415256455348_managed_psk
Gowda                wifi_2cf7f106b7a1_476f776461_managed_psk
connmanctl> agent on
Agent registered
connmanctl> connect wifi_2cf7f106b7a1_53415256455348_managed_psk
Error /net/connman/service/wifi_2cf7f106b7a1_53415256455348_managed_psk: Already connected
connmanctl> quit

In order to route BBGW traffic via my laptop, I have updated Wi-Fi properties on my laptop to allow other network users to connect through my computer’s internet connection.

 cat /etc/resolv.conf
# Generated by Connection Manager
nameserver 0.0.0.0
nameserver 192.168.0.1
nameserver 8.8.8.8

This did not work well.

@beaglebone:~# ping google.com
PING google.com (172.1.8.1) 56(84) bytes of data.
From 192.168.0.105: icmp_seq=36 Redirect Network(New nexthop: 192.168.0.1)
From 192.168.0.105: icmp_seq=39 Redirect Network(New nexthop: 192.168.0.1)

Then next option is to change the routing table and add details in /etc/network/interfaces. I had edited interfaces file using vi.

auto wlan0
iface wlan0 inet static
address 192.168.0.222
netmask 255.255.255.0
gateway 192.168.0.1
wpa-ssid {ssid}
wpa-psk {password}

Here I had specified static IP to the BBGW so that, I can easily SSH to BBGW. With this change most of the things broken and now I am not able to ping to BBGW also. It is not showing IP address on the start page now.

It just says, board is ready and can’t display my Wi-Fi access point. This point I can’t ping to previous board IP. But there is workaround for this and you can do SSH using SoftAp0 IP. SSH to the BBGW using SoftAp0 and revert back the changes in /etc/network/interfaces file.

$ ssh root@192.168.8.1

Now both the methods have failed so we had contacted IRC channel (#beagle). The problem seems to be with nameserver.

root@beaglebone:~# connmanctl state
State = online
OfflineMode = False
SessionMode = False
root@beaglebone:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether e4:15:f6:fd:a4:91 brd ff:ff:ff:ff:ff:ff
inet 192.168.7.2/24 brd 192.168.7.255 scope global usb0
valid_lft forever preferred_lft forever
inet6 fe80::e615:f6ff:fefd:a491/64 scope link
valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,DYNAMIC,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 2c:f7:f1:06:b7:a1 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.106/24 brd 192.168.0.255 scope global wlan0
valid_lft forever preferred_lft forever
inet6 fe80::2ef7:f1ff:fe06:b7a1/64 scope link
valid_lft forever preferred_lft forever
4: SoftAp0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether e4:15:f6:fd:a4:90 brd ff:ff:ff:ff:ff:ff
inet 192.168.8.1/24 brd 192.168.8.255 scope global SoftAp0
valid_lft forever preferred_lft forever
inet6 fe80::e615:f6ff:fefd:a490/64 scope link
valid_lft forever preferred_lft forever
root@beaglebone:~# ip route
0.0.0.0 via 192.168.0.1 dev wlan0
default via 192.168.0.1 dev wlan0
192.168.0.0/24 dev wlan0  proto kernel  scope link  src 192.168.0.106
192.168.0.1 dev wlan0  scope link
192.168.7.0/24 dev usb0  proto kernel  scope link  src 192.168.7.2
192.168.8.0/24 dev SoftAp0  proto kernel  scope link  src 192.168.8.1
root@beaglebone:~# cat /etc/resolv.conf
# Generated by Connection Manager
nameserver 0.0.0.0
nameserver 192.168.0.1

The router (TP-Link) is telling the BeagleBone that the nameservers are “0.0.0.0” and “192.168.0.1”. The other devices in network connects to next nameserver when “0.0.0.0” is not reachable. This is not working in case of BBGW as somehow “0.0.0.0” isn’t reachable and BBGW is not trying to the next dns server.

The solution is to set the nameserver for BBGW. This will be done using “connmanctl config SERVICE nameservers 192.168.0.1. Here SERVICE is the name of your Wi-Fi connection, shown by “connmanctl services” (in the right column)

connmanctl> services
*AO SARVESH              wifi_2cf7f106b7a1_53415256455348_managed_psk
connmanctl> config wifi_2cf7f106b7a1_53415256455348_managed_psk nameservers 192.168.0.1
connmanctl> exit
root@beaglebone:~# ping google.com
PING google.com (142.250.67.238) 56(84) bytes of data.
64 bytes from bom07s24-in-f14.1e100.net (142.250.67.238): icmp_seq=1 ttl=116 tim

This shows updated nameserver entries in “/etc/resolv.conf” file.

@beaglebone:~#  cat /etc/resolv.conf
# Generated by Connection Manager
nameserver 192.168.0.1

With this I am able to finally run apt-get update on my BeagleBone Green Wireless board. Hope you have enjoyed this How To Connect BBGW To Internet short guide.

You can connect your BBGW using “ssh debian@beaglebone” and/or “ssh debian@beaglebone.local”, Enter password as “debian:temppwd”. if you use multiple beaglebones, be sure to give them individual hostnames with “ sudo hostnamectl set-hostname HOSTNAME ” (replace HOSTNAME by the desired name for the beaglebone).

systemctl status $(pidof gpsd)

Leave a Reply

Top