Skip to content

Instantly share code, notes, and snippets.

@bewest
bewest / README.markdown
Created October 6, 2012 21:02
errors using serial port using naive

Using beaglebone with serial devices with usbserial and ftdi_sio

Using usbserial

Normally issuing modprobe usbserial vendor=0xF00D product=0xDEAD creates a /dev/ttyUSB$x. The parameters here are optional, so if you are lucky and your device is curated by the linux community, modprobe usbserial might work. On my ubuntu home systems, this usually uses the pl2302 driver or something similar.

This assumes a lot: that you have a working kernel with a bunch of

# http://pyserial.svn.sourceforge.net/viewvc/pyserial/trunk/pyserial/serial/tools/miniterm.py
#!/usr/bin/env python
# Very simple serial terminal
# (C)2002-2011 Chris Liechti <cliechti@gmx.net>
# Input characters are sent directly (only LF -> CR/LF/CRLF translation is
# done), received characters are displayed as is (or escaped trough pythons
# repr, useful for debug purposes)
@bewest
bewest / README.md
Created July 29, 2018 18:02
Getting one day data out of Nightscout

Get one day data out of Nightscout

Here's how to get one day of data out of Nightscout. The trick is in realizing that the field used to define the date is different between different data types, and that different data types are stored in different places. In addition, the API itself has interesting behaviors, for example to switch between tsv, csv, and json outputs, to perform regex based searches, and in some cases bugs to work around.

Mechanics of the search syntax. The API endpoints support a query string syntax used to compose queries.

@bewest
bewest / nightscout_sustainability_pledge.md
Last active September 20, 2023 01:25
nightscout sustainability pledge

The Nightscout Sustainability Pledge

Towards an enduring Nightscout

The Nightscout ecosystem thrives on the collective efforts of a wide range of contributors, from independent users to large distribution entities. Each role within this ecosystem has unique responsibilities and opportunities to contribute towards the project's sustainability. Recognizing these distinct roles and their implications is crucial for ensuring the long-term growth and success of Nightscout.

  1. Distributors of Nightscout:
  • Distributors play a key role in increasing the reach of Nightscout. Their commitments focus on ensuring safe distribution, regulatory compliance, and providing sustaining support.
  • Distributors prioritize user safety and commit to staying updated with the latest releases and recommendations from the Nightscout core team.
  • They understand the importance of regulatory and legal compliance, making efforts to align with global standards and adapting to regional specifics.
# http://wiki.openwrt.org/doc/devel/packages
include $(TOPDIR)/rules.mk
# PKG_NAME -The name of the package, as seen via menuconfig and ipkg
PKG_NAME:=bridge
# PKG_VERSION -The upstream version number that we're downloading
PKG_VERSION:=1.0.6
# PKG_RELEASE -The version of this package Makefile
PKG_RELEASE:=1

Medtronic SSO Resource Ownership

Get Access Code

Select Locale

GET https://carelink.minimed.eu/patient/sso/login?country=gb&lang=en
@bewest
bewest / one-devicestatus.json
Created May 5, 2023 00:01
nightscout data examples, one of each core type.
{
"_id": "64542c86cb9fdd081dd8dec4",
"pump": {
"suspended": false,
"bolusing": false,
"manufacturer": "Medtronic",
"clock": "2023-05-04T22:07:02Z",
"reservoir": 146.4,
"secondsFromGMT": -25200,
"pumpID": "208850",
// This does practically the same thing that TryFrom<&str> does.
// Additionally, upon implementing FromStr, you can use the `parse` method
// on strings to generate an object of the implementor type.
// You can read more about it at https://doc.rust-lang.org/std/str/trait.FromStr.html
use std::str::FromStr;
#[derive(Debug)]
struct Person {
name: String,
age: usize,

Nightscout Connect

Use xstate to create generic control flow and logic for well behaved, session consuming http agents that sync from a third party data source and then uploads the data to Nightscout.