Raspberry PI

SMS’ing

I thought it would be cool to install SMS support on my Raspberry Pi. It would give me some kind of control of my network if there was some issue with my ADSL line. I had some unused 3G modems that I wanted to use. I decided to go for Gammu.

To install Gammu:

sudo apt-get install gammu
sudo apt-get install gammu-smsd

Messages can be stored in various formats. I decided to go for sqlite. Messages are stored in a database instead of text files. You will have to install the libdbi driver for sqlite as I discovered the hard way. 

To install sqlite support:

sudo apt-get install libdbd-sqlite3

I ran into a bizarre issue: it seems that both the database file and the directory it is in need rw permission for user, group and all. You need to create the database yourself. There is a compressed SQL script for doing this in /usr/share/doc/gammu/examples/sql. So:

sudo gunzip /usr/share/doc/gammu/examples/sql/sqlite.sql.gz
cp /usr/share/doc/gammu/examples/sql/sqlite.sql sms.sql
cat sms.sql | sqlite3 sms.db

Then change the privileges of sms.db and its parent directory to rw for user, group and all. This may be a security concern for you but this seems to be the simplest solution to access errors. Switch to another database or text files if this bothers you.

One issue I haven’t been able to resolve yet: Delivery reports. I don’t get any and I don’t know why.

lirc

I ordered a DFR0094 “Digital IR Receiver Module(Arduino)”. Then I discovered that the Pi’s GPIO works on 3.3V and not 5V. I couldn’t find any info on whether the DFR0094 would work with a 3.3V supply instead of 5V. I took a chance and it seems that the DFR0094 is quite happy running on a 3.3V supply instead of 5V. I basically followed the instructions here.

First Entry Using MarsEdit

I usually take a long time to write new blog entries. “The spirit is willing, but the body is weak”. When I do sit down to write a new entry I end up staring at the flashing cursor not knowing where to start. Hopefully preparing my posts offline will also help in that I will not put as much pressure on myself to complete a post.

My Book Live revisited.

WD mentions that they only support Mac OSX and Windows for remote access. They don’t seem to mention explicitly that they don’t support Linux. I intended to find out. First of all you have to ensure that you have the Java plugin installed. Then you may have to get past the infuriating security messages. The latest version of the JRE (1.7.0_51) responds with this

CacheEntry[http://mybooklive-devicennnnnn.wd2go.com/Admin/webapp/htdocs/MapDrive.jar?v=18]:updateAvailable=false,lastModified=Mon Sep 16 20:46:28 SAST 2013,length=117733
Missing Permissions manifest attribute in main jar: http://mybooklive-devicennnnnn.wd2go.com/Admin/webapp/htdocs/MapDrive.jar?v=18
CacheEntry[https://mybooklive-devicennnnnn.wd2go.com/Admin/webapp/htdocs/WDTester.class]: updateAvailable=false,lastModified=Fri Aug 26 03:59:41 SAST 2011,length=750
0

(I have replaced my device id with “nnnnnn”). I messed around with various versions of the JRE but really got nowhere. JRE 1.6.0_34 produced this lovely report

ava.lang.RuntimeException: java.lang.ExceptionInInitializerError
	at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError
	at com.wd.nas4g.mapdrive.MapDrive.<init>(MapDrive.java:73)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at java.lang.Class.newInstance(Unknown Source)
	at sun.plugin2.applet.Plugin2Manager$12.run(Unknown Source)
	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$200(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.RuntimeException: Unsupported OS: LINUX
	at com.wd.nas4g.mapdrive.command.WebDAVCmdFactory.<clinit>(WebDAVCmdFactory.java:26)
	... 21 more
Exception: java.lang.RuntimeException: java.lang.ExceptionInInitializerError
Taking a look at the java code reveals this:
  static
  {
    String osName = CmdUtil.getOSName();

    if (osName.indexOf("MAC") != -1)
      instance = new MacCmdFactory(null);
    else if (osName.indexOf("WIN") != -1)
      instance = new WinCmdFactory(null);
    else
      throw new RuntimeException("Unsupported OS: " + osName);
  }

With WebDAVCmdFactory.java:26 in red. Any OS other than MAC or Windows should trigger an exception.