Raspberry Pi GPS tracker – Converting Code to PHP – Part 2

In the last post I looked at converting the original Python code to PHP. This all ran without issue but I quickly found that because the Pi wasn’t connected to the internet the date and time of the device never got updated. This meant that the log files always had the wrong timestamp when they were created making it difficult to find the one I needed.

Turns out that there is a simple answer to this problem. As the GPS satellites include the current date and time as part of the detail that is sent along with the location we … Read the rest

Raspberry Pi GPS tracker – Converting Code to PHP – Part 1

Last week I looked at getting the hardware up and running for a Raspberry Pi GPS tracker. However, as I said I was using some Python code and I don’t speak Python so I wanted to convert it to PHP. So this week I am going to look at what I did.

Before I could even begin to look at the converting the code I had to see if it was even possible for PHP to access the serial port. Turns out this is exactly what Direct IO (dio) is for but it isn’t included as standard so you … Read the rest

Raspberry Pi GPS tracker – Getting it Together

Having secured a Pi Zero from the cover of a the magazine MagPi I thought I would start out simple by trying one of the projects shown there. The one that caught my eye and required no soldering was to build a GPS tracker.

Getting hold of a cheap USB unit was pretty easy but make sure it is Linux compatible. I bought this one from eBay.

The first thing I did when I got the unit was to try it out on the Pi and while it was working I could see that it had got a satellite … Read the rest

Using Kindlegen with PHP on Linux to Create Kindle Files

I’m working on a side project at the moment that requires the conversion programatically of a page of html to something that can be consumed by an Amazon Kindle. I did a quick search to see if anything existed as a PHP class library that I could use and while there was they were either hugely bloated or too alpha for my needs.

I then stumbled upon Amazon’s command line tool KindleGen which allows conversion of HTML and ePub docs to the MOBI format that the Kindle requires. This is a multi-platform too and, crucially, a version for Linux is … Read the rest

Coding on the web

I ceased to be a professional developer a number of years ago but I have still continued to dabble either when things needed doing at work or for my own amusement. I started out working on COBOL projects and the obscure FOCUS before I retrained to the wonderful PowerBuilder. Nowadays it is almost predominately PHP and a little bit of mobile development with Rhodes. I have never really been one for dedicated IDEs preferring to use a rich text editor such as Notepad++ on Windows and TextWrangler on Mac.

Recently I have been working across a number of … Read the rest