Hull Blogs

Aggregated posts from University of Hull students

Going Smart

Recently I decided that we needed to have a location tracking system for our household for two reasons; We never know where each other are Presence detection if we choose to get more active in the Internet of Things in the future. After looking at proprietary systems like Find my Friends, I decided the best solution for us would be OwnTracks. It’s a FOSS project and it’s locally hosted (so we own our data), it has an active community (so more features coming) and it’s open source (so I can read through all the code and self-compile if I wish). The only downside of it is that it’s a bit slow to work out changes in location (due to Apple imposed background restrictions I think) but I hope this is addressed in the future. It was a challenge to set up in its Docker container as I was slightly confused by the manual and ended up cooking up a docker run command from a page on the forum with a whole host of variables attached, it’s now running well though with an uptime of 10 days so far. The OwnTracks community were awesome though and gave me some great pointers to get going. In terms of adopting the IoT itself I chose to install home-assistant.io, I chose it over OpenHAB due to its use of Python over Java and the relative simplicity to get started with, installing in just a few seconds with few dependencies. I thought about platforms like SmartThings/nCube that are pre-designed but I decided something that’s open and ‘hackable’ would suit me much better. It was simple to set up home assistant and connect it to the MQTT broker (which OwnTracks uses to send over its data) and now and whether people are at home is shown at the top of the page. I also added a MJPEG camera for monitoring my dog’s crate and the Chromecasts to see what’s playing control or restart them). Things are coming together in our IoT set-up, one of my summer projects is to make a python script to open/close the garage door as well as some magnetic contacts to tell whether the door is in the open or closed position. Also I’ve been looking at smart light switches too (but I can’t find anything apart from lightwaveRF which costs an arm and a leg at £30 a switch). …
Read more

Getting Started with OwnTracks

This is a guide of home to get started with OwnTracks in Docker on Ubuntu 14.04 When I started with OwnTracks I had some trouble with the booklet as I found parts of it a tad disjointed and was a bit mixed up as there were some missing steps to get going. So here’s a quick guide to get OwnTracks installed and get going with it. I’d advise you use Docker for it as it’s simpler to get started with and can easily be updated (also it contains a MQTT broker so it’s a bit less hassle). Install Docker if you haven’t already Get the Docker repo docker pull owntracks/recorderd By default OwnTracks will make itself some self-signed SSL certs, if you have your own Certificate Authority just sign yourself one for the domain your using, if not you can quickly create one using XCA here (using this guide) or use the default provided ones if you’re so inclined. Start the docker container using the command below, but changing the following; replace /var/owntracks and /var/owntracks/log with the data directory you want (create it first using mkdir) but for this walkthrough I’ll assume you use /var/owntracks. Replace mydomain.uk with your own domain, change 192.168.1.11 to your server’s network IP docker run \ -v /var/owntracks:/owntracks \ -v /var/owntracks/log:/tmp -p 1883:1883 -p 8883:8883 -p 8083:8083 \ -e MQTTHOSTNAME="mydomain.uk" -e IPLIST="192.168.1.11" -e HOSTLIST="mydomain.uk" \ owntracks/recorderd When the container starts your data directory should populate, now kill the container using CTRL + C on the keyboard Create yourself some users by editing the /var/owntracks/mosquitto/mosquitto.acl file like this: # This affects all clients. attern write $SYS/broker/connection/%c/state pattern owntracks/%u/# user recorder topic read owntracks/# #the above line says that owntracks is allowed to view all locations to save them user nathaniel topic owntracks/nathaniel/+ # the line above say that Nathaniel can only edit own locations topic read owntracks/+/+ # the line above say that Nathaniel can view everyone's locations user phil topic owntracks/phil/+ # the line above says that Phil can only post and view his own locations # he can't see anyone elses locations Next edit mosquitto.conf # add the password file and access control list (acl) links like this password_file /owntracks/mosquitto/mosquitto.passwd acl_file /owntracks/mosquitto/mosquitto.acl listener 1883 listener 8883 # add your CA cert, web cert and private key here cafile /owntracks/cert3/ca.crt certfile /owntracks/cert3/mosquitto.crt keyfile /owntracks/cert3/mosquitto.key require_certificate false Next you need to get your users some passwords so they can actually post their location and so owntracks recorder can actually save the location so spin up the container again using the line from before then in another terminal window SSH’d in, run docker ps and copy the container ID Now run sudo docker exec -t -i container-ID-here bash You’re inside the docker container, run mosquitto_passwd /owntracks/mosquitto/mosquitto.passwd nathaniel (replace nathaniel with your user’s name) and enter your new password twice, now do this for all the users you want don’t forget creating a password for ‘recorder’, then exit by typing exit and hitting enter. Now you should be ready to go, run sudo nano /owntracks/mosquitto/mosquitto.passwd and check your password hashes are there You’re now ready to roll, so run the command below but this time you’re adding the user ‘recorder’ and the password you created for it so owntracks can record now, docker run \ -v /var/owntracks:/owntracks \ -v /var/owntracks/log:/tmp -p 1883:1883 -p 8883:8883 -p 8083:8083 \ -e MQTTHOSTNAME="mydomain.uk" -e IPLIST="192.168.1.11" -e HOSTLIST="mydomain.uk" \ -e OTR_USER='recorder' -e OTR_PASS='password' \ owntracks/recorderd Navigate to http://yourIP:8083 and you should see the OwnTracks interface Install the OwnTracks root CA cert you created on your phone and fill out all the fields in the app like the screenshot and your phone should connect and your phone will populate the location (and it will appear in the web version). Forward port 8883 through your router, if you have Dynamic DNS you can just use yourdomain:8883 to continue posting even when you’re out and about. If everything is working well, kill the container and set it to always restart (as shown below) so it will restart after reboots and the docker process being restarted. docker run \ -v /var/owntracks:/owntracks \ -v /var/owntracks/log:/tmp -p 1883:1883 -p 8883:8883 -p 8083:8083 \ -e MQTTHOSTNAME="mydomain.uk" -e IPLIST="192.168.1.11" -e HOSTLIST="mydomain.uk" \ -e OTR_USER='recorder' -e OTR_PASS='password' \ --restart='always' owntracks/recorderd Make yourself a brew …
Read more

