Sep
22nd
2015

MCP4725 DAC with RPi

There are some examples out there on the internet on how to use the MCP4725 with WiringPi. I found them to work, however writing to the EEPROM didn’t.
The solution is to use WiringPi’s wiringPiI2CWriteReg16 function:
Pass the first byte (which specifies whether to write to the DAC register only or to both DAC and EEPROM)
as the register parameter and the 12 bit voltage value as a 16 bit int (hence shifted by four bits) as the second
parameter.

#define DEVICEID 0x61

void setDACVoltage(int voltage, int writeToEEPROM) {
    int fd = wiringPiI2CSetup(DEVICEID);

    voltage = (voltage > 4095) ? 4095 : voltage;
    voltage = (voltage >> 4);

    if (writeToEEPROM)
        wiringPiI2CWriteReg16(fd, 0b01100000, voltage);
    else
        wiringPiI2CWriteReg16(fd, 0b01000000, voltage);

    close(fd);
}

Jan
23rd
2014

EA DOG-M162 Character Display Python Library for Raspberry Pi

A few days ago I found this display in a drawer and thought it would be a useful addition to the graphics display
that’s already connected to my Raspberry Pi. As there was no library avaiable for the
DOG-M162 (at least I couldn’t find anything), I wrote one myself.
This probably wasn’t exactly rocket science, but I thought I’d share it here: dogm.py

Here’s a short example how to use it:

import dogm

disp = dogm.DOGM()
disp.init('/dev/spidev0.0', 0) # First argument: SPI device name, second argument: GPIO pin you connected RS to)
disp.clearDisplay() # Clears the display... obviously
disp.displayString("Hello",0) # Writes string into first line of display
disp.displayString("World",1) # Writes string into second line of display

May
20th
2013

OS X: iTunes could not contact the iPhone software update server

So, I just wanted to restore my iPhone with iTunes 11 on OS X 10.8.3. But all I got was:

iTunes could not contact the iPhone software update server because you’re not connected to the Internet.

Well, thanks iTunes for being so confident, but I was pretty sure I was connected to the Internet. So after trying several things for several minutes I found a fix. Here’s how: Open ‘System Preferences’, click ‘Network’, select your network interface and click ‘Advanced…’. Switch to the ‘Proxies’ tab and tick the box labelled ‘Auto Proxy Discovery’. Confirm with OK and enjoy your iPhone restore/update process mysteriously happen.

Feb
6th
2013

Raspberry Pi / Raspbian: SSH locale issues on OS X

Here I am, back among the living with something related to the Raspberry Pi I’ve just got today:
When connecting via SSH from a OS X machine, it tries to use the same locale as on the client computer which results in those messages:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = “UTF-8”,
LC_MESSAGES = “en_GB.UTF-8”,
LANG = “en_GB.UTF-8”
are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

To solve this, edit /etc/ssh_config by typing
sudo nano /etc/ssh/ssh_config

and put a # at the beginning of the line starting with SendEnv LANG LC...

Save, close and reconnect your SSH session and everything should be fine.

Feb
2nd
2011

Solution: Apple TV does not display YouTube favorites

When I tried to set up my YouTube account on my new Apple TV and wanted to open my favorites, everything I got was:

No content was found. There is a problem communicating with YouTube. Try again later.

Bummer! It didn’t seem to be a connection or software issue as everything else (including watching YouTube videos) worked. So here is how to fix that.

  1. Go to youtube.com, click your user name and then ‘Account’. Then select ‘Activity Sharing’. (or be lazy and go directly to that page)
  2. Check both the ‘Subscribe to a channel’ box and the ‘Favorite a video’ box.
  3. Save your changes.
  4. Sorry, that’s it.
Mar
30th
2010

Yes…

Yes, I am alive. I’ve been a bit busy recently so there haven’t been any updates since November 2009 but I hope to get a new version finished within the next two weeks.

Finally managed to upgrade my WordPress installation from 2.8 to 2.9.2, at least. 😉

Oct
27th
2009

(MacBook Air) Remote OS X Installation

Just a quick note: Don’t even think (really, no kidding!) about doing the remote installation via W-LAN (at least with if you can’t use 802.11n). Even with Gigabit Ethernet it takes ages:

(Doesn’t look too bad, huh. But: the estimated time remaining is steadily counting up, not down.)

Screen shot 2009-10-27 at 15.25.01

Sep
13th
2009

Seafoid + Snow Leopard = Seafoid 3.0

Yes, I am alive. It’s more than a week now that  Snow Leopard came out and there is still no new version that works with the new Mac OS X. The reason is simple. Instead of using the time to fix the old Seafoid I’ve started to completely rewrite the app from scratch to make it more extendible for future development. It will also come up with some cool new features. Just to name a few:

  • Calculating circuits with the legendary NE555 (currently as an astable and monostable multivibrator)
  • Revamped heat sink calculation. Additionally to the old way (calculating the resulting chip temperature for a heat sink), Seafoid has a new option called “Calculate Appropriate Heat Sink” where you specify the maximum chip temperature and the app will tell you what thermal resistance the heat sink must have.
  • Seafoid 3.0 combines the clean look of Seafoid 1.x and the function of Seafoid 2.0, plus lots of improvements and new features.
  • Seafoid is now localizable! The beta release will come with English, German and Greek translations.
  • Lots of minor improvements like better input information and exception handling.

A beta version will be available soon is available. Stay tuned!

Updated on September 14, 2009.

Jul
7th
2009

Hanging Apple Software Update

There’s a thing that I experienced on two different Macs (Late ’06 MacBook and Late ’08 MacBook Air, both 10.5.7) at the same time: Software Update caused the whole system to hang after I had chosen to install the updates. No app would launch anymore, even a shutdown wasn’t possible.

Deleting /Library/Preferences/com.apple.SoftwareUpdate.plist did the trick and everything’s fine again.

Jun
18th
2009

Up Next: Control USB Power Outlets

I was a bit lazy recently when it came to coding apps. But there is something to come: a graphical user interface for sispmctl. This allows you to control USB-controlled power outlets. That’s how far I’ve come:

The final version is going to feature triggered switching (for example: turn on external HD when Final Cut is launched) and scheduled switching. Beta soon.