Monday, October 02, 2017

Broken Ribs

Three weeks ago today I had a kite-surfing accident and broke/fractured rib(s). At the time it was uncomfortable, but I carried on surfing for a few minutes, and it was time to pack up anyway.

I was able to pack up, get home, unpack the car, get out of my wet-suit etc, all a little uncomfortable, but really not too painful. The next morning I went to drive to work, and I got about 100 yards in the car and the clicking and pain was almost unbearable. It still makes me a bit light-headed to think about it.

I limped home, and ended up at home for 3 weeks.

The first week I really did no activities at all. I wasn't away from the house for the first week.

I got some stronger painkillers on prescription, and began taking them immediately. I struggled to do basic things like getting up the stairs, or standing and sitting. All week I lay exactly flat on my back all night without moving. Very uncomfortable.

By the time one week had passed, I was able to be a passenger in a car. I was able to get in and out of a car with a bit of care. However, at this stage I was struggling to get in and out of bed, I made sure I only made the transition from horizontal to vertical once per day. No laying about on the sofa, I only spent time sitting straight up during the day.

After about 10 days I tried driving a short distance, but it was still very uncomfortable, so I gave up driving for that second weekend. Each day I felt more comfortable, and at this stage I was able to sleep a bit on my side; my good side only, not the injured side.

Today, 3 weeks after my injury I returned to work. I'm still clicking a bit, and to be honest, driving is probably the activity I find most difficult. I'm much more comfortable sleeping, in fact last night was the first night I got to sleep on my injured side.

I still have some way to go, but I'm feeling incredibly better than I was, and each day brings an improvement. It wont be long before I'm strapped to a kite again ;)

Monday, September 11, 2017

Kitesurfing - Downhill - 11th September 2017

Epic conditions tonight at Downhill, nice wind for my new 9 and the longest flats between the waves I've ever seen. Out after work, on the water for about 90 minutes.

Then I tried a down loop waterstart. Epic fail, crashed kite and face plant. Sore, but quickly recovered. Then I tried a back roll, and I really have no idea what happened, but I fell hard on my left side.  Real hard. So hard in fact that I think I have broken more than one rib. They are cracking and popping like mad. 

I suspect I'll be out of the water for a week or two :(

Saturday, September 09, 2017

Kitesurfing Benone 9th September 2017

Today was forecast to be good north west all day, but better in the afternoon with more sunshine. I went to Benone after lunchtime and there were 4 other kite surfers already setting up. They were strangers to me, seemed nice, and also mostly learners, I think.

I set up and set off, but it quickly became apparent that these guys were in my way. Being learners their kites were almost always at 12 o clock and I was upwind of them, meaning I couldn't easily sail past them. The wind was quite onshore too.

So I packed off down the beach, downwind of them. It was great. Great conditions, and the new kites boost a lot more than the old ones. Really enjoying them. I was there for a few hours, just getting to grips with the new kite, and how quick it is compared to my old ones. Great Saturday afternoon!!

Friday, September 08, 2017

Kitesurfing - Benone - Friday 8th September 2017

Forecast looked good for this evening all week, and it actually happened. I don't think I have been this nervous about kitesurfing for ages, taking to the water on a new kite, and not knowing its characteristics.

Anyway, after work I headed straight to the beach, someone else wa kiting, so I went to near them. I took a lot longer than normal to get set up, as I was making sure everything was ok with the gear.

It was quite showery, but between the showers I had a great wee session. This is the first time I easily stayed upwind in a long time. Totally juiced on the new 9.

Tuesday, September 05, 2017

Kite 5th September

Tonight I went to the beach to try out my new kites. They arrived in the post today, two Ozone C4 kites, 9 and 12.

I was really only hoping to set them up and see what they flew like, but unfortunately there really wasn't enough wind to even do that. Maybe another day.

Sunday, June 25, 2017

Kitesurfing 26th Jun 2017

Great wee session this afternoon down at Downhill. Wind was quite changeable, I tried both the 9 and the 12, but settled on the 9. Ended up doing two downwinders from the river to the mouth. Lovely flats between the waves, and nice ramps, up to 6-8 ft at the outside. Cross from the west side. Best day I've had for ages. The 9 is so nimble, makes me wonder if I should change the 12....

Wednesday, May 31, 2017

Connecting to a Raspberry Pi behind a 3G Router

Experimenting with 3G router and '3' free 200MB/Mth data SIM and of course there is the NAT problem, so I did this:

/usr/bin/sshpass -p "password" ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=2 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=15 -N -R 22222:localhost:22 -p 1234

Then I can "ssh localhost -p 22222" on my local pi and get connected to the one behind the NAT. Excellent.

Saturday, April 01, 2017

Raspberry pi eGalax touchscreen calibration on zero / Raspberry pi 3 / PIXEL

