CentOS 7 on an HP MicroServer N36L with an AMD Mobility Radeon HD 5430

I have an aging N36L box I use at home as a file server on our internal network.

Today a yum update in CentOS7 (it has not been updated for a long time so there were a lot of packages) caused the graphics to be corrupt/crash (machine was fine in text only mode).

I tried a few different things:

  • the latest mainline kernel from elrepo.org)
  • Fedora 29 (which rebooted immediately after logging into GNOME and had lots of graphical corruption in XFCE
  • Eventually downloaded CentOS7.3 from the archive and reinstalled using that. It’s a terrible work-around (and I didn’t keep logs or error messages). I used software RAID 1 with LVM on top.

Really this post is just to remind me what my dirty hack was if I need to do it again. I ought to collect logs and diagnostics of the problem and report it upstream.

TEDx Southampton 2016

TEDx Southampton 2016 happened today – the subjects were diverse and the speakers varied in style. I enjoyed most of them but there were two, in particular, that I thought might change my behaviour in future…

Tony Curran was speaking about the carbon-footprint of our food. He linked to the XKCD representation of the relative weights of the the population of land mammals. If you’ve not seen it before, the small fraction of wild animals might surprise you. Look at the fraction that is cows! Reducing the amount of beef we eat (even if you swap it for chicken) could have a big impact on the planet. He also talked about the importance of eating things in season and of choosing foods that come by land/sea not flown by air or grown in a hot house. He has a handy PDF guide to whch foods are in season.

Megan Streb talked about the importance of livable spaces. She extolled the virtues of knowing your neighbours, kids playing outside and communal outdoor spaces with seating. She talked about the possibility of closing streets for parties (or more regularly for kids to play). It was definitely food for thought and it gave me some ideas to think about which is what you hope for when you go to a TED event.

I’ll definitely be keen to go to a 2017 event if one happens.

Today I learned

Day 2 of Winchester Science Festival 2016. It’s an awesome event. If it happens next year: go!

A few random facts that I learned today:

  • The average time between a rabbit being bought in a pet shop and it being taken to a rescue centre is 6 weeks but they live 8-10 years. 
  • Rabbits make two types of poo – one (soft) designed to be eaten – they digest their food twice.
  • I saw an amazing video of a  rabbit attacking a snake.
  • Quite how quickly atmospheric CO2 is rising ‘The pump handle graph
  • In 1800 the UK had a life expectancy of about 40. It was even lower in almost all other countries.
  • At this point we’ll need to do carbon capture (BECS) to keep climate change to 1.5C
  • Deadly Nightshade is called Belladonna (‘beautiful woman’) because the berry juice was applied with a feather to dilate ladies’ pupil and make them look more attracted to a partner. The active ingredient atropine causes hallucinations and larger doses ~1 berry causes death.
  • Botulinum toxin (botox) is one of the most toxic things known to mankind. A pint could kill all living humans. Lethal dose is 1 nano-gram.
  • The placenta has viral DNA, what makes us mammals are genes captured from viruses: Mammals were made by viruses
  • ‘Unqualified’ volunteers have analysed images on the GalaxyZoo website and discovered type Ia supernova which are a ‘standard candle’..which help is measure the distance to other galaxies. You can volunteer time to help a number of science projects at the Zooniverse.

The Zooniverse talk was really inspiring, I’ll definitely be having a play!

A QuickStart guide to PubSub with IBM Internet of Things Foundation (sample C client)

At work, I’ve been working with IBM’s recently launched Internet of Things Foundation (IoTF), both on MessageSight (the underlying MQTT server) and other odds and ends. IoTF allows you to quickly start doing simple pub/sub via the MQTT protocol without even having to register yourself or the apps/devices doing the publishing or the subscribing, you configure apps to connect and messages can immediately start to flow for free.

As MQTT is used as the protocol you can use pretty much any programming language (including but definitely not limited to: Javascript, python, Go, C or Java). As an old-skool C hacker I often default to C and I forget the format for the id the publishers and subscribers need to use. To get started with a sample C app you:

  1. Download the Paho MQTT C client
  2. Extract the libraries (or “make” if you used the source, Luke)
  3. Build the samples (Unless you built the libraries and got it to build the samples at the same time (see README.md))
    1. gcc stdinpub.c -o stdinpub -I../include -L ../lib -lpaho-mqtt3c -Wl,-rpath,../lib
    2. gcc stdoutsub.c -o stdoutsub -I../include -L ../lib -lpaho-mqtt3c -Wl,-rpath,../lib
  4. Setup a subscriber:

    ./stdoutsub 'iot-2/type/jonexampletype/id/device1/evt/+/fmt/+' --host quickstart.messaging.internetofthings.ibmcloud.com --clientid 'a:quickstart:jonexamplesubber' --verbose
  5. In another terminal start a publishing app:

    ./stdinpub iot-2/evt/status/fmt/json --host quickstart.messaging.internetofthings.ibmcloud.com --clientid 'd:quickstart:jonexampletype:device1' --verbose
  6. Send some messages by typing them into your publisher (as we are publishing on a topic that claims to be JSON a simple example message might be:

In this example, the samples are linked to the classic, simpler, synchronous C library, in the same Paho bundle you get other (more powerful) variants, see the README.me for more details

A key to the colours used above:

  • Device Type: The type of device publishing, you can make it up and use it to group your devices
  • Device Id: The id of the device publishing, you can make it up. You need the combination of devicetype:deviceid to be unique across all devices connecting to quickstart… when a “duplicate” device connects, any existing devices with the same type:id will be disconnected
  • Event Type: The category of messages being published, again you can make it up. In this case, the subscriber used ‘+’ which means any event type.
  • Message Format: The format of the messaged published. You can make it up but JSON is special, in quickstart you can visualise data from devices published in JSON format and for registered devices, JSON messages can be recorded by the IoTF for future use
  • Application Identifier: Identifies the application, needs to be unique as duplicates are disconnected in the same way as mentioned in the Device Id: above.
  • Organisation:See below

In this example we were using the quickstart organisation which allows you to get going quickly. You know you that won’t be charged (or contacted by a sales person) as you haven’t given any contact details. After the initial thrill of getting going quickly, there are downsides – the device/application client identifiers have to unique across everyone using quickstart and there is no security for your data. Once you’ve taken your first steps you probably want to register – depending on your needs it can be as cheap as free, but it gives you e.g. access controls, security and the ability to log published messages in the cloud.

I plan to eventually do equivalents of this posts for other languages (and possibly with a registered account), let me know in the comments if there’s something you want covered.

Problems with Qt Creator installed in /opt

I’ve been doing a bit of fiddling with using Qt for developing mobile apps. When I installed the Qt SDK I installed it to /opt. This means the user running the IDE does not have write access to the IDE which has caused a number of problems.

  • Updating the SDK: If you run the SDK as the normal user, the “Help > Start Updater” menu option still exists and appears to work. It seemed to detect that I had sudo access and asked for my password but then hung using 100% CPU. Instead of using that menu option, I ran /opt/QtSDK/SDKMaintenanceTool as root which works.
  • Running the QEMU phone emulator: This failed with “Qemu finished with error: Exit code was 1”. To fix this, I ran QEMU manually:
    /opt/QtSDK/Madde/bin/mad remote -r dfl61-harmattan_2.2011.39-5 poweron -fg
    This showed I needed write access to the qemu disk images. As I’m the only user on the system*, I gave all users access:
    chmod a+w /opt/QtSDK/Madde/runtimes/dfl61-harmattan_2.2011.39-5/arm-qemu-rm680-*

Hope this helps someone stumbling across this via Google

* = Yeah. There was no need to install Qt into /opt – it just seemed tidier than putting it in my home directory