605 stories
·
8 followers

glucometerutils news: many more meters easier usage and Windows support

1 Share

You probably have noticed by now that I write about glucometers quite a bit, not only reviewing them as an user, but also reverse engineering to figure out their protocols. This all started four years ago when I needed to send my glucometer readings to my doctor and I ended up having to write my own tool.

That tool started almost as a joke, particularly given I wrote it in Python, which at the time I was not an expert in at all (I have since learnt a lot more about it, and at work I got to be more of an expert than I’d ever expected to be). But I always known that it would be for the most part just a proof of concept. Not only exporting CSV is mostly useless, but the most important part in diabetes management software is the analysis and I don’t have any clue how to do analysis.

At first I thought I could reuse some of the implementation to expand Xavier’s OpenGlucose but it turned out that it’s not really easy for those meters that are using serial adapters or other USB devices beside the HID ones that he implemented already. Of course this does mean it would probably work fine for things like the FreeStyle Libre which I appear to have written the only Linux software to download from, but even in that case, things are more complicated.

Indeed, as I have noted here and there previously, we need a better format to export glucometer data, and in particular the data from continuous or mixed meters like the Libre. My current out format for it only includes the raw glucose readings from the meter that are not marked as errors; it does provide an unstructured text comment that tells you whether the reading is coming from the background sensor, an explicit scan or a blood sample, but it does not provide all the level of details of the original readings. And it does not expose ketone readings at all, despite the fact that most of the FreeStyle-line devices support them and I even documented how to get them. But this is a topic for a different post, I think.

On the other hand, over the past four years, the number of meters increased significantly, and I even have a few more that I only have partially reversed and not published yet. Currently there are 9 drivers, covering over a dozen meters (some meters share the same driver, either because they are just rebranded versions or simply because they share the same protocol). One is for the InsuLinx, which also loses a bunch of details, and is based off Xavier’s own reverse engineering — I did that mostly because all the modern FreeStyle devices appear to share the same basic protocol, and so writing new drivers for them is actually fairly trivial.

This would make the project an interesting base if someone feels like writing a proper UI for it. If I ever tried to look into that, I may end up just starting an HTTP server and provide everything over HMTL for the browser to render. After all that’s actually how OpenGlucose is doing things, except there is no server, and the browser is embedded. Alternatively one could just write an HTML report file out, the same way Accu-Chek Mobile does using data URLs and JavaScript bundles.

One of the most important usability changes I have added recently, though, is allowing the user not to specify the device path. When I started writing the tool, I started by looking at serial adapter based devices, which usually come with their own cable, and you just access it. The next driver was for the LBA-over-SCSI used int he OneTouch Verio, which I could have auto-detected but didn’t, and the following ones, mostly based off HID, I just expected to be given an hidraw path.

But all of this is difficult, and indeed I had more than a few people asking me which device are they meant to use, so over the past few months I adapter the drivers to try auto-detecting the devices. For the serial port based meters, the auto-detection targets the original manufacturer’s cable, so if you have a custom one, you should still pass them a path. For HID based devices, you also need the Python hidapi library because I couldn’t bother writing my own HID bus parsing on Linux…

