iPhone killed the removable battery  –  How to make a charger for cell phone batteries

Last weekend I finally got around to doing something I have postponed for several years now.

Being somewhat of a gadget hoarder, I have ended up with quite a large stack of rechargeable batteries. Everything from 12 Volt lead-acid ones from old UPS:s to Lithium-ion variants from mobile phones.

The last kind are actually pretty interesting. They pack a significant punch when it comes to energy storage, the problem is that they are designed to go into cell phones (at least pre iPhone ones where you could remove the battery!), and there are thus no separate charging docks or battery holders.

Still, it would be sweet if they could be used to power electronics gadgets that I build myself…
It is of course possible, and even quite easy to do – here is the very first prototype in action:

Charger in action with Samsung B600BE battery

Continue reading “iPhone killed the removable battery  –  How to make a charger for cell phone batteries”

Let there be (blinky) light!

I was recently in Helsinki, giving a talk at a QlikDevGroup event. Great event, great crowd. The topic was SenseOps and Butler SOS, and I showcased the lamp above as an example of a funky, but still relevant way to monitor user activity in a Qlik Sense Enterprise environment.

A person in the audience asked how the map works. I claimed it was super simple, costing less than USD 10 to build (assuming you already have a suitable enclosure) and uses just four wires hooked up between some pre-made modules. Time to prove it.

The four wires part might have been a slight exaggeration… but it depends on which wires you count – right?

Continue reading “Let there be (blinky) light!”

ESP8266 Over The Air updating – what are the options?

1950's TV link dish - a bit overkill for ESP8266, maybe..Over the air convenience

A real pain point when developing sensor nodes that are scattered around a building (or a country or the world!) is the updating part. How do you get new firmware onto the devices?

The cell phone manufacturers were early to investigate the options, but from my days in that industry I know first-hand how challenging it was to send new firmware to tens or hundreds of thousands of devices. Lot’s have happened since, today a system update for tens of millions of Android or IOS devices is no big deal, you just make sure your phone is plugged into power before starting the upgrade. Leave it overnight, and next morning you have the latest (and hopefully greatest) version installed.

Looking specifically at the ESP8266, it does have drawbacks in terms of power consumption (it’s hard to get the power consumption down for a device that needs 3-4 seconds to wake up from sleep, connecting to a wifi network and send its sensor readings – but improvements are possible). On the other hand, its wifi connectivity means Over The Air (OTA) updating is possible.

Having a bunch of ESP8266’s lying around, I looked into the options for doing OTA on ESP8266.

Continue reading “ESP8266 Over The Air updating – what are the options?”

Microscope software for OSX

andonstar USB microscopeGot myself an Andonstar 2 megapixel USB microscope about a year ago, mainly just for testing it out, and having it readily available when some repair project demanded it. The microscope is actually pretty nice given its ca USD 60 price point, with decent picture quality, a sturdy stand (even though it’s somewhat of a pain adjusting it) and a built-in adjustable light source.

To be honest it hasn’t been used much (it did come in handy during the repair of the BK Precision LCR meter though).. but this is in part due to the lack of good OS X software for use with generic USB microscopes. Over the past year I have tried some video software, and still have a few on the try-these-out-list.

Continue reading “Microscope software for OSX”

FLIR TG165 unboxing

Got myself a new toy a while ago – A FLIR TG165 infrared camera.

These devices used to cost thousands of Euros/Dollars, but during the past year the have come down in price a lot. I got mine from SOS electronic, think had a campaign on it back when I got it. This a rather low-end unit that does only have an IR sensor – no regular camera as the more expensive models have. That combination is actually very nice – it becomes really easy to understand where on the object under inspection the hotspots are.

The TG165 isn’t too bad though – it has a couple of lasers that create a bounding rectangle, indicating what part of the object is shown on the meter’s display. In practise this works great, so no problem there.

Continue reading “FLIR TG165 unboxing”

Fixing a broken BK Precision 879b LCR meter

Broken BK879B
Broken BK879B

Some time ago I got what I thought was a score on Ebay – a really nice LCR meter at a very good price. Ok, it was broken, but the error message indicated it was just the fuse that was gone.  Looked like on the right.

According to BK’s help site, this error could be caused by a busted fuse. It’s an SMD fuse, but not too hard to replace. Unfortunately that didn’t solve the problem… the meter was still dead after fuse replacement.

So, enter a new toy I got recently: A FLIR TG165 IR camera. Did an unboxing of it recently, it’s a very nice piece of gear. Got it from SOS Electronic, it cost a fair bit of money, but still nothing compared to what FLIR cameras cost just a few years ago.

Continue reading “Fixing a broken BK Precision 879b LCR meter”

Fixing bash Shellshock vulnerability on Raspberry Pi

The recent bash vulnerability, a.k.a. “Shellshock”, is pretty bad, considering it might actually have been around for a very long time, maybe even dating back to the predecessor of bash. Not good.

So what about Raspberry Pi’s?
Are they vulnerable?

Turns out they are, but there is already a fix available for them and patching a Raspi is very simple. Whether your actual Raspi is vulnerable depends on what distribution you are using, and how recently you upgraded the software in it.
The Raspi used below is running IPE-R1, which is a blackout-proof version of Raspian.

First let’s find out what bash version we have:

root@raspi-2:~# dpkg -s bash | grep Version
Version: 4.2+dfsg-0.1
root@raspi-2:~#

You can also run this little script to determine whether your Raspi is vulnerable to Shellshock

root@raspi-2:~# env x='() { :;}; echo "WARNING: SHELLSHOCK DETECTED"' bash --norc -c ':' 2>/dev/null;
WARNING: SHELLSHOCK DETECTED
root@raspi-2:~#

Let’s fix this. Just refresh the repos and upgrade bash (the patched version is available in the main repos).

root@raspi-2:~# apt-get update && apt-get install --only-upgrade bash
Get:1 http://archive.raspberrypi.org wheezy Release.gpg [490 B]
Get:2 http://mirrordirector.raspbian.org wheezy Release.gpg [490 B]
Get:3 http://archive.raspberrypi.org wheezy Release [10.2 kB]
...
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
 bash-doc
The following packages will be upgraded:
 bash
1 upgraded, 0 newly installed, 0 to remove and 54 not upgraded.
Need to get 1,443 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main bash armhf 4.2+dfsg-0.1+deb7u3 [1,443 kB]
Fetched 1,443 kB in 1s (1,386 kB/s)
(Reading database ... 29754 files and directories currently installed.)
Preparing to replace bash 4.2+dfsg-0.1 (using .../bash_4.2+dfsg-0.1+deb7u3_armhf.deb) ...
Unpacking replacement bash ...
Processing triggers for man-db ...
Setting up bash (4.2+dfsg-0.1+deb7u3) ...
update-alternatives: using /usr/share/man/man7/bash-builtins.7.gz to provide /usr/share/man/man7/builtins.7.gz (builtins.7.gz) in auto mode
root@raspi1:~#

The installed version of bash is now +deb7u3

root@raspi-2:~# dpkg -s bash | grep Version
Version: 4.2+dfsg-0.1+deb7u3
root@raspi-2:~#

The short test script above also returns nothing:

root@raspi-2:~# env x='() { :;}; echo "WARNING: SHELLSHOCK DETECTED"' bash --norc -c ':' 2>/dev/null;
root@raspi-2:~#

You could of course also just do an “apt-get upgrade” to upgrade all packages on your Raspi, would take a bit longer but will work just as well.
Also, if you are not logged in as root you need to do a “sudo apt-get update”, of course.