NAS and NUC

Establishing a decent network infrastructure I started 2015 with nothing but a WD Passport 1TB drive connected to a BT Home Hub to serve our network, with its dreadfully slow read and write speeds, taking a good 30 seconds for a photo to display once selected. I intended to move my home folder over to that drive too so I could have some kind of backup for my files, but backing up the 950GB of files I’ve amassed over the years to that drive didn’t seem a fun task. I also wanted a media streamer to rid us the need of having DVDs scattered around the house in different cabinets, as I had recently convinced my family to get a Google Chromecast for each room with a TV; so we needed a high quality way of streaming to them as well as allowing us to remotely play the media when we’re out or away through PLEX. For this, I decided more hardware was needed; so I started comparison of the best NAS’ and media streamers and nearly chose the Synology DS214Play (as it does both in one) but decided to go with the Synology DS214 and an Intel NUC as the ‘Play’ model supposedly was unable to transcode (convert for devices) PLEX well as its dedicated GPU was only optimised for DS Video (Synology’s own video solution). However, the compatibility with USB tuner cards of Synology’s media player means in the future I will replace our existing BT Vision box with this to record in HD with availability in every room (playback through Plex) whenever I’m able to get an aerial cable down to there. I ordered the hardware for the end of August, so I just had time to set it up before returning to school, I first installed the WD Red 3TBs and set up the NAS with shares for family members and establishing it as the DCHP and DNS server replacing BT’s default hard-coded DNS entries on the Home Hub with my internal domain and forwarding other requests to 8.8.8.8 (priorities, right). I also configured LDAP so I can later join my Mac to the directory server and sync my home folder to it (at the moment I’m just using Synology’s ‘DS Cloud’ app to back up my folders) and VPN (which was far more inconvenient than I ever imagined it could be, but we’ll save that for another post). With the NUC, I installed a Western Digital 500gb HDD and booted from an Ubuntu USB drive, after installing and configuring Plex, Apache and numerous other services I was back to the start reinstalling Ubuntu due to a GRUB bootloader issue that prevented Ubuntu started. I created shares on the NAS that were network accessible such as one for films and TV, photos, home videos as well as home folders for each of the users. Then I enabled NFS sharing on the NAS and gave permissions to the NUC for the films, home videos and backup folder (don’t want to lose my config again!). Another useful addition was plugging my BlinkStick into the NUC and using a Python script to change the LEDs colour depending on the CPU usage (green 0-49%, amber 50-99%, red 100%) which is especially useful to see when Plex is doing resource-intensive transcoding. And that brings us nearly up to date. I’ll save the rest of the interesting and quirky set up tales for next time. …
Read more

Frog poem

Under a rock and hidden deep, There lies a frog, he’s half asleep. He dreams no dreams of kingdoms far, But of being trapped inside a jar.  He tossed and turned throughout the night, Not cold, he shivered from his fright. The jar was sealed, the air was thin, Not much air was there within.  So he gasped and strived for a breath, And bravely waited for his death.…
Read more

Code snippet test