… and the library also brings another important feature: it works on non-Linux operating systems. Indeed I now have not one but two confirmed users that managed to use the tool on Windows, for two separate FreeStyle devices (at the time of writing, the only ones implementing HID-based protocols, although I have another one in the pipeline.

Supposedly, all of this should work fine on macOS (I almost called it OS X), though the one person who contacted me trying to have it working there has been having trouble with it — I think the problem has something to do with the Python version available (I’m targetting Python 3 because I had a very hard time to do the right processing with Python 2.7). So if you want to give it a try feel free.

And yes, I’m very happy to receive pull request, so if you want to implement that HTML output I talked above about, you’re awesome and I’m looking forward to your pull request. I’m afraid I won’t be much help with the visualisation though.

Read the whole story
Flameeyes
3 days ago
reply
Dublin, Ireland
Share this story
Delete

libinput 1.8 switching to git-like helper tool naming "libinput sometool"

1 Share

I just released the first release candidate for libinput 1.8. Aside from the build system switch to meson one of the more visible things is that the helper tools have switched from a "libinput-some-tool" to the "libinput some-tool" approach (note the space). This is similar to what git does so it won't take a lot of adjustment for most developers. The actual tools are now hiding in /usr/libexec/libinput. This gives us a lot more flexibility in writing testing and debugging tools and shipping them to the users without cluttering up the default PATH.

There are two potential breakages here, one is that the two existing tools libinput-debug-events and libinput-list-devices have been renamed too. We currently ship compatibility wrappers for those but expect those wrappers to go away with future releases. The second breakage is of lesser impact: typing "man libinput" used to bring up the man page for the xf86-input-libinput driver. Now it brings up the man page for the libinput tool which then points to the man pages of the various features. That's probably a good thing, it puts the documentation a bit closer to the user. For the driver, you now have to type "man 4 libinput" though.

Read the whole story
Flameeyes
4 days ago
reply
Dublin, Ireland
Share this story
Delete

Free Idea: a QEMU Facedancer fuzzer

1 Share

This post is part of a series of free ideas that I’m posting on my blog in the hope that someone with more time can implement. It’s effectively a very sketched proposal that comes with no design attached, but if you have time you would like to spend learning something new, but no idea what to do, it may be a good fit for you.

You may already be familiar with the Facedancer, the USB fuzzer originally designed and developed by Travis Goodspeed of PoC||GTFO fame. If you’re not, in no so many words, it’s a board (and framework) that allows you to simulate the behaviour of any USB device. It works thanks to a Python framework which supports a few other board and could – theoretically – be expanded to support any device with gadgetfs support (such as the BeagleBone Black I have at home, but I digress).

I have found about this through Micah’s videos, and I have been thinking for a while to spend some time to do the extension to gadgetfs so I can use it to simulate glucometers with their original software — as in particular it should allow me to figure out which value represent what, by changing what is reported to the software and see how it behaves. While I have had no time to do that yet, this is anyway a topic for a different post.

The free idea I want to give instead is to integrate, somehow, the Facedancer framework with QEMU, so that you can run the code behind a Facedancer device as if it was connected to a QEMU guest, without having to use any hardware at all. A “Virtualdancer”, which would not only obviate the need for hardware in the development phase (if the proof of concept of a facedancer were to require an off-site usage) but also would integrate more easily into fuzzing projects such as Bochspwn or TriforceAFL.

In particular, I have interest not only in writing simulated glucometers for debugging purposes (although a testsuite that requires qemu and a simulated device may be a bit overkill), but also in simulating HID devices. You may remember that recently I had to fix my ELECOM trackball, and this is not the first time I have to deal with broken HID descriptor. I have spent some more time looking into the Linux HID subsystem and I’m trying to figure out if I can make some simplifications here and there (again, topic for another time), so having a way to simulate an HID device with strange behaviour and see if my changes fix it or not would be extremely beneficial.

Speaking of HID, and report descriptors in particular, Alex Ionescu (of ReactOS fame) at REcon pointed out that there appear to be very few reported security issues with HID report descriptor parsing, in particular for Windows, which seems strange given how parsing those descriptor is very hard, and in particular there are very seriously broken descriptors out there. This would be another very interesting surface for a QEMU-based dancer software, to run through a number of broken HID report descriptor and send data to see how the system behaves. I would be very surprised if there is no bug in particular on the many small and random drives that apply workarounds such as the one I did for ELECOM.

Anyway, as I said I haven’t even had time to make the (probably minor) modifications to the framework to support BBB (which I already have access to), so you can imagine I’m not going to be working on this any time soon, but if you feel like working on some USB code, why not?

Read the whole story
Flameeyes
5 days ago
reply
Dublin, Ireland
Share this story
Delete

I'm moving to London

1 Share

There is something about me and writing blog posts while sitting in airport lounges around the globe, or at the very least in New York and Paris…

Four years and change after I announced my first move I’m moving again, though this time the jump is significantly shorter, and even the downsizing is downsized, particularly as the plug I’d be using is the same. You could say this is a bold move, particularly with the ghost of Brexit floating above us as a semi-transparent Damocle’s Sword, but it’s a decision I made, not over night, but through many months of deliberation and a good number of arguments back and forth. And I decided this before the hilarious hung parlament results.

So, why am I doing this move, and what does it actually include? I’m staying at the same company, in the same role and in a team not really far away (on a management, if not service, chain) from the one I was at before. What really matters in all of this is the place I live in, rather than the work I’m doing. Work provided an excuse and a spark for me to make the jump, simply because my previous team has been folded into another.

When I flew onto Dublin, for the second time after the interview, four years ago, I knew next to nothing about Ireland, except for the stereotypes and the worrying stories of the Troubles. I effectively knew only one person in the country, and I was fairly scared about the whole process, which went significantly smoother than I would have expected. As a friend of mine told me before I left, Dublin is the capital that still feels like a little town, and I can definitely see that.

I grew up in a relatively small town, with next to no public transport, but a significant amount of malls and stores, and a stupid but functional airport nearby. Dublin beat that significantly, except for the lack of malls, and the fact that unless you have a car to go outside the city centre, it is likely that whatever you need you’ll order on Amazon anyway. Except there is no Amazon Ireland, so you’ll be looking at either Amazon UK, Italy, Germany or (if you can manage) France. Because the prices will be different all over, and some of the Amazon stores will refuse to send things to you in Ireland, and you have to use one of the many services that provide you with an UK address, and then reships the parcel to you (most of which use addresses in Northern Ireland, because it’s close enough, and counts as UK for most of those limitation).

But it also has limitations that a small provincial town has, and I’m not talking about the song from Beauty and the Beast, though it does come close. At least for the native Irish, the stereotypes is that they all know each other. It is not true of course, as it’s a stereotype, but it comes awfully close. In particular, according to a former manager, Irish people make friends in two phases in life: during school and during their kids’ school years. If you happen to get to Ireland when you’re clearly too old to be a student, but single, with no kids (and no intention to have any), making friends is not quite easy.

I have tried, maybe not with just as much energy as others have, but still tried. Unfortunately, almost the full set of social gatherings in Ireland involve pubs. I don’t drink alcohol, alcohol could kill me, and definitely makes me mean. But I could go to a pub and not drink of course. I did that in Italy, where the pub favourite by my group of friends offered as many pages of menu to coffee, chocolate, the and infusions drinks as of beers, plus a good selection of other desserts. That is not the case in Ireland. Effectively, the only non-alcoholic drinks you find at the pub are there to not live thirsty the designated drivers, and they are bloody expensive. €5 for a 150ml bottle of Diet Coke! — I’m told that Coca Cola by the pint is cheaper, unfortunately because of diabetes that would be almost as bad as alcohol. I know at least one pub in which I can order a pot of tea, and not get the stink eye by the waiters, but that’s about it.

For the first couple of years I didn’t really feel this being a big problem: for the first few months, Enrico (from #gentoo-it) was around as well, before moving on with his life in a different country, I made a number of friends at the office, and a few people who I knew before, such as Stefano from automake, came to Dublin. Then something happened, that made me question the idea of mixing colleagues and friends. Nothing Earth-shattering, but enough of a demonstration for me that I started isolating myself from most of the people at the office: rejected invitations for social events, mass de-friended people from Facebook, and so on. You may think this sounds a bit extreme, but I have my reasons.

I turned again to trying to find interesting groups of people in Ireland, and that’s where the introvert and awkward part of me just gave up and filled me with dread: I’m not particularly good with meeting people already, but it just felt too much work to join an established group of people who all know each other without even having one person you know to introduce you. I had better luck on that with meeting people at Eastercon and Nine Worlds, thanks to Gianni. And all the groups I could find in Dublin that didn’t have to do with “going out for pints”, were effectively groups of people who have known each other for years. They may be friendly but not easy to make friends, at least not for me.

Of course there is a group of people that I knew already, and I considered: the people who left the office! Unfortunately, almost the full amount of people who I knew that stayed in Ireland did so because they have a family there. They are in a different “time of life” than me, and that makes for an awkward time — most wouldn’t be interested in meeting to go to a geek store on the weekend, or a Comicon or similar venue. You can go and see them at home (depending on how friendly the terms you’re in are), and see the kids. Heh, no thanks.

So after four years, a lot of the people I knew and was/am friend with leaving Ireland for other countries, offices or jobs, I found myself lonely, and with a need to move somewhere else. And just to be clear, loneliness is not just about being single. That is obviously a part of it, but it’s in general the inability to say to any group of friends “Let’s meet tonight for movies, boardgames or a match of Street Fighter” (or whatever beat ‘em up the cool kids play nowadays). I could do that in Italy, I even still managed to do that in Italy last time I flew in, with some of my best friends now living together and expecting a baby. But I can’t do that in Dublin because there are very few people with who this proposition is not totally awkward.

Heck, I can do that in Paris! I have friends in France who I just had to say “There is this concert at this date, want to go?” and six months later I’m flying a DUB-CDG/CDG-YUL/YUL-DUB ticket to see Joe Hisaishi at Le Palais des Congrés. (Montréal is for a conference, it was the week after so it was easy to just go from one to the other without passing by Dublin.)

But most of this awkwardness is on me, so why do I expect things to be any different in London? Well, to begin with I know more people there (outside of work) than I did in Dublin, or that I even do now. A friend of mine from junior high moved to London last year with her boyfriend, so at the last I know them, and we’re close enough that the similar proposition of spending an evening in playing Scrabble is totally feasible (actually, we did just that when I went to see them last year). And these are people who can make the general awkwardness of entering a new group of people easier for me.

Most importantly, though, I think London has a different structure that should make it possible for me to end up meeting people even randomly. Because though I am clearly awkward and scared of joining big groups that already know each other, I don’t mind the random words with a stranger in the queue for a flight or while waiting for coffee. After all that’s give or take how I end up meeting people at conferences. In London there are just too many people for them to all know each other. And in particular, there are the places where these things can happen.

Part of the reason why almost all the social gatherings in Dublin revolve around pubs is that they are the only venue you can go to spend some time on “neutral grounds” (i.e. not in someone’s home, not at an office). I don’t know of a coffee shop in Dublin that is open after 1900 on a weekday, except for the Starbucks in front of St Stephen Green and a few Insomnias that are embedded within 24hrs convenience stores. London has plenty, although they are not all in the most convenient of places, if anything you can find a Nero open until 2200 almost every other corner. No, Nero does not stay open that much in Dublin either.

There is more. If you’re a geek you probably have at least heard of Forbidden Planet. It’s a megastore of comics, manga, books, and anything geek effectively. It’s very commercial and mainstream, but it’s also big and they run book signings there, which makes it an interesting place to go just to see if something may be going on. It’s effectively in the centre of life if London, effectively in SoHo, and if you meet there with friends you can geek out with friends on their latest purchases in one of the many cafes around the area. Or browse, buy something and go to dinner.

There is a Forbidden Planet in Dublin which is not as big but it still has a decent selection. Unfortunately all the venues around it are effectively pubs, as you’re on the verge of Temple Bar, which appears to be the Irish national treasure. Unless you manage to get out well before 5pm and get coffee to the shop just behind it, which of course closes at 5pm all week long. And even to be fair and consider Sub City comics which in my opinion is usually better stocked, it’s all pubs around it except for Bewley’s and Krüst down the street in front of it… which requires you to cross one of the most trafficked streets in Dublin city centre.

I’m not saying that there is an absolute certainty that I will meet people in London, I’m just saying that there are a few things that are not stacked against me, like they are in Dublin. And I really need to make some change that I don’t feel full of dread every time I come back to my apartment after weeks travelling, like I did coming back from my recent trip across Asia, when all of the four people I hang out with at all were not in town.

Nothing else really changes even, but you may notice that the targets of my rants will change from Ireland to UK, and possibly to the process of actually moving, filing taxes and so on. Actually, I know you’ll get at least another post on payment cards because I started looking into them and it looks like the foreign transaction fees in the UK are really bad.

Read the whole story
Flameeyes
6 days ago
reply
Dublin, Ireland
Share this story
Delete

IPv6 Unwanted Child?

1 Share

IPv6 – Unwanted Child?



Near the end of the old year, a juicy discussion broke out in the “main” IETF mailing list. Although it was ignited by a bizarre proposal of IP version 10, in reality it reflects a general frustration caused by the sluggish pace of IPv6 deployment.

Tags:

via Pocket <a href="http://en.blog.nic.cz/2017/01/17/ipv6-unwanted-child/" rel="nofollow">http://en.blog.nic.cz/2017/01/17/ipv6-unwanted-child/</a>

January 17, 2017 at 07:27PM

Read the whole story
Flameeyes
6 days ago
reply
Dublin, Ireland
Share this story
Delete

Glucometer Review: Contour Next One

1 Share

In my current quest for documenting glucometer protocols and implementing tooling to download data I ended up ordering myself a Contour Next One glucometer, currently marketed by Ascensia Diabetes Care, but originally developed by Bayer (to the point that devices and manuals still mostly refer to Bayer).

The Contour Next One is marketed as a smart glucometer that can connect to an app on a smartphone, as it supports Bluetooth Low Energy. I have not tried that yet because I already have an app I care about on the phone. In addition to that the physical device is very small, but includes a nice, complete and bright display, a three way buttons, a coloured LED for the strip port device, and a beeper.

The size of the device reminds me closely the OneTouch Ultra Mini, which is quite favourable, as every other device I have is significantly bulkier, and for the most part using a different form factor that I don’t particularly enjoy.

The strip port has a coloured LED as I said, and it’ll be white to tell you where to insert the strip, and then turn either green or red depending on the value. You can associate one out of three states for meal information, represented by an apple (why is it always an apple?) crossed out (fasting), full (before meal) or taken two bites of (after meal).

If there is one thing that I can complain about is that the first-time setup is a bit tricky. I have received the meter a couple of months ago, but since I’ve been travelling so much, I have not managed to try it out until earlier this month. When I finally put the strip into the device, and provided blood to it, I found it wanted to confirm date, time and settings… and did not actually give me a result, oops!

On the practicality, the device is really the kind of size I’d like to keep around, if it wasn’t for the fact I switched to the Libre. While it is not all-in-one like the Accu-Chek Mobile, it is small and compact, and looks sleek for a device.

I have installed the Irish app – it seems they have separate app entries for multiple countries, although it does not appear to have country limitations, as I could ask for it to be installed on my Italian SIM device – the first thing it asked me was the country or region, and Ireland was not in the visible list. Turns out the problem is that the list is actually very long and the app’s scrolling is misconfigured, as scrolling up appears to only scroll a third of a row at a time, so scrolling down to Ireland takes quite a while. For United Kingdom I don’t even want to consider the idea. Looks like Ascensia does have some rough edges with testing the first-time setup of their systems.

The setup process is a bit bothersome, if what you want to do is just downloading the data. It tries to convince you to set up an account to back up your data (this appears to be more and more common), and then it goes through give or take the same first-time setup as happens on the meter. In addition to the meter’s own settings, it also allows you to define time bands to divide your meals into breakfast, lunch and dinner, which I liked: instead of just assuming, it asks you to confirm the expected ranges.

There is also a request to configure two phone numbers: the local emergency number, and a personal emergency contact, so that if you have a low-blood-sugar event you can make a call directly. While the idea is interesting on principle, since it already asked me for my region I wonder why it can’t just default to 999. Finding the contact by name in the list is also extremely hard because of the scrolling issue above. I ended up just typing my own name and phone number, as there is never anyone who could actually help me if I have a sugar low, and the request is unskippable.

The app itself appears very simple, showing by default your last reading and a small graph of your recent readings. If you turn your phone or click on the graph, a more detailed (but still rough) graph appears:

The probably most interesting thing about this the app is that if you take a reading on your meter it will be “pushed” to the device, and appear in real-time. It also allows you to set the markings and a number of comments straight from the app, well exceeding the amount of details that the device can set for you, particularly given it’s a three-buttons device.

It reminds me of the iHealth Align but in a much less clumsy way. It also requires significantly less bother with the strips, and there is no validation of when the bottle was open or whether the strips expired, which makes it probably a better choice for those people who only test occasionally.

On more technical sides, the device uses two CR2032 batteries, which while beefier than the iHealth, need to sustain a full BLE connection – which by the way I couldn’t figure out how to turn off at first try – and are at the same time easier to find replacements for (though not as easy as the AAA batteries used by more clunky meters). It has a micro USB connector on the back, behind a rubber seal, and it uses an HID-based protocol to communicate. I’m halfway through reversing and documenting it of course.

Read the whole story
Flameeyes
9 days ago
reply
Dublin, Ireland
Share this story
Delete
Next Page of Stories