This project is designed to indulge the past time of war driving and possibly contribute to location accuracy in urban environments using scanned wifi networks and associated signal strength.
Set-up Energia IDEThe Energia IDE is best way to get started with using the WiFi Micro board. It uses the familiar Arduino interface and wiring language. A lot of Arduino libraries are also compatible with the Energia platform, so is easy to build upon existing work with small tweaks. When using the Energia platform select Redbear CC3200 Wifi Micro or Mini platform as shown in the screenshot below.
I tried using 2 different OLED's with the Wifi Mini, the SSD1327 Grove Oled from SeeedStudio and a generic SSD1306 i2c clone similar the Adafruit version. Both work well, the Adafruit version requires a slight tweak to the Adafruit SSD1306 library to work with Energia. There is very good pull request which will make it work fine with latest version from git. The Grove Oled works well with the SeeedOled library.
Here is a small video of the Adafruit demo code running on the SSD1306 Oled.
Scan WiFi and Display on OLEDAfter the OLED display is confirmed to be working, it is now time to scan for some wifi channels and display them. Energia has a prebuilt simple Wifi Scanner sketch. This works unaltered. The hardest part is dealing with long Access point names by fitting them in one line with horizontal scrolling and dealing with too many access points by paging through multiple lists.
Getting the GPS hooked up can be slightly tricky. The GPS I used is a UBlox Neo 6M module. It has its own 3.3V LDO and small backup battery to retain settings and almanac for a warm-start and quick GPS lock. However both of the UART's on the Wifi board are being used, UART0 for flashing firmware and UART1 shares the same pins as the i2c bus the OLED is connected on. There are a few options:
- 1. Use a SPI OLED and free up the I2C pins
- 2. Use pin remapping and use a differt set of pins for UART1
- 3. Temporarily disconnect the GPS while flashing and plug it back when running
I chose option 3 which seemed the simplest for a prototype and continuing with what I had at hand. A bit of integration with the TinyGPS++ library and I had the GPS datastream coming through.
Connect MicroSD and logConnecting a MicroSD and enabling SPI/FatFS gets a bit tricky again. The CC3200 supports an built in SDHost controller and sample code to transmit data to the card without CPU intervention. However I could not find Energia integration for this. However I did find Petit FatFS sample to log data and this is what I ended up using. Here is a small speed test and picture of the SD card hooked up. There are several limitations of the Petit FatFS approach including the need to pre-allocate the log file which gets over written on every reboot. I will look to implement a full blown SDFat system in the future.
This project will only become a true war driving project if you can hook-up a large antenna to the WiFi Micro, I am looking forward to a version which makes an external antenna possible. The SD card and pin remapping for secondary UART could also use a bit of attention. I will keep working to solve these and update the recipe accordingly. Meanwhile I am pretty happy with the not quite Arduino nature of Energia, it would however be nice to consolidate it into the Arduino project with the platforms/boards mechanism to hook up the TI compiler.
Comments
Please log in or sign up to comment.