Category: Software

  • BitCoin hits CHF 100 mark

    Yesterday one BitCoin was, for the first time, worth more than CHF 100!

    When I first learned about BitCoin in early 2011, CPU mining was still enabled in the default client. I mined for a few days, but it was probably already too late for the CPU. GPU’s took over before that. Last year, you needed FPGA’s to profitably mine, and now it’s shifting over to fully custom ASIC’s. I still sometimes mine with the GPU in the background while the Computer is running anyway, and I don’t use the GPU for anything else. It didn’t find a block so far. But for me that’s kind of like playing the lottery. The chances are slim, but if my computer could find the proper hash, that would cash in 25 BTC at the moment which would equate to CHF 2’500. And that slim chance starts over roughly every ten minutes.

    There is a site somewhere on the net (I forgot the location) where you get free BTC. Back in those days, you got 0.05 BTC. That’s how I started off. This would now equate to CHF 5, but these days you get much less.

    Since July 2011, I accept BitCoins as payment for the paraeasy.ch paragliding tandem flights. In fact only one guy payed that way so far. In October 2011 the flight cost 75 BTC at a rate of less than CHF 3 per BTC. If I still had those 75 BTC, they would be worth a whopping CHF 7’500 today.

    I was thrilled last August, when it had an 80% increase within two weeks. But what happened this year was just insane. The price went from CHF 11 to CHF 110 in just three months. There were weeks with 10 to 15% increase every day.

    The other day I walked past a local bank, and saw an advertisement for a defensive savings plan with an 8 year obligation where you get 1% profit. Of course it’s an unfair comparison. Noone knows what will happen next to the BTC value. It could drop any day for any number of reasons, or it could keep rising. I wouldn’t invest my savings so far.

    There is a lot of speculation going on about the future value of BTC, and how certain events could influence that. Last week I read an interesting article about that. But there is also a lot of speculation about a bubble about to burst. Indeed the recent rise in value was so unnaturally fast, that it looks like a bubble. But such a bubble already bursted in 2011, and BTC recovered remarkably well.

    Let’s not concentrate on the value itself. I think for BTC it would actually be better if the value was a bit more stable. The system was designed as a means to transfer money quick and easy. The main motivator was being able to transfer funds around the globe without waiting for a couple of days to arrive, and paying ridiculous transfer fees, as with current bank wire transfers, credit cards or paypal. That’s where BTC really shines. Of course it’s nice to see the value of your Coins rise, but I hope a possible bubble will not harm the system too much, and I strongly hope if that bubble should really burst, BTC will recover even stronger.

    Update : additional links to good articles:

    The bitcoin bubble and the future of currency

    Are BitCoins the future?

    The target value of BitCoin

    BitCoin in the 3rd world

  • Adding a display to rfid time tracking

    More than a year ago, I blogged here about using RFID to track presence times in the BORM ERP system. I used the system a lot since then. But the BlinkM was really limited as the only immediate feedback channel. To use it with multiple users, a display was needed. The default Arduino compatible displays seemed a bit overpriced, and the Nokia phone that I disassembled didn’t have the same display as I used for the spectrum analyzer. But these displays are available for a bargain from china. The only problem was that the bifferboard didn’t have enough GPIO pins available to drive the “SPI plus extras” interface. But i2c was already configured for the BlinkM.

    So, the most obvious solution was to use an AtMega8 as an intermediary. I defined a simple protocol and implemented it as i2c and uart on the AVR. I also wrote a small python class to interface it from the client side. As I buffer only one complete command, I had to add some delays in the python script to make sure the AVR can complete the command before the next one arrives. Apart from that, it all worked well when testing on an Alix or RaspberryPi. But i2c communication refused to work entirely when testing with the bifferboard. Not even i2cdetect could locate the device. That was bad, since I wanted to use it with the Bifferboard, and the other two were only for testing during the development. I checked with the oscilloscope, and found out that the i2c clock on the bifferboard runs with only 33kHz while the other two run at the standard 100kHz. So I tried to adjust the i2c clock settings on the AVR, as well as different options with the external oscillators and clock settings, but I was still still out of luck. Then I replaced the AtMega8 with an AtMega168 and it immediately worked. Next, I tried another AtMega8 and this one also worked with the Bifferboard. I switched back and forth and re-flashed them with the exact same settings. Still, one of them worked with all tested linux devices, while the other one still refused to work with the Bifferboard. So I concluded, one of these cheap AVR’s from china must be flaky, and I just used the other one. Seems like that’s what you get for one 6th of the price you pay for these chips in Switzerland.

    Apart from the display, I also added an RGB LED that behaves like the BlinkM before. And on top of that a small piezo buzzer. But since I could hardly hear it’s sound when driven with 3.3V, I didn’t bother re-soldering it when it fell off.

    Now, my co-workers also started logging their times with RFID.

    The code is still on github.

  • GPGPU programming class

    It’s already a while back that I completed the coursera class “Heterogeneous Parallel Programming“. It was mainly concerned with cuda, which is Nvidia’s GPGPU framework. GPGPU is about running common computations on the graphics card. The class also quickly covered OpenCL, OpenACC, C++AMP and MPI.

    In the programming assignments, we juggled a lot with low level details such as distributing the work load to thread blocks, which I almost didn’t care about when using OpenCL so far. After seeing cuda and OpenCL, it was a little surprise, that C++AMP is indeed a more convenient programming model, and not just a C++ compiler for the graphics card. Let’s hope that it gets ported to other platforms soon.

    The most eye opening revelation for me was, that it is possible to parallelize prefix sum computation. When I was first presented with the problem, I thought that’s a showcase for serial execution. But apparently it’s not. Making it parallel is a two step process. First make a number of blocks, and compute the sum at the boundary for each one using something like a tree structure (in parallel). Once you have that, it’s more obvious, how to parallelize the rest.

  • minimalist lasershow

    For a long time I marvelled at sites with self built laser shows. There is truly amazing stuff out there. But most of them look like really lots of work. And with simple commercial units getting cheaper, I don’t know if all that effort can be justified. So I had a look at the commercial ones, and found out that DMX units are not enough if you want real-time control. I would need an ILDA connection for that. These units start at about CHF300. I’m considering it, but I’m not quite ready for the investment. To get started I wanted to toy a bit really cheap. I saw the posts where they glue mirrors onto loudspeakers for a long time, but that didn’t convince me. Then I saw someone using the lens mechanism of a CD-ROM for both axis simultaneously. That looked more interesting. Too bad, I disposed a CD-Rom drive just a week before seeing this.

    I wasnt keen enough to drive the coils directly from the micro controller as in the instructable. Coils, like motors and relays are inductive loads that can induce high voltages in the opposite direction, once stopped. As the mechanism goes both ways, a h-bridge seemed appropriate. I had some L293D here which fitted the bill perfectly. To draw simple patterns, an AtMega8 should be enough, I thought. Because I had no more fitting sockets, I soldered it directly onto the PCB, hoping I wouldn’t have to remove it.

    As I had no suitable mirror around, I cut out a small piece of a CD. I hot-glued it to a part of a paper clip, which ran through a hole of another small PCB, and hot-glued the other end to the lens. Applying voltage to the coils moved the mirror.

    I wanted to draw a circle, but what I saw at the wall didn’t resemble to a circle at all. Debugging the thing, I discovered, that one of the four PWM outputs of the micro controller didn’t work at all. I read in the Arduino docs, that some PWM pins could be slower, so I avoided these from the start, but one didn’t work at all. I tried a couple of alternatives, also the slower ones, but no. Then I found out that the AtMega8 has only three PWM channels, and I only looked at the Arduino docs for the AtMega168 with which I did the first tests.

    I’m sure with an AVR that has 4 PWM’s and a bit of tweaking, I should get better patterns. But with this design I’ll never get real-time laser show control, and it’s not suitable for ILDA test patterns. But it was fun experimenting nonetheless.

    As usual, the code is at GitHub.

  • my first package in the official debian repository

    I have created deb packages for a couple of years now. Primarily for software that I created myself, or was somehow involved. But sometimes I also packaged stuff that I just used, and wanted to be able to conveniently install and upgrade on different systems. One of these was printrun, a host software for reprap 3d printers. I packaged it, and provided packages for ubuntu in my ppa, and packages for debian in my own little repository. Then one day, Scott, a debian developer contacted me, asking if I was interested in getting the package to a state ready for inclusion in the official debian repository. The debian standards are very high, and so far, my packages didn’t need to meet those standards. But I wanted to improve my packaging skills anyway, and that looked like a great opportunity to learn from someone experienced. (more…)

  • locally encrypted remote storage

    Unlike the ordinary users, tech savy people are well aware of what can happen to your data, if you store it on cloud services such as dropbox. There are services that promise to encrypt your data locally, so that they can’t access them, a prominent one being wuala. On one hand, I don’t know if their client is open source, thus if you can check that you are really the only one capable of decrypting your data. And on the other hand it’s a paid service.

    Usually, you can do almost everything that commercial products or services offer, free of cost but with a little investigative and manual effort on linux. This one seemed harder than usual, though. (more…)

  • switching the christmas tree online

    The first time I got interested in home automation, was when browsing the arduino libraries. That was all about X10, which communicates over power lines. There are switches that can replace the regular light switches and are pretty cheap in the US. If you want such switches here in Switzerland, you’ll be surprised how expensive they are. And routers with X10 to make it accessible from your smart phone start at CHF 400. But what is easier to get here are the plugs with 433Mhz rf controllers. I got a set with one remote and three plugs for CHF 15 at hornbach. Then I ordered two different transmitters from China. One with the nRF905 chipset and an SPI interface. And one for sort of bit banging. I thought the one with SPI was going to be easier to use. I also found some code to interface it. But first I had to know what I need to send.

    My first Idea was to use the DVB-T dongle with GnuRadio to sniff the rf protocol. (more…)

  • accelerated ray tracer

    In all the great online classes I attended over the last year, there was one topic missing. Finally I found an offering for a Computer Graphics class. After all, that’s the field I ‘ve been working in for the last five and a half years. The class is offered at edx.org and is from Berkley. It’s the first class I’m taking from edx, and the style of the class is comparable to coursera and udacity.

    The first part of the class was concerned about OpenGL, and we implemented an interactive scene viewer. Although I didn’t work directly with regular OpenGL before, only with WebGL which is based on OpenGL ES, it was mostly repetition. But nonetheless it was good training for working with homogeneous coordinates and matrices with different orderings. For grading, we had to produce 12 screenshots from the same scene with different transformations. Once it was implemented I had only to change the order of some transformations to have all images correct.

    The second part was concerned with ray tracing. Eventhough I was familiar with the basic concept, working with it was new to me. And in the class, we had to build a ray tracer from scratch.The theory sounded straight forward. But somehow I was not so lucky in implementing it. In every new part I made some silly mistake. I developed it not exemplary test driven, but with unit tests for every key part that I wanted to verify. With that in place I could usually find and correct the problem in time. For grading, we had to produce seven images. (more…)

  • rs232 bluetooth adapter

    Usually, headless embedded systems can be managed conveniently using ssh. The consumer focused devices have web interfaces. SSH is perfect, for when the system is running, but if the boot process has problems, there is no screen to read the boot messages that the kernel prints out.  For this purpose these devices usually log to a good old serial port, either exposed as an RS232 (+-12V) or internally with TTL level (usually 5 or 3.3V). Most desktop and notebook computers these days don’t have an RS232 port any more. But there are USB to Serial converters, which are a bit pricey but available in most stores. And then you need a serial nullmodem cable. I threw my old one away many years ago, thinking the serial age was over. But then I bought one again exactly to debug the boot process of an alix. But sometimes, the embedded system is in a location where it’s inconvenient to span a cable. That’s when an RS232 bluetooth adapter comes in handy.

    (more…)

  • RaspberryPi reading analog input using an AtTiny through i2c

    The raspberrypi has some GPIO (General Purpose Input Output) pins. That’s great for experimenting with electronics for example sensors and actuators. It’s totally different than an Arduino in many respects, but that’s something they have in common. Some of the pins have special functions. For example SPI, I2C, UART …

    There is a breakboard adapter for all the GPIO pins with a ribbon cable that you can order from the US. That’s cool, but ordering stuff from abroad can be expensive. And the pins look somehow like good old IDE. So I soldered an adapter myself and bought an IDE cable. Well, some pins worked, and some didn’t… Enough for the first round of experimenting, but it took a while to find out what’s going on. I just assumed that all the wires of the IDE cable were connected which for some reason was not the case.

    But something is missing that the arduino offers: analog. Before I really needed analog sensing capabilities, I found an article, describing a hack to read analog input by measuring the time it takes to discharge a capacitor through the resistance you want to measure. Immediately, I tried it myself with a photo resistor. The author warned, that the timings with the python script are not really accurate, and that the correct values for the components would have to be calculated. The Values I got were fluctuating wildly, and I couldn’t really see a difference with the brightness in all that noise.

    So I looked for something more accurate. I still have some AtTiny’s and they have analog inputs. But SPI is the only means of communication they support in hardware. Last week, I implemented uart receiving capabilities in software, but this time I was looking for i2c. (more…)