Coder Social home page Coder Social logo

pingrf's Introduction

BEWARE! This software is highly experimental, and is NOT INTENDED
for diagnostic or medical use. I have no affiliation with Animas or J&J.

Pingrf implements RF communications with the Animas OneTouch Ping
insulin pump. Pingrf is factored into three components: Packet radio
firmware (using the TI/Chipcon CC11xx series chips); a radio RPC
layer, so that clients may communicate with the packet radio through
UART or SPI; and a pump driver, which implements the pump session
and application layers.

All are provided as cleanly separated APIs.

Command cmd/pingrf implements a utility and test client for pingrf
using Unix ttys. This tool demonstrates how to construct a pump client
and invoke it. It's also useful in its own right, e.g.,:

	% pingrf -h
	usage: pingrf [-t tty] [-b baud] [-dh] command [options]
	Where command is one of:
	  chkadd data checksum
		Add known data-checksum pair. Arguments are hexadecimal strings.
	  combo insulin hours
		Issue a combo bolus for the given amount of insulin and time.
	  cancelcombo
		Cancel a currently running combo bolus.
	  pcall status
		Retrieve the home-screen status message of the pump
	  pcall status1
		Retrieve status screen 1 from the pump
	  pcall status2
		Retrieve status screen 2 from the pump
	  pcall status3
		Retrieve status screen 3 from the pump
	  pcall cancelcombo
		Cancel an existing combo bolus

Setup instructions (for raspberry pi):
	Once completed, pingrf can be used from raspberry pi shell to control
	Ping using the commands above.

HW required:
	raspberry pi, ftdi/usb cable, cc1110 mini development kit
	(pin header installed on cc1110 & some jumper wires between c1110 & ftdi/usb)

HW setup:
	1) connect cc1110 to raspberry pi using two connections
		2.1 - raspberry pi <-> usb cable <-> cc debugger
			<-> adapter <-> debug pins on cc1110
			this connection is to program cc1110 and to power it up.
			if properly connected, cc debugger will show green.
			jumper on cc1110 should remain between p3/4 and
			no need to install battery.
		2.2  - raspberry pi <-> ftdi/usb cable <-> cc1110 INT10 UART pins
			P0.2 to TX on ftdi/usb cable
			P0.3 to RX on ftdi/usb cable
			P0.4 to RT on ftdi/usb cable
			P0.5 to CT on ftdi/usb cable
			this connection is to communicate between pingrf and cc1110.
			wires are cross-wired. i.e. RX on cc1110 is connected to RX on ftdi


SW setup
	1) raspberry pi needs to be set up according to openaps instruction
	2) install sdcc - compiler for cc1110 firmware
		sudo apt-get install sdcc
	3) install cc-tool - to program cc1110
		git clone https://github.com/dashesy/cc-tool
		sudo apt-get install libboost-all-dev libusb-1.0-0-dev
		cd to cc-tool directory
		./configure
		make
		make install
	4) clone pingrf repository
		git clone https://github.com/mariusae/pingrf
	5) burn new firmware unto cc1110. once programmed, the board will reset
		cd pingrf
		cd cc1110
		sudo make UART=1 flash
	6) pingrf now needs to learn checksum for a given command
		export TAP=<some directory>
		makedir -p $TAP
		cd pingrf
		cd cmd
		make
		pingrf -d chklearn (now use pump remote to scroll through status pages)
		control-c to terminate pingrf when you are done
	7) pingrf is now ready
		'pingrf stat' to see the pump status output

debug hints
	1) not every remote will use the same wake up payload. if the hardcoded
		value in libpump/conv.c doesn't work, pingrf stat will time out.
		capture the 0000 0004 related payload from "pingrf -d chklearn"
		and replace those four bytes in order. example:

			0000 0004 e02d 6bd2 AABB CCDD

	2) if pingrf fails and complains about missing checksum, then pingrf didn't
		learn the command/checksum combo as part of "pingrf -d chklearn".
		just reissue the command and use your remote to replicate the
		action that you are looking for pingrf to do. the existing
		table will be added with new command/checksum combo

Bootloader

Pingrf supports bootloading using the rfcat bootloader.

 1.	Put the card into bootloader mode. (This can be done manually or
 	with "rfcat --bootloader", or through the interactive rfcat prompt.)
	 	$ rfcat -r
		>>> d.bootloader()
 2.	make cc1111+ccloader.ys1load


Enabling bootloader mode on the Yardstick One, by connecting pins 7 and 9:
	-----------------------------------------
	| YARD Stick One      2 4 6 8 10 12 14  |
	|                     1 3 5 7 9  11 13  ------
	|                                        USB |
	|                                       ------
	|                                       |
	-----------------------------------------

pingrf's People

Contributors

bewest avatar dclovesdc1 avatar komby avatar mariusae avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.