Deploying 5 GHz NanoStations as ‘end-user access points’ always gave some ‘hiccups’ with various Apple MacBooks. Usually they could see the signal, but were never able to connect to it. Finally with these settings they hooked up:

Disable airMAX

Set Country code to US

Channel width 20 MHz

Frequency 5785 MHz

Wifi security WPA2-AES

I simply assume that not all of these settings are required, but I’m simply too lazy to see which ones are required and which ones are optional.

I still had some old VMware Fusion 6.0.6 virtual machines laying around on my Mac OS X 10.9.5. As I was recently using more advanced Virtual Box features, I decided to unify all virtual machine instances with Virtual Box. Turned out this is straight forward, if only you know what you do!

First of all delete unneeded snapshots as they couldn’t be migrated anyways.

With my recentwork (aka pet project) on embedded systems mainly based on Arduino I finally came across an Arduino board with built-in GSM/GPRS connectivity. Getting an Arduino with an GSM/GPRS shield is pretty straight forward, but if the device is meant to be strong and durable, these shields don’t feel good.

However. The Gboard is “Arduino-compatible” and as such I was expecting a few hiccups to get it up and running. And as usual a few turns quickly into a lot. So let’s have a look.

Jumpers

Like most communication boards the GSM chips is connected through a serial port. But the Gboard just like the Arduino Uno only has one. And this one is also used for programming purpose. In order to use both programming and GSM connection, make sure jumpers are set to ST-D2 and SR-D3 (‘Software UART to SIM900, Hardware UART to Specific’).

Programming connection

Just like the Arduino Ethernet board (and others) the Gboard doesn’t have its own USB connection. So a ‘FTDI-style basic USB-to-serial board’ is required. But unfortunately the ones from Adafruit or Sparkfun don’t work out of the box. First you need to be careful as the boards from Arduino itself require 5 Volts. But the FTDI connection on the Gboard only takes 3.3 Volts. Don’t mix this up! Additionally the wires aren’t compatible. It seems best to spend the few additional dollars to get the dedicated FOCA board from Itead. But of course this removes the fun of tinkering and I wanted to reuse my existing programming board. Connecting GND, DTR, TX, and RX with dedicated wires does the trick (I had to swap the TX and RX connections). In order to power up the board either a 3.3V connection is required, or simply remove the VCC connection at all and power the Gboard through an external power supply.

External power source

If you need to test the GSM features, make sure you have an external power source connected. Just because the lights go on with a FTDI connection doesn’t make the GSM chip work.

Digital ports

The connections of the Gboard differ quite a bit from the default Arduino layout. In particular the board doesn’t list any digital ports; just connections labeled with A0 to A7. But in the Arduino world the first 6 analog ports can be used as digital ones as well. Address them by starting from digital pin 14 for A0. The interface on the Arduino is called ‘Electronic brick interface’ and it seems to be used in other boards as well. So there are pre-made 3 pin connections with sensors available. But as long as you connect +, -, and Signal in the proper way, most other sensors will work too.

Arduino IDE

I assume other options might work as well, but for me the board ‘Arduino Pro or Pro Mini (5V, 16 MHz) w/ ATmega328′ and Programmer ‘Arduino as ISP’ did the trick. Sometimes an upload to the board fails, but most often a single repeat will be successful.

If it still doesn’t work, consider this trick by pressing the Arduino RST button at the right point in time.

GSM/GPRS features

Finally there is a dedicated lib to ease the use of the GSM chip. I assume sending AT command straight to the soft serial port will work as well, but I haven’t tried it. But even though the lib claims it is compatible with the Arduino 1.x IDE, it didn’t work in my environment. I had to do a couple of tweaks to the lib (but I don’t remember every single step). Steps like removing newsoftserial from lib folder and adding ‘#include ‘ in GSM_Shield.cpp.

Driver hiccups

Sometimes, especially under Windows it seems as if the wrong drivers are taken for the FTDI communication. Check here to see get an idea of the correct ones. Note that installing the correct driver might fail as a wrong one is somehow blocking it. Follow FTDIs uninstall instructions and try re-installing the driver again.

WordPress is convenient when setting up a little web site / blog. You might even think about self-hosting instead of using the services from wordpress.com.

