Would you like some Pi with your app?

This is in very early stages, as I just got a sample app running on a Raspberry Pi Zero W yesterday, but with the new BLE api in CIQ 3.1, I'm talking to it!  Nothing too exciting, as I'm just reading three characteristics with system info from the pi, and displaying them in a CIQ app (it runs on an f5+ with the CIQ beta 3.1.0 FW).  I scan for the Pi, connect to it, and then read the data every 30 seconds.  I can see some possibilities doing something like this!  Anyone else been checking out the new BLE stuff?

  • I should! This is what I need to open my PiGarage!

    There was a time I wanted to reverse engineer BLE between Connect and devices! Scream

    Great job Jim!!

  • Hi Jim,  Did you find example code to start from or did you have to write this from scratch?

  • On the CIQ side, there are a couple samples in the 3.1,0 beta SDK that talk to the Nordic Thingy52.  On the pi side, I found a 3 year old page with a sample to install.  It was a bit outdated when it came to versions, and the steps required.  Yesterday I started with a clean pi install and recorded the steps that were actually needed (turns out it was just a handful of things needed in pi, and I had a tar of the modified pi sample that I just had to untar.

    Here's the page I started with to get things rolling, but like I said, there things that are not needed/the same right now, at least with the pi zero W.  I ignored the whole phone app side and just used CIQ and one of the nordic tools.

    https://www.hackster.io/inmyorbit/build-a-mobile-app-that-connects-to-your-rpi-3-using-ble-7a7c2c

    On the CIQ side I had my own app that talked to the thingy (based on the sample in the SDK, but I added a couple services), and just hacked it a bit to work with the pi (different service/characteristics etc), but it had all the queueing scanning stuff needed.  You need some nordic HW so the sim can talk BLE, but without that, the CIQ special 20.01 FW for the f5+ is working fine.

  • Just an update on this, as I've added some sensors!

    By the way, when I get some more stuff hammered out, I plan a complete write up on this, with steps in setting up the raspberry Pi, a same app for it as well as a sample CIQ app.  I'm still learning the pi, java script and Python  so no promises on timeframe!

    Ok, why python?  Because I needed that to talk to a Envro PHAT, an add on board with a bunch of sensors.  Temperature, humidity, light, position, and 4 analog inputs.  Here's what I'm working with:

    The Raspberry Pi Zero W is in a case, the Enviro phat on top.  The red cables are HDMI and USB for monitor and keyboard, the green wire is to tie one of the analog inputs high for testing, and black is the power cable.  The tricky part here was getting the js script to run a python script and to catch the output in a way to send it over BLE to a CIQ app.  And here's the result.  I read the values every 2 minutes right now.

  • very cool - is the idea that others could use your code and a pi to develop our own connect iq BLE apps, without needing the BLE tool recommended by Garmin? i have a Pi already and there is 0 chance i would buy a tool just to tinker with.

  • When developing/testing with the sim, you still need one of the two nordic boards so the sim can talk to the pi.  The pi is just acting as a sensor in this case - Something for a CIQ app to talk to.

  • i haven't studied up on the ble yet at all - are the nordic boards for the PC side?  so if i wanted to try to do without the sim i wouldn't necessarily need them?

  • One of the two Nordic boards is need for the sim so it can talk BLE.  There's a section in the 3.1.0-beta3 Programmer's guide on how to set them up.  The dongle was $10US, and if you're developing something, well worth the cost vs side loading to test the CIQ end. https://www.nordicsemi.com/?sc_itemid=%7BCDCCA013-FE4C-4655-B20C-1557AB6568C9%7D

    But once there is an app, you can side load to a watch (with a 3.1 VM - like the 8.02 beta for the f5+) and talk directly to the Raspberry PI.  You need the SW I'm writing for the pi.

    On the pi, I'm now getting the "base" info, like memory, uptime, and load, with the Enviro PHAT, getting things like temperature and air pressure, and without a hat/phat, I'm also doing direct control of GPIO pins. Right now I use 2 for output - LEDS for testing - and 2 for input (switches/push buttons).