If you want to get the first fault tree in my ExampleFaultTrees object, then the following code is for you: var exampleFaultTrees = new ExampleFaultTrees(); topNode = exampleFaultTrees.getFaultTree(0); You first need to instantiate an ExampleFaultTrees object and then you can ask it for the zeroth element in its internal array of fault trees. You can then simply call the topNode’s draw function, giving it the 2d context of the canvas as a parameter to draw to.…
Read more

Lost in translation: How to draw a fault tree

The other day I gave a workshop for the 08240 2d Computer Graphics students in the Computer Science department of the University of Hull. A number of the students were struggling with this aspect of the coursework that they were undertaking. Above is a rough video I put together of the content. I made it using a chemistry beaker holder to hold my webcam pointing down at the surface of my desk.…
Read more

Spooky Elephant releases Heartotron!

Just a quick note for now to announce the publishing of our game – Heartotron – to the Windows Store. You can preview and install it (for free!) on your Windows 8 device from the following store link: http://apps.microsoft.com/windows/app/heartotron/569d7e21-6eca-479c-8dfd-03371b5f739e Please give it a go and leave us some feedback or ideas for improvements. We have a planned update for later in the week to add new enemy types so watch this space.…
Read more

Boarding the Android Express

Today I took possession of my shiny new Samsung Galaxy Note II. My previous daily device was the Samsung Omnia 7 which was one of the debut devices of the Windows Phone 7 range. It was a close run race between the Note II and the flagship Windows Phone 8 device the Nokia Lumia 920. I mentioned before that it was a close race with the Lumia phone. Both are large, flagship devices with the Lumia being widely lauded as having one of the best cameras on a mobile phone, the best in low light.…
Read more

My DIY eGPU Project – Speed boost

This morning, some lovely person using the handle Burger commented on one of my earlier postssuggesting that if I connect the eGPU setup after boot-up is complete then I should get a significant boost due to PCIe compression. I little bit of Googling reveals a bit more detail here, but it seems that you need to have a ‘modern’ Intel integrated GPU in combination with one of a fairly narrow range of Nvidia kit.…
Read more

My DIY eGPU Project – The Hawk

Today my new graphics card arrived from eBay. It is a second hand MSI N460GTX Hawkwhich I picked up for a reasonable £79.02 including postage. This puts the running total for the eGPU project (not including bits that I had lying around) at £166.10. So how does it perform? Well you may remember that I previously benchmarkedboth the integrated graphics of my laptop and a borrowed Geforce 9600GT in the eGPU adapter with the eGPU providing a splendid 3 times increase in the 3DMark06 score.…
Read more

My DIY eGPU project – Benchmarking

Well, I have done a spot of benchmarking. Specifically using 3DMark06 and the Resident Evil 5 benchmarking tool. If you are wondering what I am talking about here is an introductionand a follow-up. I guess a brief recap wouldn’t be out of place. I have a laptop with integrated graphics. This severely limits the games that I can play. This makes me sad. I have read that I can put together an adapter that plugs in to the ExpressCard slot in my laptop that allows me to use a desktop GPU to power the graphics.…
Read more

My DIY eGPU Project – Delivery and Test

Today (26th) the adapter parts for my eGPU project arrived from Taiwan. I paid for it on the 20th via PayPal and on the 24th the PayPal status was updated to let me know that my purchase had shipped with a DHL tracking number. I am pretty happy with the delivery time. Something that I knew was a possibility, though was still slightly vexing, was an accompanying VAT charge from Customs amounting to £12.…
Read more

(R)evolving Art

Though I like to think that my software development work shows a little artistry, I am certainly not an artist in the classical sense of the word. However, I have been developing an art project with artist Roberto Bono (Roberto’s website) for the past year or so, and as I have just uploaded a couple of new Roberto works I thought I would share them. The ‘idea’ of the work is that is is comprised of 12 double sided paintings that form the whole.…
Read more

King of the Beverley Maize

Today I spent the day a the Beverley Mazewith The Wife, The Boy, and some friends. If you haven’t encountered such a thing before, it is a large maze that has been cut in to a field of growing corn (or maize to identify the pun). In order to add to the challenge and fun of the exploration there are, dotted about the maze, some boards with quiz questions. By collecting the correct answers you can decode the final board at the exit of the maze and enter your self in to their competition.…
Read more

Memory of a Goldfish

This game was my first foray into Windows Phone 7 development. It is a Silverlight app based on the card game of Memory (as I knew it, though it is also known by many other names according to Wikipedia). The idea is that you turn over the ‘cards’ in pairs; if they match then you get to keep them. If they don’t match then they are flipped back over and you get another try.…
Read more