Archive for the ‘Uncategorized’ Category

Reset

Version 2.0 cards only!

$ gpg-connect-agent
> /hex
> scd serialno
S SERIALNO D<snip>0 0
OK
> /echo Lock the user PIN by trying 4 times with a wrong PIN
Lock the user PIN by trying 4 times with a wrong PIN
> scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
D[0000]  69 82                                              i.
OK
> scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
D[0000]  69 82                                              i.
OK
> scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
D[0000]  69 82                                              i.
OK
> scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
D[0000]  69 83                                              i.
OK
> /echo Locked user PIN
Locked user PIN
> /echo Lock the admin PIN by trying 4 times with a wrong PIN
Lock the admin PIN by trying 4 times with a wrong PIN
> scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
D[0000]  69 82                                              i.
OK
> scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
D[0000]  69 82                                              i.
OK
> scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
D[0000]  69 82                                              i.
OK
> scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
D[0000]  69 83                                              i.
OK
> /echo Locked admin PIN
Locked admin PIN
> /echo Terminate the application
Terminate the application
> scd apdu 00 44 00 00
D[0000] 90 00                                               ..
OK
> /echo Reactivate the application
Reactivate the application
> scd apdu 00 e6 00 00
D[0000] 90 00                                               ..
OK
> /echo card has been reset to factory defaults
card has been reset to factory defaults
> /bye

I was very excited to get our new heating system which uses the OpenTherm protocol to communicate between the boiler and the thermostat. I found the electronic schematics, including PCB design and PIC firmware to make an OpenTherm gateway. This would allow me to plot the different temperatures and modes and learn from the statistics to fine-tune the heating! Only to find out that my, newer, version of the boiler doesn’t use OpenTherm anymore, but uses another type of bus… Back to square one. Here is my journey to reverse-engineer the protocol.

Continue reading ‘Reverse engineering the Elco heating protocol’ »

I needed an oscilloscope that is able to record minutes of signal and export that data to a computer. An oscilloscope is, in fact, nothing more than a analogue-to-digital convertor that samples the input signal fast enough. Exactly what a sound card’s recorder does!

The line-in of my MacBook Pro (6,2) has an input impedance of 28kΩ, and is AC-coupled. So it’s not possible to measure DC voltages. The DC-decoupling capacitor has a 30ms half-time (τ=43.3ms), which makes it capable of measuring down to 3.6 Hz (@-3dB).

Test measurements have shown that 350mV results in 0.115 full-scale deflection, yielding an approximate full-scale voltage of 3V (i.e. ~2.1Vrms).

The setup

The signal that I wanted to measure was 12Vdc, with pulses down to 0V. Putting a 330kΩ resistor in series with the input resulted in a voltage division of ~12.7, bringing the 12V safely below 1V and limiting the maximum current draw to 33µA.

Apparently, by default, Windows Server 2008R2 doesn’t accept Ctrl-Alt-Del keystrokes from the UltraVNC service. This website provided the solution:

  1. “Start menu” -> “Run…” – > gpedit.msc
  2. Navigate to “Computer Configuration” -> “Administrative Templates” -> “Windows Components” -> “Windows Logon Options”
  3. Double-click on the “Disable or enable software Secure Attention Sequence” parameter.
  4. Check “Enable”, then select “Services” in the combobox.
  5. Apply the modification

I’ve been working on a web-interface for my Velbus home automation system for a while now.

Someone once told me: “If you aren’t ashamed of your first release, you waited too long”, so here it is: https://github.com/niobos/velbusd

I was under the illusion that a Time Machine backup would do as they claim:

You can set up Time Machine to automatically back up all your important files, including your documents, music, photos, applications, and any other items you keep on your hard disk.

I consider my iTunes authorizations important, but apparently Apple does not. Seems that these are specifically excluded from backups… Removing the “SC Info” line from the /System/Library/CoreServices/backupd.bundle/Contents/Resources/StdExclusions.plist file solved this.

I know I should have de-authorized my machine before reinstalling, and I know you can “de-authorize all” to fix this as well; but it’s pretty disturbing to see iTunes remove all your applications from your iPhone…

When programming with multiple files/modules, dependency tracking is always a big issue. GNU Make calculates the correct order to compile in, but is only that smart. It does know that if a .cpp file changes, the corresponding .o file needs to be updated. But a change in an included header can go unnoticed.

While debugging a strange problem today, it was exactly that last scenario: A change in a header file did not cause a recompile, which left me debugging an old version of the binary. So I wanted to include the dependencies of .cpp files on the included headers in my Makefile. But since I’m too lazy to do it myself, I wrote a script.

Continue reading ‘Automated #include tracking with make’ »

One very nice feature the iPhone lacks is the ability to request a delivery report on text messages. I usually abuse these by sending a text message to family/friends while they’re on a plane. As soon as they land and switch on their phone, I get a delivery report. Which essentially tells me “for free” that the person has landed. (With Belgian carriers, receiving text messages is always free, even abroad, because you can’t refuse them).

Continue reading ‘SMS Delivery report on iPhone’ »

I’m a fan of keyboard shortcuts. Not to memorize them, but to use them. It’s just so much quicker to hit CMD+W to close the current browser tab than it is to carefully navigate your mouse to that 12*12 pixels button. However, this didn’t work flawlessly. Sometimes I get the ubiquitous “do you want to save?” question and I have to use the mouse to click “Don’t save”; Tab doesn’t seem to work.

Until I found out how to change that setting, that is. It’s hidden in the System Preferences under Keyboard – Keyboard Shortcuts. You can change Full Keyboard Access to “All Controls”, which is the behavior I’m used to from Linux and Windows.

I noted that my calendar doesn’t contain Easter, nor any other official holiday. So I decided to create an iCal-file that contains all official holidays in Belgium. And while I’m at it, I added the school holidays as well.

Continue reading ‘Belgian offical holidays and school vacations’ »