| Next Thing CHIP computer connected to Bayer Contour Next 2.4 meter and battery (under CHIP) |
I've been lucky enough to have our 640g Nightscout solution up and running with our little PWD wearing a Sony Z3 Compact (Z3C). I had to role it back to Android 4.4, tweak the home router and setup a VPN to get it working across networks. With a strong 4G signal it worked. But strong 4G isn't guaranteed. The setup would drop during some uploads and - worst of all - it would sometimes require a manual removal and reinsertion of the Bayer Contour Next Link 2.4 meter (I'll be calling this the 'Bayer' from now on). Even when running on local WiFi, for example at home or school (thank-you school...), it would still require a pull to get things moving again. Whilst doable is not ideal.
![]() |
| Original mobile solution: Z3C phone |
So, do I pick up another OTG-compatible Android phone or try something else?
It's worth being 100% clear now, that I don't need a cellular (3G or 4G) connection - Janki has good WiFi access at home and at school, which covers a very significant percentage of the time we'd like Nightscout coverage.
Whilst Janki had been using a Z3C during some days, I relied on a Raspberry Pi 2 Model B at night. With VirtualHere this proved very reliable. Occasionally VirtualHere would lose sight of the Bayer, but that can be monitored by a simple script and - for the majority of instances - a controlled reboot was all that was required. The system would usually run through the night with zero or one automatic reboot.
| Nighttime rig - Raspberry Pi |
But although an adult can cope with a Pi and battery (see the amazing OpenAPS for a good example!) a four year old is not going to be happy with that. The Raspberry Pi Zero was interesting, but I figured that by the time I'd bolted on WiFi, a battery (with power management) and USB hub we'd be adding quite a lot of size and some weight. That said, I believe it is more power efficient and with some lateral thinking a neat solution could emerge.
Jason Calabrese showed what could be done with the Intel Edison.
<
Wow. But the Edison is on the expensive side for a four year old tearing across the playground each day.Testing out a tiny #OpenAPS rig, Edison + battery + RileyLink, it even survived the drop while taking the photo pic.twitter.com/fH74kskuJA— Jason Calabrese (@jasoncalabrese) February 6, 2016
So I settled on the CHIP from Next Thing.
| Bayer, CHIP computer and Lithium Ion Polymer battery |
- Built-in WiFi (doesn't use up a USB port)
- On-board power management
- Connect any single cell (1S) 3.7V Lithium Polymer (LiPo) battery (2-pin JST-PH 2.0mm)
- Micro and full-size USB available
- 4GB of internal storage (more than enough - doesn't need a SD card)- 512MB RAM (more than enough)
For around £30 (shipped to the UK, via eBay at the moment. Next Thing still have a sticker price of $9 for the US, but shipping doesn't begin until June 2016) I think you get quite a lot for not very much in a small package (60x40mm). With a 2,500 mAh LiPo battery (which is around the same size as the CHIP), and the CHIP's onboard power management circuit, you get charging and controlled, regulated power from the battery all built-in. It takes around 5 hours to charge the battery when the CHIP is connected to a regular phone charger (5v, 1A) via the micro USB port.
So how well does it work?
Well, it's not perfect. But it is small and lightweight and - crucially - flexible.
Power
The 2,500mAh battery usually lasts for 7-9 hours ie enough for a school day.
Peak power draw (when communicating with the Bayer stick is around 415mA, with an average draw of around 300-350mA.
With the aid of a small script, which runs via a cron job, I can monitor
- VirtualHere Server status (e.g. restart VirtualHere if required)
- VirtualHere Connection status (e.g. restart CHIP if required if the USB hub has dropped the Bayer)
- Battery Life (e.g. properly shutdown the CHIP before power fails)
- Battery temperature (e.g. properly shutdown the CHIP before the LiPo battery gets dangerously hot)
As root, from the command line:
crontab -e
Add the following line:
*/5 * * * * /bin/bash -lc /root/vh_cron.sh
Ctrl-X and Y to update and exit.
(note: -lc forces the script to run with all the usual login files, sorting any path and scripting maths problems out)
The script is still very much work in progress - Alpha at best...
Please do not use it other than testing / evaluating.
Conclusion
There are still a few occasions when a physical disconnect is required.Issuing unbind commands to the USB hub does not seem to help :( Note that a reboot does not power down the USB hub on the CHIP. So it's not perfect. But it does sit nicely in an iPhone 4 case which lots of protection for the solid, full-size USB connector and - hopefully - will be more school-proof than the phone was :)
CHIP Tips
- No sign of life? Use the boot repair tool. Mine appeared dead on arrival...
- If you're going to use this on a school (or public) WiFi network please change the default password
- Use lsusb -t to see what the system thinks is plugged in to the USB ports.
- Don't place the battery immediately against the underside of the CHIP board - the R8 CPU and battery will soon heat each other up.
Bayer Tips
- Short uploads work better - sync with the Bayer connected directly to a PC if you haven't used Nightscout for more than a day or so (this may be due to difficulties maintaining a high current draw on the CHIP).
- Continuous flashing on connection with blank screen? Disconnect the Bayer and reconnect it to the USB stack. (a few flashes on connection is usual, but it should stop)
- Occasionally our Bayer reports (on screen) a Software Error - follow the on-screen instructions and disconnect and power down the Bayer for a few seconds before reconnecting the device.
- Pump battery does appear to influence RF (communication) range. Get the Bayer as close to the pump at possible when battery is low.
Update: If you've landed here looking for Nightscout on your 600-series pump, thanks for stopping by :) The simplest way to get your pump on to Nightscout is to use the 600-series Android Uploader. Enjoy!

No comments:
Post a Comment