In The Air – Week 6

Last week, I set up openHAB to visualise data on my FuelTank’s battery state. But how did I access this data from the CC3200? Let’s find out …

Energia & CC3200 on Mac

But first … another problem was solved!

At long last, the CC3200 is working with Energia on my Mac, thanks to pmohan for pointing me to the solution. The issue was caused by the latest version of OSX (Yosemite) not allowing to run unsigned drivers (“kext”).

Screen Shot 2014-11-19 at 20.50.30

Using a manual fix which disables the signature checking in OSX, the driver can be loaded and the CC3200 detected in Energia! Woop!

Trial & error

During my research, I came across some posts and reviews by Peter Oakes in which he created an Energia sketch to retrieve some statistics from the Fuel Tank BoosterPack via I2C.

I hooked up the Fuel Tank Boosterpack to the CC3200, loaded the sketch in Energia and monitored the serial output. Nothing spectacular happened.

Screen Shot 2014-11-23 at 18.34.01

All values were “0”. This meant that either the sketch would somehow not be compatible with the CC3200 or that the I2C slave was unreachable.
Searching a bit more, I came across a library (it’s at the bottom of that page – or here) doing the same thing, and the result was unfortunately the same. (What was I expecting ??)

Recovering the battery

At some point, I connected the Fuel Tank to the CC3200 and had it run on the battery without charger.
Unfortunately, the battery discharged a bit faster than expected, while I was away at work.

The result ? By the time I got home, the battery would no longer charge via the Fuel Tank when connected to a power source.

Looking through the Fuel Tank’s documentation, there is a trick to “kickstart” the charging of the battery in case it was discharged too much.
The procedure is described in paragraph 6 of the user guide and helped me recover the battery, after which it was charging with the Fuel Tank again.

Pinout diagrams

In order to troubleshoot the problem, I searched pinouts of both the CC3200 and the Fuel Tank BoosterPack. I found both on the Energia website.

cc3200lppinmap fueltankbppinmap

What I noticed based on these diagrams, is that the Fuel Tank BoosterPack seems to have multiple I2C pins!
Using jumper wires, I tested the different I2C pins of the BoosterPack with the CC3200, until I found a working set.

After that, I connected the BoosterPack to the CC3200 and used the jumper wires on the CC3200 directly. Like so:

Screen Shot 2014-12-05 at 12.56.17

(Fritzing part for the CC3200 was found here: New CC3200 Launchpad Fritzing Part)

I removed the jumpers connecting the onboard sensors to the I2C bus and connected jumpers to the I2C pins attached to the underlying BoosterPack.
Because I removed the jumpers of the onboard sensor, I had to ensure the “pull-up” jumper on the BoosterPack was in place. You can verify the pull-ups are ok if the green and orange LEDs of the CC3200 are on.

With this little manipulation, I was finally having proper readings on the Fuel Tank’s data with both Peter’s code and the library:

Screen Shot 2014-11-23 at 22.33.50 Screen Shot 2014-11-23 at 22.42.08

Glitches in the readings

I did notice some glitches in the values read when doing the following:
connecting/disconnecting a charging source
having the CC3200 connected via USB to PC (for Serial output) at the same time

Sketch

This is my current sketch. It’s still very basic and rough, but it does the trick for now.
It will need to be improved to go into deep sleep after sending the values, until the next set of values is to be sent.

The result of the data being received, as seen from openHAB:

Screen Shot 2014-11-27 at 14.57.12

Leave a Reply

Your email address will not be published. Required fields are marked *