Pi Zero W – PiDashCam Part 2

There will be a longer post about the newly released Pi Zero W, however suffice to say as soon as I saw it was available it was ordered, and I now have one!

There has been a few changes to the PiDashCam project, which has included moving to the Pi Zero when v1.3 was released (As it had a camera connector on the board). I missed my opportunity to write about those updates!

The Pi Zero W uses a similar set up to the Pi 3, in that the built-in bluetooth capabilities use the hardware UART, which means that my UART GPS receiver wont work.

As it is so similar to the Pi 3 (excluding the memory and processor) the current Device Tree for disabling bluetooth on the Pi 3 works for the Pi Zero W.

I’ve included some code below. This starts from a fresh install and allows you to use the hardware UART of the Pi Zero W and disables bluetooth on that board.

I hope it helps someone! (Also, feel free to replace vi with nano – I’m trying to teach myself Vim).

in this file, remove the following text:

Save and close the file. Next up,

and add the following to the end of the file:

Next, it’s these three quick commands which includes a reboot of the Pi Zero W, which enables hardware UART:

To complete the GPS side of things however, continue with the following:

and finally,

which should see you getting data from the GPS Receiver.

Thanks to Adafruit for their existing tutorial, and the Raspberry Pi github/forums and IRC for the Device Tree information.

Using only PHP to save Google Starred items to Pocket!

So, based on my last post, I wanted to see if I could do everything with PHP. After a bit of google-fu and using the php.net manual, I’ve managed this beauty. Use at your own risk! This works with my Google Starred items, and you still have to obtain the starred.json file from the Google Take Out service (See my last post for more information).

If you have any tips on how to improve this, drop me a comment!

 

Using the terminal & PHP to save Google Reader Starred items!

*MAJOR UPDATE* – USING PHP ONLY WITH NEW CODE! Please view this next post for more information!

So. Google Reader is closing down. I’m not going to get all high and mighty – It’s Google’s product. They do with it as they wish! There are several places that let you save your feeds from Google Reader, but I wanted to add all my Starred Items from Reader into Pocket. It turns out it wasn’t the easiest thing to do! After a few terminal commands and some PHP, this is what I came up with!

Firstly, head to Google Reader, and use the Data Takeout feature that Google provides to save your Reader Data only. The outputted ZIP file should contain a folder entitled “Reader”. Within that, there should be a file named “starred.json”.

*UPDATE* – I have saved these 2 files to GitHub! Go, Grab!
https://github.com/nickwebcouk/pocketimport

Now the fun begins! To make it easy (and quick) I used the Terminal on Mac and ran these commands within the above folder. I used two files (new.txt and newnew.txt) just to keep track of what was happening. There are easier ways of doing this! I ran the following commands from terminal:

The “grep” command looks through text files for specific expressions. “cat” outputs a full file, “rev” reverses items, “cut” cuts text, “rm” removes files and “mv” moves files.

To make this easier, I created a Shell Script (Tested on OSX 10.8.2 only)

You can run that file by saving it to the same location as the Google Reader folder, and running the following in terminal first:

the first line tells the computer to allow script.sh to be executed, and the second line executes the script.

I then moved the url.txt file that had just been created to my www root folder (for me its under /users/~name/sites/), and created the following PHP/HTML code:

This provided me with a HTML page, which if saved as instapaper-export.html allowed me to head to getpocket.com and use the Instapaper import option.

584 starred articles and 2 seconds later, I received this wonderful little message!

getpocket import