BBGW i2c and BLE problems (solved?)

Hi,
I have been playing around with the BBGW and I think it is a great board with many applications in the iot space. At the same time, I spend the last few weeks figuring things out and the lack of documentation is really frustrating. Actually it is not the lack of documentation, but also that some of the documentation is wrong! So if anyone from seedstudio is reading this, please correct the wiki

Here is some of my experiences:

My project involves the control of a robot. I am using an orientational sensor (BNO055 from Adafruit), I am planning to use iBeacons for orientation, and I am interfacing to a simple Motor control module L298N.

So I figured that all I need are a few GPIOs and the i2c.

I am using the newest build for the iot debian:
https://rcn-ee.net/rootfs/bb.org/testing/2016-08-07/seeed-iot/BBGW-blank-debian-8.5-seeed-iot-armhf-2016-08-07-4gb.img.xz

I found that the BBGW wifi router is not always working. To connect to wifi, I used connmanctl. It is pretty well documented.

For bluetooth LE I am using bluepy (https://github.com/IanHarvey/bluepy)
this is working fine expect for that python2.7 has an error when excecuting “sudo blescan”. It works really nicely on python3
which I wanted to use anyways.

Orientational sensor:
there is a tutorial on Adafruit on how to get the BNO055 working on the BBB so I thought I try that:
https://learn.adafruit.com/bno055-absolute-orientation-sensor-with-raspberry-pi-and-beaglebone-black/software

Unfortunately, python-smbus is currently not available as python3 module but I was able to compile it anyway.

There is an example script simpletest.py that assumes that the BBB uses i2c-1 and that the reset for the
sensor is driven by P9_12 or GPIO_60.
The problem is that for newer BBB and BBGW debian distributions there is no i2c-1, there is i2c-0 and i2c-2.
i2c-2 is the one that we should use, so I edited the script:
bno = BNO055.BNO055(busnum=2, rst=‘P9_12’)

Notice that it is not bus=2 but busnum=2 that indicates the use of i2c-2 (Adafruit got that wrong)

If you do that I noticed that when I use bluetooth LE, and i2c together then the script fails with I/O error.
It took me a week to figure out that BBGW uses GPIO_60 as BLE enable pin (this is not in the BBGW wiki!!!).
Btw, if you want to use GPIO pins be very careful, the BBGW is using many GPIO pins for something and it is completely
undocumented. I found that it works with P8_13.

Here is the script that I using to get everything installed and compiled:

sudo apt-get update

install bluepy python3

sudo apt-get install python3-pip libglib2.0-dev
sudo pip3 install bluepy

install python-smbus (from: http://www.linuxcircle.com/2015/05/03/how-to-install-smbus-i2c-module-for-python-3/)

sudo apt-get install python3-dev libi2c-dev
wget http://http.debian.net/debian/pool/main/i/i2c-tools/i2c-tools_3.1.1.orig.tar.bz2 # download Python 2 source
tar xf i2c-tools_3.1.1.orig.tar.bz2
cd i2c-tools-3.1.1/py-smbus/
mv smbusmodule.c smbusmodule.c.orig # backup
wget https://gist.githubusercontent.com/sebastianludwig/c648a9e06c0dc2264fbd/raw/2b74f9e72bbdffe298ce02214be8ea1c20aa290f/smbusmodule.c # download patched (Python 3) source

python3 setup.py build
sudo python3 setup.py install

sudo apt-get install -y python-smbus
sudo pip3 install Adafruit_BBIO

#install BNO055 library
cd ~
git clone https://github.com/adafruit/Adafruit_Python_BNO055.git
cd Adafruit_Python_BNO055
sudo python3 setup.py install

Hope to hear from others and their experience

Helmut Strey

Hi. Some of the same experiences here. Nice board in theory, but I’m trying to get PRU working with device overlays, and when I disable HDMI, wifi suddenly stops working. This is a big problem for me as PRU and HDMI have a quite large overlap in pinouts.