Doing so is easy, but also eats up resources on your system and even worse, opens the door of security holes. You need to think about a lot of things like file permissions, database access, web server config, the PHP subsystem. And of course WordPress itself. So you need to update often. Over and over again.

If you are like me, then you don’t. But always feel bad and that you should do something about it.

If you depend on many WordPress plugins, then move on. This isn’t for you. But if not, then why not setting up a local installation and simply fetch the static HTML pages generated by WordPress and deploy them on a brain-dead simple static HTTP server?

Of course with this you remove all the dynamics of your system. I think comments could easily moved to an external service like disqus.com. And as I don’t really like all these fancy widget changing content automatically all over, I see this purification as another advantage.

To jump-start your local installation, the wonders of virtualization came in handy for me. Among others TurnKey Linux provided a recent version of WordPress running on a stripped down Linux. Deploying this to a virtual machine of your choice, migrating your old data from the live WordPress over to the Turnkey installation is all you need.

Afterwards you can work completely locally on your WordPress content and setup. Then simply invoke a script similar to the one below to automatize the update of your production system. And voila, you have a static mirror of your WordPress content for free.

As a nice benefit you already get a local backup of your content in your virtual machine.

For Abwenzi Pa Za Umoyo (APZU), Partners In Health’ sister organization in Malawi, technology is playing its role in delivering health services and improving communities. IT services like access to computers and especially communication gets more important. Even (or especially) in rural places like the south-eastern District of Neno.

As one basic principle everybody gets access to the network – either government, APZU employees and to some extend private people. Of course this has the downside of potentially hurting commercial Internet cafes as many people throughout Neno Boma get Internet access for free. But a (relatively) fast and working Internet has a number of impacts on the work. Medical research, easy communication, and heck, sometimes it simply entertains…

Over the past few years the communication needs were growing rapidly. We have tried multiple approaches for the local network and the Internet connectivity and went through a couple of design generations. Usually just to realize that the reality was outgrowing our solution.

With the current network in Neno we are probably running the biggest public WiFi hotspot in Malawi. With a coverage of a half square mile and up to 120 unique systems utilizing the network on average.

Currently the system combines a couple of freely available software components together with carefully selected, inexpensive commodity hardware and 1.5 local engineers to keep everything up and running. As we have gained quite a bit of experience we feel that the current system will scale-up even beyond our expectations for the next 2 or 3 years. But TIA, you never know what’s coming next.

Putting down all the details is a little bit too much for this post, so I only provide stuff for the buzzword bingo. Get in touch if you want to learn more about it:

Traffic accounting

User management

Local caching (among others esp. for Windows Updates)

Segmented network

Content filtering

Real-time monitoring

Bandwidth management

Of course such a system still costs money, but it seems well worth the price if the system is designed carefully. And as most of the components are free and the hardware costs are minimal, it basically comes down to the costs for the sat link (granted still fricking expensive in rural Africa) and your expertise.

Even in our digital world you might want to convert your wordpress blog into a paper book. Of course there are servicesavailableclaimingto do so. But the ones I found didn’t match my specific requirements of

Minor content tweaks

Custom formatting

Inline comments

High resolution pictures for offline processing

Picture captions and mouse-over labels

DIY attitude

So after a lot of trial & error, I found out that I can

export the wordpress content as XML,

create a single page HTML file with all content locally,

automatically tweak some styles,

import the HTML into Word,

re-format as needed,

save as PDF and optionally create an eBook version.

If you want to follow my steps, you need these tools (highly ‚personalized’ and quite a bit developer-driven – it might not be the right process for you).

Create a single page HTML file with all content locally
Run the attached Ruby script to convert the WXR file into a single page HTML document. This is where most of the magic happens and also the most fragile part. The script is aligned to the elements I typically on my blogs and it might differ from others. But with a little bit f Ruby knowledge it shouldn’t be too hard to tune this. Basically it takes the XML file, filters for the posted and published stories, tags the various elements with different HTML classes and has some processing around images to include captions and mouse-over titles. It returns the HTML on the console, so best is to invoke it like this: wordpress_to_single_html.rb ‘your wordpress export’ > single_html.html

