tmux useful commands

tmux is a great alternative to screen if you’re looking for multiple virtual sessions in one terminal window.

Useful commands:

Ctrl-b c : open new session

Ctrl-b n | p : cycle next / previous through sessions

Ctrl-b % | ” : split horizontally / vertically

Ctrl-b left | right | up |down : cycle back /forward through visible split windows (left/right if split horizontally, up/down if split vertically)

Using Putty SSH, if you’re not getting line characters for the splits, change session charset to UTF8.

Reading from the Adafruit GPS sensor on the Pi

Per instructions in the Oracle Embedded Java MOOC this week, here’s the steps to get gpsd setup to read from the sensor if it’s attached via a USB TTL cable:

sudo apt-get install gpsd gpsd-clients python-gps

ls /dev/ttyUSB* – to check what USB port we’re connected to

sudo gpsd /dev/ttyUSBx -F /var/run/gpsd.sock to start the daemon, replace x with the port number from step above

cgps -s – to run the client

 

If the GPS is attached via GPIO pins, then, similarly to above:

ls /dev/ttyAMA* – to check what AMA port we’re connected to

sudo gpsd /dev/ttyAMAx -F /var/run/gpsd.sock to start the daemon

Check check you’re reading data from the connected port, you can do:

cat /dev/ttyAMA0 – and you should see the raw messages being read from the card.

To interpret data coming from the card, read a line until you get a line prefixed with $, and then the next 5 chars represent the message type:

$GPGGA = gps position data

$GPVTG = velocity data

Windows 8.1 update 4/8/14

I picked up the 4/8/14 Windows 8.1 update today and was pleased that the Metro apps can now appear in the ‘classic’ desktop taskbar. It still seems odd to me that Windows 8 has two distinctly different personalities – the touchscreen friendly Metro apps from the new Start screen, and the classic desktop with regular looking Windows apps. It just seems confused to me – which is it? A post-PC touchscreen OS or a classic Windows desktop? Well, now at least the two are somewhat more combined.

Rather more odd however is that this cumulative update is required if you want to continue to receive Windows Updates. Pretty sure some internal IT departments are going to be pretty annoyed with this approach – “You want updates in the future? Install every update up to this date then we’ll give you new updates”. Uhuh.

Enabling i2c on Raspbian

Add the following to /etc/modules:

i2c-bcm2708
i2c-dev

Install i2c-tools:

sudo apt-get install i2ctools

Edit /etc/modprobe.d/raspi-blacklist.conf and remove/comment out these two lines:

blacklist spi-bcm2708
blacklist i2c-bcm2708

Detect your ic2 interface with:

sudo i2cdetect -y 1 #1 = Pi model B

If you get this error:

Error: Could not open file '/dev/i2c-1' or `/dev/i2c/1': No such file or directory

Then run this first and you should be good to go:

sudo modprobe i2c-dev

More info here.