Software updates bring compatibility problems, that's just how it is. Although the eGalax touch screen drivers are now in the kernel, and the touch screen functionality works out of the box, I couldn't get the touch calibrated.

Long story short, this is what I ended up with. Sometime xinput_calibrator came out with a section like this :

 Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "eGalax Inc. USB TouchController"
        Option  "MinX"  "2881"
        Option  "MaxX"  "62736"
        Option  "MinY"  "60381"
        Option  "MaxY"  "5495"
        Option  "SwapXY"        "0" # unless it was already set to 1
        Option  "InvertX"       "0"  # unless it was already set
        Option  "InvertY"       "0"  # unless it was already set

but that was no good!

Then, finally, it came out with a section like this:
 Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "eGalax Inc. USB TouchController"
        Option  "Calibration"   "103 1962 1864 158"
        Option  "SwapAxes"      "0"

with the "Option Calibration stuff on one line, and this seemed to work. I put it in /usr/share/X11/xorg.conf.d/99-calibration.conf

Hope that saves someone else the time :)

Wednesday, March 29, 2017

moving from inittab to systemd

For better or for worse raspbian has moved from the old System V init process control to the newer systemd version. I liked my inittab file, because it was quite simple and extremely easy to use, but it is no longer a choice.

So, I had this old line in inittab:
Gar:2345:respawn:start-stop-daemon --start -p /tmp/  -m --exec /usr/bin/java  -v -d /home/pi/builds -- -jar garageController.jar

And now I want to run it on a new Raspberry Pi.

So, we need to create a service, its actually quite simple. I created the file /etc/systemd/system/garage.service with this text:
Description=Garage Door Control Software

ExecStart=/usr/bin/java -jar garageDoor.jar gpio


Then we need to run a few commands to make sure our new service auto-starts.

sudo systemctl daemon-reload

sudo systemctl enable garage.service
sudo systemctl start garage.service

sudo systemctl --all | grep garage
##this should show that the service is started.

That's it. 

(I used instructions from

Monday, March 13, 2017

Raspberry pi wont update time on NTP

Weird problem with a pi zero-w, where when I put it on my friend's network it gets the wrong time.

Bit of a workaround, rather than a fix, but it got me up and running, and should be reliable...

  1. Open rc.local file
    sudo nano /etc/rc.local
  2. add following line to the rc.local file
    sudo date -s "$(wget -qSO- --max-redirect=0 2>&1 | grep Date: | cut -d' ' -f5-8)Z"
  3. reboot the Rpi
    sudo reboot
Basically, it gets the HTTP headers from the server at and sets the pi's time to that.


Monday, January 02, 2017

Using a Raspberry Pi to fix a broken Ethernet mains switch

Energenie LAN Switcher

My father-in-law uses an Energenie LAN switch to remotely manage the lighting in a shed where animals are kept. This means that the animals can be monitored remotely day and night by CCTV, and the lighting can be controlled either via the local web server on the LAN Switch, or via Energenie's internet web interface.

However, it stopped working. Time to call in the Raspberry Pi.

I already control my central heating using a Raspberry Pi and an off-the-shelf relay module, so I wondered if the exact same solution would work for the shed lights. I also wondered if I could shoehorn a Pi and the relay module into the energenie casing, so I opened it up.

Inside with the old electronics - you can see scorch marks from the old board failing

It looked like there was enough space there, so I removed the old control board with the burnt out components, and the next stage was to get the software and hardware working. I had an 8 channel relay board and an old Raspberry Pi lying around, so I decided to use those.

It is a while since I installed or updated Raspbian, so I downloaded the latest version, and I have to say, it seems that there is a lot more there by default now, which is helpful. I quickly got my heating server installed and configured, and connected the relay board, and it all worked easily.

The Pi with a relay module - I'm only using 4 relays

Using this I was able to connect via the PHP web interface, or via the android app I wrote for it. It's strangely satisfying to hear relays click on and off when you press buttons on your phone.

As this is really just a quick fix I wasn't going to change the app at all, so it still gets the title "heating controls" and the "on" command is "boost" like it is for the heating.

I set the boost to put the lights on for 6 hours, so that is effectively as long as would be required in one go. The heating controller backend has no concept of "on" or "off", only timed programs.

With this all working, it was time to box it all up. This was probably the trickiest part of the project, but I managed to get the relay module and Pi into the box. I had to do a bit of filing, but it turned out to fit quite snugly allowing the Ethernet connection out the end for easy access.

Relay board wired in

Everything fitting snugly

And some photos with the cover back on

The system has been in the shed for a few weeks now, and is working perfectly. The app allows connection over the local LAN or over the internet seamlessly, depending on which network is available, and the text based protocol means that with even with only GPRS or Edge the switching is very fast.