Now the pictures are still on the wordpress server. Use Firefox to open the HTML and save it again with the option ‘website complete’ to have everything on your system (incl. pictures) for faster offline access.

Finally open the newly saved HTML file in a text editor and search&replace all relative img URLs with absolute paths (e.g. substitute ‘myblog_files/ with file:///c/myblog_files/. This is sadly required for the Word import.

import the HTML into Word & reformat styles
After opening/importing the HTML in Microsoft Word you can modify styles and ‚pimp’ the content as you want. Check for styles beginning with an _ created by the Ruby script to mark different elements of the blog (content, headings, comments, post_date, …). Save as docx for future needs (and always keep the images folder with the docx).

save as PDF and optionally create an eBook version.
Most print on demand services take a PDF, so simply save your document as a PDF. If you want to create an eBook version as well it you enter the ‚format hell’ for eBook content. Calibre seems to understand most formats and can also load the HTML export from Word to e.g. create a version in the epub format. (More general info about ebooks.)

That’s all. Isn’t it simple?

Note about Apple Pages: Using Apple Pages seems the more obivous choice for text processing on a Mac. However the recent Pages versions removed the HTML import. So there wasn’t an easy way to get the wordpress content nicely formatted into Pages. Two workarounds are available: One ist to simply copy&paste content from the safari and the other is to use TextEdit (which still has a HTML import) to create a RTFD (RTF including attachents) and then load it into Apges. Unfortunately all pictures are scaled up tot he full page and this makes it painful if you have plenty of pictures embedded.

Note about Microsoft Word for Mac: It turned out that my mac version had multiple hiccups with a few hundred pages of text and plenty of included pictures. Switching to Windows made it less stressful for me.

Note about Microsoft Word: Seems plain wrong to me that recent versions of Word have problems with images you want to link in. My impression is that if you include a picture via a link to an external file, Word creates an absolute file path reference to this. Of course this makes it impossible to move the document and files around – even on your own local system. And when trying to embed to files right into the docx (which of course can seriously bloat the file size up), at least form e many pictures changed the scaling. Some oft hem were even uglily transformed.

Lots has been written about it. There is even an official guideline provided by Google. Many different ways to use it, but fact is that the default config is bloody useless. Partially because IMAP only knows hierarchical folders and gmail has labels, partially because IMAP has a few underspecified parts.

If you are on a mobile devices, use ActiveSync/Exchange connectivity. [Reason: increase your lifetime by reducing blood pressure]

Modify Labels in gmail via Settings. Deactivate ‘Show in IMAP’ at least for ‘All mail’, maybe also for ‘Starred’, ‘Important’, ‘Chat’ [Reason: Mails can be tagged with multiple labels and therefore show up in every folder derived from the labels. Hence a message tagged with more than one label will be duplicated in these folders.]

For custom labels use ‘[Gmail]/ as a prefix [Reason: This way they will show up underneath the Default folder path [Gmail] in your mail client.]

Consider deactivating ‘store draft messages on server’ [Reason: depending on your network this can slow down and eat up bandwidth together. Additionally it might happen that mails currently drafted and saved multiple times will show up as deleted mails whenever the auto save on the client happens.

Store sent messages on the server, Store junk messages on the server, and Move deleted messages to the Trash mailbox [Reason: keep these folders in sync with your gmail UI or other mail clients.]

Store deleted messages on the server and never permanently erase deleted messaged [Reason: Use the trash just like in gmail. But remember that gmail automatically deletes your trash after 30 days. So don't use your trash folder as your hidden archive!]

Consider using the IMAP Path prefix of [Gmail] as all the folders/labels are mapped under the folder [Gmail] in IMAP.

Tell your mail client which folders are used for Sent messages, Trash, Spam, Drafts. In Apple Mail right click in the corresponding Gmail folders and say: ‘Use this mailbox for …’ [Reason: IMAP knows about folders, but doesn't standardize these special folders (apart from the Inbox). So one client might use 'Deleted messages, while another client might use 'Trash' to store deleted messages. This tells the mail client that it should use the same folder gmail uses.]

And now: Go and test it! Test it multiple times, in and out of every direction you can think of. Only use the setup if you are confident you didn’t mess it up!

If your local mail client shows weird behavior after all these configs, invoke a Rebuild or Reconcile or however it is called from your client to re-sync mails with Gmail.

I just need to rant that (again) I run into a problem with unexpected side-effects of the usually neat feature of implicit return values in Ruby. This (although not really obvious) feature always returns the value of the last executed statement in a method as a return value. But this isn’t always as obvious as it sounds. This can cause strange side-effects.

As an example take the Rails callbacks for ActiveRecord. These callbacks like :before_create are typically used to handle data validation. Thus if they return ‘false’, the process to save the record is canceled.

But now instead of validation you want to ensure that certain other attributes are automatically set depending on other attributes; maybe even boolean attributes like in this block:

Here we simply want to set the boolean attribute enabled? depending on the value of the enabled attribute of the associated probe. Obviously the probe.enabled? can either return true or false. Unfortunately in case of false the whole statement ‘ self.probe_enabled = self.probe.enabled?’ returns false. And if this is the last statement being executed, the whole method will return false. And a false in such a callback will cancel the creation of the object…

Lots has been written about EMRs. Most of it for the ‘developed world’ and most of it indicates that there are some ‘issues‘ in making it work. Now how can someone think this can possibly work in resource-poor settings? Settings that constantly attract classifications like under-staffed, under-trained, under-paid, under-motivated, under-equipped?

Well, among a few others Partners In Health tries. In my role as the Medical Informatics Manager for APZU in Malawi we took the open source medical record system OpenMRS and were looking for ways to adapt it. Finally we could scale up and keep the system running. Even with the ongoing decentralization of clinical services when we went from 0 to 12 distributed, remote clinics and from 0 to thousands of patient records. At that time we might have had the only working EMR capturing the population of a whole District and being compliant to the guidelines for HIV services defined by the Ministry of Health in Malawi.

First lesson: Go local

If you look for an EMR for high-volume clinics in Malawi, get in touch with Baobab Health. They have the most complete set of tools for the health care sector in Malawi and were a constant source of inspiration.

Second lesson: Go OpenMRS

If you still find gaps and the need for other tools, or you aren’t in Malawi, check out OpenMRS. But be aware and don’t see it as a ready-to-be-used system. Health care systems can be different, so are users and particular workflows. Therefore a one-size-fits-all system might fail. OpenMRS tries to address this by providing a framework for building your own EMR. But a framework doesn’t necessarily address your problems, your workflows, or your user skills off the shelf. Be prepared to adapt it. Just like for the ‘western world’, efficient, easy-to-use, simple, error-avoiding interfaces are the key, they are for resource-constraint environments. Maybe even more so.

Third lesson: Know your users (and your ‘stakeholders’)

To make it short: The current UI of OpenMRS 1.x … sucks. A big part of data entry is … well … data entry. So make this easy and fool-proof. Otherwise you have a perfect example of GIGO.

Say ‘no’. Double question requirements from ‘stakeholders’ (whoever they might be) as they often have a vision beyond the scope and possibilities of your environment.

Simplify the UI: Simple things can already help. Try to bring the number of user interactions close to the number of words you need to describe an action. If you need 25 mouse-clicks for an activity like ‘transfer this patient to another clinic’ in the system, then go back to point #1.

Well known and often referred too. But almost as many times (cluelessly) ignored. Throw away stuff were you (or someone else!) feel that it might be interesting after X years (with X anything greater than 1) to look at Y. Yes, famous question of ‘numbers of goats living in a household’: YAGNI!

Fifth lesson: Setting up a system initially is hard, but keep it running is even harder.

This does not only apply to an EMR, but already to a clinic itself. Often little things can decide about winning or loosing. And in almost all cases it is not about the big upfront design of the form, but how you ensure that is going to be used over time. And if it is not used, then it is useless. Especially in environments where there is so much of ‘nothing’. Don’t waste time and energy. There are too many variations of ‘no plain paper available’, ‘no batteries for weight scale’, ‘no drugs for a certain disease’ to address all of them upfront. If you design it, be part of it the first 6 months. If you can’t or don’t want to, don’t design it!

All of this is based on a couple of years of experience living and working in rural Malawi. It might be totally different for other, yet similar places. But always take it ‘one day at a time’.