Creating a wireless Pi-LITE from a XinoRF and LoLShield

January 2, 2017 at 11:22 pm (computers) (, , , , )

I have a few of the neat 868MHz radio modules from, what I still think of as, Nottingham based Ciseco (who became WirelessThings, who got acquired and then unfortunately ceased to be).  These are really simple serial-to-sub GHz radio modules that were available in a range of form factors based around their SRF module.  I particularly liked the RasWIK kit, which made a wireless link between a Raspberry Pi and their Arduino-based XinoRF board absolutely trivial using their Slice of Radio daughter card for the original RPi.  It came with components and tutorials to get you started with simple wireless I/O.  I also supported their kickstarter for the very easy to use SRF Shield for the Arduino and before that for the Pi-LITE.

You can still find some documentation for their modules on GitHub, under Ciseco and later WirelessThings, but most of the information about their modules seems to have disappeared with the company.  It isn’t even in Google’s cache anymore and didn’t mirror the site due to their robots.txt configuration.

If you are interesting in sharing what you do know about the modules, then there is an OpenPI Google Group where people have come together to share what information they have about the Open PI product aimed at simple wireless sensor applications.  I’ve also managed to track down as much as I can myself from the far-flung corners of the Internet, so I’m still able to tinker with their modules.

One product that was fun to use was the Pi-LITE, a Raspberry Pi GPIO board (for the original Pi) that had an on-board Arduino controlling a matrix of 126 LEDs.  It even made TheRegister.  It is basically an implementation of Jimmie P Rogers LoLShield for Raspberry Pi.  They also provided a LoLShield themselves for the Arduino alongside a version of the original LolShield library.

The Pi-LITE has a simple serial-port interface that displays anything you type as scrolling text on the LEDs. You can also send commands to set pixels as required.  You can run the Pi-LITE code on an Arduino with a LoLShield and poke it via the serial port, so I wanted to see if I could combine it with a XinoRF and get a wireless link running to it.

2017-01-02 18.40.54.jpg

The XinoRF is basically Ciseco’s Arduino Uno clone with a built-in SRF radio module.  This means that if you enable the radio (by setting D8 HIGH) then anything sent over the serial port automatically gets sent over the SRF radio too.  So if you have another SRF radio at the other end, e.g. the Slice of Radio module for the Raspberry Pi, or the SRF Stick USB for a PC, then you should be able to send commands to the Pi-LITE too.  But there are a few problems getting to this point, due mainly to the unavailability of the Ciseco documentation now, and due to the fact that the original LoLShield, on which the Ciseco board is based, is hosted on a site that Google tells you is hosting malware.  So information was a little hard to come by!


  • The USB SRF Stick apparently has a driver, yet any site still selling them links back to the original Ciseco site, which is no more.  Solution: turns out Windows 10 is quite happy with recognising the CC1110 USB interface supported by the SRF Stick as a serial port.  If this had failed, I was going to try to find a copy of usb_cdc_driver_cc1111.inf, which seems to be all the actual “driver” really consists of.  I betting on this being a generic TI CC1110 device driver or something and google does return a few of them kicking around … your mileage may vary on this one – as I say, I didn’t need it!
  • A key tool for talking to and configuring the SRF Stick, or in fact any SRF based radio, is the XRF Configuration Manager tool from Ciseco.  Again, their site is no more, and whilst the XCM source is available on GitHub, the tool itself is not.  S0lution: As luck would have it, at the time of writing, there is still a live download link on the original ciseco site for this, see:
  • The XinoRF uses the UART and D8 to control the radio.  What is the LoLShield using and will they clash?  It is hard to find out as all implementations of this shield from Ciseco, Adafruit and others all refer to the original apparently-malware-ridden site.  Solution: using a web2pdf converter, I was able to read the original design documentation and schematic and found that yes, the LoLShield using Charlieplexing for the LEDs, does use all digital pins apart from 0 and 1 (the UART) so there is a clash with D8.


  • Is there an alternative to using D8 to control the radio on the XinoRF?  Well there is very little that I’ve been able to find about the SRF configuration and XinoRF, but there was an obscure reference in an index file of an archive site that captured snippets of a bit of discussion about this from the original forums:

“Pin 8 conflict –
Hi It s possible to move the radio enable pin from pin 8 to another pin youll need a soldering iron Looking at mine I think it s the RF EN pad I cant find mention of it in the docs and I m not familiar with how Matt do you know what the procedure is Hi On our shop advert is the link to the schematic hope this helps.  Hi Does that imply that the XinoRF won t work with your LED Matrix Shield I went through the docs for the shield before ordering one today and there it said Arduino R3 and Xino but looking at the rest of the docs it seems pin 8 would be required for it as well Does the documentation refer to an older Xino model then.  The LED Matrix docs will be talking about the Xino Basic not the XinoRF You can modify the XinoRF s radio enable pin to use something other that pin 8 Just to the left of the ATMega chip are two gold pads under the RF EN label Between the pads is a very small trace cut this with a Stanley blade use a continuity meter to check that there is no connection between the pads Solder a length of wire to the”

I doesn’t complete the sentence however.  The XinoRF schematic shows this RF-EN tag, which connects D8 from the Atmega328 to the SRF module via a resistor:


And this can clearly be seen on the board:

2017-01-02 18.41.50.jpg

Solution: break the link between the tag as hinted in the forum post and solder a link wire to the left hand side (SRF-side) to connect to a stray +5v source on the board somewhere else (e.g. the IOREF pin or +5v from the ICSP header).  This will enable the radio by default.  Even though the SRF is a 3.3v module, the tags are on the 5v logic Atmega side (and from what I’ve read, the CC1110 has “5v tolerant” I/O pins even though it uses 3v power?  Not totally sure about that and haven’t dug out the data sheet to check, as it doesn’t seem necessary in this case anyway as in use, the tags can be measured as +5v regardless).

2017-01-02 21.18.15.jpg

At this point, downloading the Pi-LITE Arduino sketch to the XinoRF and plugging in the LoLShield is all that is required to get a wireless Pi-LITE.  To test, I used the serial monitor from the Arduino IDE to show what the XinoRF is doing directly using serial-over-USB, and I used the XCM serial monitor via the SRF Stick to show the same is happening over the wireless serial link.

Attached is a copy of the Pi-LITE users guide (B040 PiLite User Guide.pdf).  I’ve collected a number of documents about the Ciseco radio products, from cached or archived versions of their pages or from old ‘saved webpages’.  Hopefully some of this information will resurface over time.  It would be a shame to lose it.



Permalink Leave a Comment

Updating Windows Update when Windows Update Won’t Update

December 21, 2016 at 9:39 pm (computers) (, , , , )

I’ve recently picked up a reconditioned Acer Iconia W510 Windows 8 Tablet PC with a docking keyboard, and to be honest, I actually quite like it.  But it is proving a bit of a trial to get going.

First, I found that it wouldn’t activate or start updating at all.  No matter what I did, it wasn’t happy.  Reading that Windows 8 is no longer supported, and I’d have to update to Windows 8.1, I looked for it in the Windows store.  But it won’t install from there without a pile of recent updates being installed first, but updates were having problems too.  Worried that I might have to reinstall from installation media, I set about looking for the Windows Product Code, but it was nowhere to be found.  Nothing on the box, nothing on the device, nothing with the installation and recovery media.

It turns out that many modern devices just come with a Windows Product Key in the BIOS itself.  There isn’t an obvious way through the standard Windows interface to find out what it is either. It might be in the BIOS, I don’t know I didn’t get that far.  This simple utility from nirsoft will dig out any product keys on a running system and tell you what they are.

Before all the pain of a reinstall though, I wondered if Windows Update might kick the activation off, so tried that a last time.  But that was still failing consistently with error 80072F8F.  Apparently you might get this if your PC clock is too far out of sync with Microsoft’s update servers.  Sure enough, even though the time and date were correct, the year was 2012 not 2016.  Fixing that kicked off both activation and updates, so all was looking good.

Sure enough, post first bought of updates I could now install Windows 8.1 from the Windows Store, which went through successfully.  I did wonder about skipping ahead to Windows 10, but Microsoft now want around £90 for the upgrade, which is a bit mad on a device like this.

At this point though, I soon hit another problem.  Windows Updates kept stalling permanently “checking for updates”.  There isn’t a clear “this is how you fix this” on the Internet, but the general Wisdom seems to be that there is an issue with high CPU usage and hangs of the Windows Update service on Windows 8.1 that needs the Windows Update service components themselves to be updated.

So, in short I tried all the following to no avail:

  1. Just leaving it running.  Some people suggest it might perk up after 20 hours.  Some say leave it 24 hours.  I left it running for around 30 hours (after realising I needed to change the power settings to stop the device auto sleeping after 10 minutes) and still nothing.
  2. Resetting Windows updates by stopping bits, wuauserv, cruptsvr; renaming the c:\windows\SoftwareDistribution directory; running the Troubleshooter to Troubleshoot issues with Windows Updates; then rebooting.  No effect.
  3. Tried booting into safe mode to see if that helps.  Note to self: Before trying Safe Mode for a Windows tablet, check that the docked keyboard and touch screen will still function when in Safe Mode.  For the Acer, they only way to interact with it was via an external USB keyboard (using the micro-USB socket too)!! Doh!
  4. I found that KB3102812 claims to fix it, but this relies on installing KB2919355 which itself seems to rely on KB2919442.  Downloading and running these separately invokes the wusa.exe executable, but this too hangs on the “searching the PC for updates” stage.  I left one of these going for around 6 hours.
  5. During the course of my travels I also stumbled across KB2950153, which describes a problem with wusa.exe freezing, but once again trying to install this isn’t trivial without wusa.exe which itself still hangs.  At this point I was running the Performance Monitor to spot disk activity and sure enough you can see the svchost hosting the Windows Update service trawl through the SoftwareDistribution area, updating logs, caches, db files and so on – but eventually all disk activity just stops and the check is still not complete.
  6. Next on the hitlist was finding a way to install an update manually without relying on the Windows Update GUI or wusa.exe.  One promising avenue is the PSWindowsUpdate module for PowerShell.  This gives  fairly comprehensive access to Windows Update from PowerShell.  Following the instructions here, but using the Get-WUInstall -Verbose command to see what is actually going on, this never seemed to get past the “Trying to connect to Windows Update Server” stage (I tried with both -WindowsUpdate and -MicrosoftUpdate options).

Finally, before seriously considering a reinstall, I looked up any other way possible to install a Windows update without needing wusa.exe.  Eventually I found this site which shows how you can expand a .msu file and use Pkgmgr to install the .cab file directly.  Now this is not without its risks – this is bypassing all the good configuration and dependency management that the Windows Update service does behind the scenes, but things were getting desperate.

To be sure, I started looking at the versions of some of the files on the system, so I could which updates might already be installed.  I was looking at the version of wusa.exe and wups2.dll files in c:\windows\system32.  From what I could see, I think I must have already included the two dependent installs from KB2919422 and KB2919355, so I figured I might be able to get away with installing KB3102812 directly, which is supposed to fix the performance issues.  As I say, this is not without risk, but the chances were looking good that if I could just force the update of the Windows Update Service, I might be on to something.  So the steps eventually were:

  1. Check versions of the files to give some assurance that older, dependent service updates where probably already included in my Windows 8.1 installation.
  2. Download the (in my case) x86 version of KB3102812.
  3. Open a command line (using the “Run as Administrator” option).
  4. run the following commands:
cd \Users\me\Downloads
mkdir temp
expand -f:* “Windows8.1-KB3102812-x86.msu” temp
cd temp
start /w Pkgmgr /ip /

This took a few minutes, but eventually looked like it had done something and told me I had to reboot to finish the installation (after also telling me that use of pkgmgr was deprecated).  Sure enough, on rebooting I got the familiar “Configuring Windows” display and once running again, I could see from the dates in the c:\windows\system32 that quite a few Windows Updates related files had been updated.  Curiously not wusa.exe though …

At this point, I ran Windows Update as normal, whilst watching disk activity again using the Performance Monitor, and yes, after quite a few minutes, it finally declared I had 213 updates to install and proceeded to download and install them.


Fingers crossed, this has now got me up and running and past the irritating, Microsoft-acknowledged bug, that exists in Windows Update for Win 8.1 that, infuriatingly, they only seem to provide a fix that requires installing via said problematic Windows Update.  Talk about chicken-and-egg!

Update on the updates: once all 213 were installed successfully, there were 7 additional updates and 10 optional updates. Thought I’d get it fully up to date so selected all 17. Turns out that one of the optional updates causes a perpetual shutdown-reboot cycle.  Also turns out that it is nigh on impossible to use F8 on a Windows 8 PC to enter safe mode – hence I guess why you set it using msconfig.  Thankfully I was able to use the Acer boot menu to start the troubleshooter and restore from a system restore point. Unfortunately it was the restore point prior to the 213 and the manual fix … Off we go one more time then … But really, an update that shuts down before you can even type CTRL-R msconfig?  Really Microsoft??  Moral of the tale-once it’s running ok, create a manual restore point and create a system image backup pretty quickly!

Update on the update on the updates: Of course Microsoft removed the backup and restore options from Windows 8 that let you create a system image so you have to use the command line wbadmin tool …



Permalink Leave a Comment

Long playing for 1000 years

December 10, 2016 at 6:29 pm (computers, music) (, )

I first stumbled across the Longplayer project when I saw a mention of their Longplayer for Voices on Kickstarter.  Then I completely forgot about it until Christian Payne (Documentally) mentioned that he’d caught up with the originator of the project on his long-form, email newsletter, ‘Backchannel’ at which point I looked it up again.

The project is great – a very long-term musical project (a bit like As Slow as Possible) conceived and composed by Jem Finer.  The one line summary is that he has recorded a sequence of music for some ‘singing bowls’ and the project combines various processed versions of this 20 minute piece in a range of different ways, resulting in a piece of music that will play continuously for 1000 years without repeat.  The long version can be found on the about page for the project (its worth a read).

To listen along, there is a live stream available from the website or listening stations in a couple of locations in London and San Francisco.  There are a series of live performances too where players play extracts of the piece.

And more recently there is now an iOS app that uses the same 20 minute piece, the same time-driven algorithm and a sense of shared time via the Internet to make the app play exactly the same part of the music available in the physical spaces and via the web.

The ‘score’ is a simple representation, with six concentric rings showing the sounds in six variations of the 20 minute piece.  But the algorithm behind Longplayer will play each ring at different speeds – with one of the rings taking 1000 years to complete.

There is a visual representation of the score with an indication of which part of each ring is currently playing.  This is available via the web and the iOS app.  The following show four stages of the app over a 24 hour or so period.

Notice how the second ring progresses the quickest, but some of the others hardly at all.  The third ring is the 1000 year ring, so over 24 hours there is no movement at all

2016-05-06 21.00.352016-05-06 23.15.362016-05-07 06.15.482016-05-07 13.13.332016-05-07 17.27.24

A great app, a great project and fascinating music!



Permalink Leave a Comment

Custom Blockly Block “does not know how to generate code”

March 8, 2016 at 10:56 pm (computers, kids) (, )

I’m playing around with my Espruino board (embedded board, programmed with JavaScript) as part of my quest to find a kid-friendly embedded controller.  One of the nice things about Esruino is that it comes with a Web-based IDE that provides a terminal console that allows you to write JavaScript directly onto the board or allows you to programme it using Blockly.

I want to write some custom blocks, so downloaded the source for the EspruinoWebIDE and did the following:

  • Created a new file “EspruinoWebIDE\blockly\blockly_myfile.js”
  • Included this file in a SCRIPT tag in the top of “EspruinoWebIDE\blockly\blockly.html”
  • Proceeded to create my blocks – initially as defined using the Google BlockFactory and then added to blockly.html to present them in the UI

There are already a few files defining extra blocks – blockly_espruino.js is the main one and blockly_robots.js is a simpler one, that actually makes quite a good example to follow if you are doing your own.

The basic idea is that there is a ‘toolbox’ definition for your block in the blockly.html file (which makes it appear in the menu of blocks in the user interface), supported with a block-definition file detailing the physical appearance of the block and what it needs to connect to within the user interface (Blockly.Blocks.mycategory_myblock) with an accompanying code-generation block.  In this case, generating JavaScript via Blockly.JavaScript.mycategory_myblock that uses the Blockly API to get what it needs from the user interface and returns a string that contains the corresponding generated code.

There is a setting in the EspruinoWebIDE – Settings->General->Overwrite JavaScript with Graphical Editor – which is quite handy at this point, as it means that every time you hit ‘Send to Espruino’ in the graphical editor, the JavaScript window is updated with the generated code.

Except when it isn’t.  There were no obvious errors, and the ‘Send to Espruino’ always said ‘Sent’ but there was no outward sign that anything had happened.

If you use the Inspect option of the Chrome browser then it was apparent that there was a JavaScript error:

Language “JavaScript” does not know how to generate code for block type “mycategory_myblock”

This hidden message indicates that there is a miss-match between the Blockly.Blocks.mycategory_myblock function and the Blockly.JavaScript.mycategory_myblock function and even though the block is available through the user interface, Blockly doesn’t know how to generate code for it.

Except in my case, no matter how it was written, generated, typed or checked, it was ignoring my code and I just could not spot what the error was.  Eventually, I changed the order of the SCRIPT statements in blockly.html, wondering if there was some kind of load-order issue and it suddenly started working.  Once I changed the order back again, it kept on working – so unfortunately I have no idea what was causing the problem, but just guessing some weird local caching issue or something not picking up my changes.

But if you are finding things aren’t working but there are no visible errors, definitely try Inspect and look for JavaScript errors and see if you can somehow force the application to re-load all files from scratch to make sure you aren’t working with an old version or something similar.  I still don’t know why it started working, but at least it works now.

The only reason I’ve written this is that Googling for various hints as to what might cause the issue was failing me – even once I knew what the error was.  So thought I’d write it down myself in case others have a similar issue – this might give someone else a clue.

Despite this rather irritating issue, I actually quite like Blockly.

In a future post, I’ll talk a bit more about what I’m actually doing with all this.





Permalink Leave a Comment

Codebugs, Glowbugs and DIY Tails

February 20, 2016 at 11:21 pm (computers, kids) (, , , , )

We got a couple of Codebugs just before Christmas and have been having quite a good time playing with them so far.  You write code for them using an online IDE based on Google Blockly and the device itself has two buttons, a 5×5 grid of LEDs and 4 GPIO ports with nice croc-clip friendly contacts on it so you can straight away start playing with linking code to the physical world.   It also has an expansion connector (the ‘Tail’) and when you connect it to a PC via USB it comes up as a mass storage device and you drag code across to it to run it.

We’ve done the obligatory “scroll your name” across the LEDs, hooked up fruit to create a fruit ‘touch’ keyboard and have started exploring some of the projects available via the online community.

My only slight gripe is that the mechanism for getting code on it isn’t quite as intuitive as it might be.  We’ve largely got the hang of holding buttons down whilst powering it up.  although, when trying out code, it tends to stay plugged in, so we use the ‘reset’ then ‘hold’ technique designed for when it is powered by battery most of the time.  However sometimes the buttons aren’t held quite long enough for it to register.  Also, every time it comes up in mass storage mode, the previous programme is erased.  If you are not careful you end up with lots of “compiled” Codebug programmes lying around your browser’s download directory.  Seeing as all projects are managed by the online IDE it would be nice if there was a neater way to send the code straight to the Codebug without copying between directories.

That aside, its a great device and has generated lots of interest with the kids and I’ve recently purchased a set of Glowbugs.  These are WS2812 based RGB LEDs with simple croc-friendly (of course) contacts that you connect to the Codebug using the GPIO, configure and off you go.

For our next project however, we quite wanted to use all 4 GPIO as inputs and I know that the Glowbugs can be driven directly via the expansion header, so I set about seeing if I could create a DIY ‘tail’ connector to breakout the CS, +5v and GND connectors, as used by the Colourtail, to something that would accept croc clips.

I also have a cheap, purchased from China, 24-LED WS2812 pixel ring with the same +5, GND, DIN, DOUT interface as Neopixels and the Glowbugs that I wanted to use.  I’ve already connected this up via the Codebug Tail, but again wanted something croc-clip friendly that the kids could use.

So armed with a 20x80cm prototyping board and some right-angled headers, I set about making a simple DIY tail adaptor and connector for the LED ring.  Warning – massively dodgy soldering coming up.


As a major goal was to make this easy for the kids to use, I wanted the connectors to break out in the same order as the Glowbugs – so (with all boards face down) this means from left to right, GND, DIN, +5v.  However the tail connectors are CS, GND, three not required for this application, and VCC, so I needed a wire link to get CS (for the data) from the left-most pin to a central spot.


With a small portion of board cut and smoothed ready for headers, I decided to use crude solder blobs as a simple way to create croc-friendly pads and connections, as can be seen via the very dodgy soldering going on in the following!  In case you can’t quite make it out, the ‘circuit’ is highlighted in the last pic.


So after adding another three ‘pads’ on the other side, the final thing looks like this.


In order to be able to easily use the LED pixel ring, I decided on a similar approach to add some ‘pads’ to the ring.  Once again I wanted the pads in the same order as a Glowbug.  I could have added both an ‘in’ and ‘out’ connector, but decided for simplicity only to create an ‘in’ – so the ring will always be the last thing in the chain.  In the following, the wires are coloured as follows: green is GND, blue is DIN and red is VCC.


The biggest problem with just connecting the pixel ring directly to the Tail connector was the poor physical connection of the wires to the ring itself, so this time to give it a degree of kid-robustness, I used a hot-glue gun to stick the pads to the ring and protect the solder links.


With a final blob of glue over the top of the solder connections to the ring, everything is ready to go.


So to use the Glowbugs connected via the DIY tail, you have to use the configuration blog to enable the ‘Colourtail’ rather than ‘Glowbug’, but otherwise, everything else is just the same.  And of course, the ring is just treated as a set of additional 24 Glowbugs added on the end of the chain.

So crude, and soldering that will definitely not be winning any prizes, but it works, and passes first contact with the kids.




Permalink Leave a Comment

Severe consequences of losing your data?

February 5, 2016 at 5:09 pm (internet, kids, moan, security) (, , , , , )

I read this article from TheRegister with mild interest:

“Medical Data Experiment goes horribly wrong: 950,000 records lost” –

Ok, so yet another ‘company loses personal data, warns as a precaution’ story.  In this case, six hard disks apparently containing personal health information of around 950,000 people.

So my initial thought was something along the lines of “are people really misplacing whole hard disks still in 2016”?

Personally, I suspect it is more likely an accounting problem rather than a physical loss – they are probably labelled up wrong, or left in a drawer somewhere, or have been re-used and nobody noticed, that kind of thing.  But it is interesting to look at the phraseology of two consecutive press releases from the company involved (no, I’m not quite why I looked them up either – but I did!).

On the data loss:

Centene Announces Internal Search of Information Technology Assets

“Centene has determined the hard drives contained the personal health information of certain individuals who received laboratory services from 2009-2015 including name, address, date of birth, social security number, member ID number and health information. The hard drives do not include any financial or payment information.  The total number of affected individuals is approximately 950,000.”

Fair play – they are admitting their mistake and attempting to do the right thing:

“Notification to affected individuals will include an offer of free credit and healthcare monitoring. Centene is in the process of reinforcing and reviewing its procedures related to managing its IT assets.”

Otherwise, without openness and honesty around such issues, how can lessons be learned?

But the following day, the next press release announces their financial results for the year:

Centene Announces Preliminary 2015 Financial Results

“On January 25, 2016, the Company announced an ongoing comprehensive internal search for six hard drives that are unaccounted for in its inventory of approximately 26,000 information technology (IT) devices.  This incident resulted from an employee not following established procedures on storing IT hardware.  While we cannot estimate the impact with certainty at this time, the Company does not expect the impact of the incident to have a material effect on its future growth opportunities, financial position, cash flow or results of operations.”

Yes – they don’t expect the fact that 950,000 people’s personal health details going missing will affect their financial position now or in the future.

I guess that answers the question of why it is 2016 and companies still lose whole hard disks of personal information.  If there is minimal financial impact, it is good business sense for them to keep their procedures at the minimum deemed necessary – that is just sensible business risk-management.   In fact the whole ‘free credit and healthcare’ monitoring could be seen as a cost effective insurance policy against possible loss should it occur, compared to the costs of labour intensive, fault-free asset management to prevent any chance of loss up front.

These things will only change when the impact of the issue impacts the companies involved much more significantly, rather than just ending up a problem for the people whose data is lost.

In the UK, I guess we have the Information Commissioner’s Office guidelines for handling data and ability to set fines, but even this misses the point for me.  A fine is after the fact and with so many charities and volunteer organisations (cough, Scout National database) storing personal details, a significant fine would end up burying an organisation and an insignificant fine is largely pointless.  But either way the data will still be lost.  So the answer to this one is really education – so to that end, the ICO Guide to Data Protection is great – but unless someone is actually auditing and proactively educating organisations, or perhaps more appropriately companies now selling online services to organisations, on these principles, I suspect we’ll keep seeing problems occurring.

As we see massive growth in companies providing online payment services (ParentPay, SchoolMoney, PaySchool and so on) information and content management (dbPrimary, Google for Education, etc), communications and mailing services (ParentMail, etc), biometric authentication (40% of secondary schools apparently), online learning, and so on to education and charities, more of our data ends up online regardless of the fact it might not be us putting it there!  For a cash-strapped organisation, managing an offline and online database isn’t going to happen.  You might not use their online system, but your data will be there as they’ll be using it themselves.

The school use of biometrics is particularly  worrisome – many kids may have their biometrics compromised before they are even old enough to decide for themselves if they want to hand over their biometric signatures to any company.

Fundamentally, at present, all the risk from a company storing your data is on you, not them.  Until that risk balance is addressed, I guess we will stay at the mercy of “bottom line (non-)impact” reporting.  And whilst it is convenient and cost-saving for organisations to use more of these online services, our data will keep being stored who knows where and there is very little we can do to stop the tide of information uploading.




Permalink Leave a Comment

How much? I could buy a computer for that!

January 18, 2016 at 9:17 pm (computers, internet) (, , )

First there was the C.H.I.P. – the $9 computer with built-in Wifi.  Then soon after that appeared on Kickstarter, the Raspberry Pi Zero came out – a $5 Raspberry Pi.  Ok, so strictly speaking you need a few accessories to really get them going as fully fledged computers as most people would recognise the term, but in these days of cheap computers, it made me think, just how does this compare with other ‘everyday’ items?

So, taking the “list price” for the Pi Zero, as £4 … that is:

Of course, these days, $5 will get you  a whole range of goods and services, including, according to Dave Gormon, 5000 Twitter followers!

And of course, as per the tweet that started the thinking behind this ramble … just slightly more than a 10 minute bus trip in Cambridge!



Permalink Leave a Comment

ArduBlockly and the Arduino Nano

January 2, 2016 at 4:33 pm (computers) (, , )

I’ve been wanting to find a scratch style interface for Arduino to see if I could do something simple Arduino and Lego wise for the kids.  We have a CodeBug (which is pretty good for learning basics of programming for LEDs and I/O – maybe the topic of another block post, but see if you are interested) which is programmed using a web-based environment based on Google Blockly.  We’ve also used Scratch, so these were my two starting points.

After some googling, I found ArduBlockly, ArduBlock BlocklyDuinoS4A (Scratch for Arduino) and Snap.  As far as I can see, ArduBlock doesn’t seem to be maintained at the moment, Snap looks like an enhancement on S4A and ArduBlockly looks inspired by BlocklyDuino.

Snap looks particularly interesting and I’ll take a look at that at some point, but I went with ArduBlockly as it has a ‘download and just run all-in-one’ installation.  As far as it goes, this largely worked quite well – the only problem is that at present, it doesn’t support the Arduino Nano, which is what I was hoping to use.

However, seeing as this is basically using a Python web server to serve the Blockly interface to a browser, and then using the Arduino IDE (at least v1.6) directly to interface with the hardware, I had a poke around to see if the Nano could be slotted in.  The answer is yes and no.

The ‘all in one’ nature of the beast means that the Python is compiled into something that just runs, so isn’t editable anymore.  However, if I was happy to install Python and use a browser directly, I could hack it about.

Note: the following will hopefully become redundant at some point as support for the Nano I’m sure will be forthcoming, but it is documented here for my own reference right now.

In order to add the Nano enough for me to start playing, from some googling and searching around on github, there are three files that appear to require editing:


In the ‘Arduino Board’ selection form, a new <option> is required whose value is ‘nano’.


There is a __Arduino_type array which needs to include

'Nano': 'arduino:avr:nano'

as an option.


This defines the properties for the different support boards, so an entry for the Nano is required.  This is largely the same as the ‘uno’ entry, but the Nano has two additional analogue pins.  This is unverified, as I’m not an Arduino expert (to use at your own risk), but I believe all that is required is to create an entry as follows:

Blockly.Arduino.Boards.nano = {
  name: 'Arduino Nano',
  description: 'Arduino Nano with ATmega328p board',
  analogPins: Blockly.Arduino.Boards.generateAnalogIo(0, 7),
  digitalPins: Blockly.Arduino.Boards.generateDigitalIo(0, 13).concat(
                   Blockly.Arduino.Boards.generateAnalogIo(0, 7)),

Then running the ArduBlockly application using the ‘’ script rather than the stand-alone ‘ardublockly_run’ batch file seems to allow me to use it with my Nano.

I was getting ‘Arduino Exit Code: 259’ as an error though, and something somewhere online suggested that the arduino_debug.exe should be used for the diagnostics from the command line, rather than your arduino.exe, so I updated the ArduBlockly preferences to use arduino_debug.exe and now I get a successful build and download.

Aside – I couldn’t get ArduBlockly to work in MS new browser (Edge), so I use it with Chrome, connecting to the local URL generated by the running Python script of http://localhost:8000/ardublockly/

(If I ever get around to getting GitHub going properly and assuming this is verified as the right way to add the board, I’ll submit it back).

I look forward to see how ArduBlockly develops, and do wish to try Snap at some point too (especially as at present, with the above hack for the Nano, it is no longer the simple ‘all in one’ application for installing on a PC that the kids could use).  However, it is early days for ArduBlockly development, and so far the signs are looking pretty good to me!



Permalink Leave a Comment


December 1, 2015 at 11:17 pm (computers, internet, music) (, , , , )

I wanted to do something with MIDI and Arduino.  I’ve just picked up some cheap Arduino Nano Ethernet shields, based on the Microchip ENC28J60, so thought I’d combine the two.  The ENC28J60 and a cheap Arduino Nano makes for a very compact and economical Ethernet ready microcontroller and I have a nice Roland MT-32 Synth module gathering dust that I wanted to try again.

2015-12-01 21.16.05

My initial idea was to use MIDI to trigger sounds based on arp requests received by the Arduino, (hence the name MIDI Arp), but then decided that on my home network arp requests wouldn’t give a lot of variation, so I decided to see if I could trigger on the destination IP address of any packet received.

First I needed the MIDI interface.  I followed the simple circuit and example provided on the Arduino website, but wanted it all self-contained inside a MIDI plug rather than on a breadboard, so I soldered up the 220 resistor inside a 5 pin MIDI DIN plug as follows (MIDI pins are number 1, 4, 2, 5, 3 for some reason):

  • Arduino GND – Brown – MIDI Plug pin 2
  • Arduino 5v – Red – 220 Ohm resistor – MIDI Plug pin 4
  • Arduino TX (Pin 1) – Orange – MIDI Plug pin 5

This was then connected to the Arduino and the MIDI test programme showed that all works fine.

2015-12-01 21.16.212015-12-01 21.19.13

So, to the Ethernet side of things.  The following is an excellent starting place for the ENC28J60 based nano shield:

After reading this, I decided to use the UIPEthernet library as my starting point as I liked the idea of a plug-in replacement to the standard Arduino Ethernet library.  There was two major things to work out – first, how to set the device into some kind of promiscuous mode, assuming it supports it at all; second how to grab the destination IP address from any received packets.

From the ENC28J60 data sheet, the key register that controls the receiver filtering is the Ethernet Receive Filter Control Register – ERXFCON (see section 8 ‘Receive Filters’).  There are a number of modes for filtering and the UIPEthernet library is set up to filter for the unicast address associated with the MAC address configured for the module, for broadcasts, and to use the pattern matching filter to spot arp packets.  It turns out that to set the receiver into promiscuous mode, this register just has to be set to zero.

Now this is where things got lazy.  I just dived into the UIPEthernet library sitting in my Arduino library folder and hacked about. I might tidy this up one day and do it properly.

The low-level driver code can be found in utility/Enc38j60Network.cpp.  In the Enc28J60Network::init function, there is a line that sets up the ERXFCON register:


This needs to simply be changed to clear the register:

writeReg(ERXFCON, 0);

Next, how to store the destination IP address.  Again, simplicity ruled this one too.

The high-level interface to the library can be found in UIPEthernet.cpp and UIPEthernet.h.  I added two public functions and two private variables to the UIPEthernetClass class in UIPEthernet.h:

  IPAddress lastSrcIP();
  IPAddress lastDestIP();
  static uip_ipaddr_t uip_lastipsrc;
  static uip_ipaddr_t uip_lastipdest;

Then in the UIPEthernet.Cpp file, added the code to store the last source and destination IP addresses from received packets.

First, define a structure to dig into to the IP header (a bit of a layer violation, but I wasn’t after neat designs really).  Add the following after the definition of ETH_HDR near the top of the file.

#define IPBUF ((struct uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN])

Then add two (static) global variables to the file:

uip_ipaddr_t UIPEthernetClass::uip_lastipsrc;
uip_ipaddr_t UIPEthernetClass::uip_lastipdest;

Add two accessor methods to retrieve the last source and destination IP addresses (with appropriate conversion to the Arduino Ethernet friendly IPAddress format):

IPAddress UIPEthernetClass::lastSrcIP()
  return ip_addr_uip(uip_lastipsrc);
IPAddress UIPEthernetClass::lastDestIP()
  return ip_addr_uip(uip_lastipdest);

Finally add the code to save the addresses to the UIPEthernetClass::tick() function, on reception of a packet.

          if (ETH_HDR ->type == HTONS(UIP_ETHTYPE_IP))
              uip_packet = in_packet; //required for upper_layer_checksum of in_packet!
              Serial.print(F("readPacket type IP, uip_len: "));
              if (uip_len > 0)
                // Extra code added here
                uip_ipaddr_copy(uip_lastipsrc, IPBUF->srcipaddr);
                uip_ipaddr_copy(uip_lastipdest, IPBUF->destipaddr);
                // Extra code ends

That should be all that is required to expose the destination IP address of any received packet via the UIPEthernet class (ok, breaking compatibility now with the standard Arduino Ethernet library).

The arduino sketch file now consists of the following:

MIDI based on

UIPEthernet Examples used for rest
NB: Requires hacked UIPEthernet Library!
#include <SPI.h>
#include <UIPEthernet.h>
#include "IPAddress.h"

int lastIP;
int thisIP;

// Initialise note array with whole tone scales in octaves 3 through to 6
// C3 = 36
// C4 = 48
// C5 = 60
// C6 = 72
// C7 = 84
#define NOTES 24
int notes[NOTES] = {
  // C3  D3  E3  F#3 G#3 A#3
     36, 38, 40, 42, 44, 46,
  // C4
     48, 50, 52, 54, 56, 58,
  // C5
     60, 62, 64, 66, 68, 70,
  // C6
     72, 74, 76, 78, 80, 82

void setup() {
  //  Set MIDI baud rate:

  // Initialise the uIP and UIPEtherent stacks
  uint8_t mac[6] = {0x00,0x01,0x02,0x03,0x04,0x05};
  IPAddress myIP(192,168,0,6);
  lastIP = 0;
  thisIP = 0;

  // Initialise patch using program change
  // 32 = Synth 1, Fantasy
  midiCmd (0xC0, 32);

void loop() {
  IPAddress sip = Ethernet.lastSrcIP();
  IPAddress dip = Ethernet.lastDestIP();
  thisIP = 256*dip[2] + dip[3];
  if (thisIP != lastIP)
    lastIP = thisIP;
    int note = (thisIP & 0xff) % NOTES;  // Scale to number of notes
    int vel  = ((thisIP & 0xff00) >> 8)/4;        // Scale to val between 0 and 64

    //Note on channel 1 (0x90), some note value (note), middle velocity (0x45):
    noteOn(0x90, notes[note], 16+vel);

//  plays a MIDI note.  Doesn't check to see that
//  cmd is greater than 127, or that data values are  less than 127:
void noteOn(int cmd, int pitch, int velocity) {

void midiCmd(int cmd, int val) {

The final byte of the IP address determines which note from the array of notes to play (modulo the number of notes) and the third byte determines the volume to be used, scaled and with a minimum specified.

There is a control message to set the voice on the MT-32 to Synth1-Fantasy as this sounds suitably ambient. There are no note-off messages, so notes are allowed to keep ringing. As the note array defines four octaves of whole tone scales, the running-on notes create quite an interesting effect.

2015-12-01 21.40.12

There seems to be a regular drone set up, which I think is due to the IP address of my PC and router. These two addresses provide a sort of default back-drop of sound to anything else going on.

In order to get anything useful though, it would be no good just using a port on the router, as even the dumbest, cheap modern router will tend to do some MAC level filtering on ports. I had a laptop and the Arduino plugged into an old Netgear En104 4-port Ethernet hub, which has no intelligence (as far as I know) built in – so the Arduino could see everything coming out of the laptop.

The results were quite pleasing. Google has a nice enhanced drone to it. You can really hear the clutter of a site that is pulling in ads from all over the Internet – such as Amazon or YouTube or a news site.

Edited to add:  Here is a short video below showing them being opened.  It’s a bit crude but you get the general idea.

 Maybe next, I’ll see if I can do the same with a Wi-Fi link for the Arduino instead of wired Ethernet.  It might also be worth trying different scales and alternative mappings of notes to addresses.


Permalink Leave a Comment

The Real Price of Internet Advertising?

October 2, 2015 at 9:19 am (internet) (, , , , )

I’ve been following some of the discussions about ad-blocking with interest.  I’ve now seen a number of comments from a range of sides on this one and am continually being surprised by some of the attitudes and opinions starting to appear in this arms race between blockers and advertisers.

Some of the facts and opinions that have surfaced that surprised me are:

  • Advertisers can buy their way out of ad-blocking.  So are advertisers now having to pay twice to advertise?  Kind of.  Or are ad-blockers positioning themselves as ‘guardians of the web’.  Kind of that too.
  • Blocking ads hurts the small people more than the big people.  Small businesses or creators or hobbyist event organisers and so on are the people losing out with ad-blockers.  The large providers will probably ride over much of this (or pay their way out) but these are the people whose enterprises (commercial or personal) are being enabled by the global reach and scale of the Internet, but it may all become fully cost ineffective if cheap, simple, high-reach advertising channels disappear.
  • Some websites are actively degrading their user experience for visitors using ad blockers.  The Washington Post apparently has experimented with not allowing articles to be viewed if you turn off ads.  And Google was removing ‘skip ad’ options for viewers of YouTube videos running Adblock Plus.

Why do people use ad blockers?  Well I suspect that many don’t mind adverts in the more general sense.  I’d say Ad blockers are arguably a blunt instrument deployed against anti-social, exploitative and intrusive adverts.

I regular get annoyed with in-your-face popups in front of an article I’m trying to read.  Is this a design failure on the part of the site to catch my attention by more subtle means?  Is it taking advantage of a captive audience?  Not sure., but that is a good reason for ad-blocking if the industry can’t regulate itself better.  And the drive for more intrusive ads is increasing – especially with more automatically playing video ads and the like on mobiles.  It is not want you want or when you want it.  End of.  That does not win friends or makes people warm to your products.  Maybe it is time for more obvious ‘commercial breaks’ in Internet use rather than a constant drip-feed of annoyance.

I also find it insulting when ads are designed to trick and fool you into clicking.  Whether that is placing link buttons right next to close X icons, especially successful on small screens I assume.  Or the plethora of ads that include the words ‘download’ as very visible buttons when you are attempting to download a document or software from sites such as sourceforge. Or maybe it is just in the general placing of ads so as to maximise accidental clicking. If the revenue is based on trickery, subversion and relies on accidental clicking/swiping/selecting to survive … then that is an industry in trouble indeed.

But the major reason right now for utilising ad blocking for me is as a defence against malware.  I regular read the detailed analysis published by a range of security vendors on how they’ve uncovered a complex malware serving system taking advantage of some of the large-scale advertising networks.  The bidding and auctioning processes for serving ads, coupled with many levels of redirection and URL shortening, and linked with content-delivery networks, not to mention links off to marketing and tracking databases, has created such a complex set of third party dependences for even the most trustworthy of websites that no place seems safe anymore.  Yes, you patch, keep plug-ins up to date, run AV checks, but it must surely be impossible to keep a PC clean of unwanted software these days and a major vulnerability is exposure to ads on sites you use and trust everyday.

Do I mind about the tracking?  Well again it depends. If done sensitively, then why not – there are benefits to seeing things of interest.  But I have no faith in such a lucrative business acting in the interests of us, their users – their ‘product’.  We have not opted-in to the use of free services in exchange for privacy – at best it is a false-choice due to the overwhelming network effects and dominant positioning of the large Internet companies.  We all know they are very good at staying below the ‘creepy line’ in knowing about you and providing just enough usefulness to keep us hooked to their services.  But with more hooking up between online services and offline data brokers, and not even thinking about any kind of future Internet of connected sensing and data gathering devices, things only look like getting worse before they get better.

So whilst the ad blocking war continues, being played out as a warning of the end of free services for consumers if they all block ads – I think the real win situation can only be when some of the above are fixed – lose intrusive ads, keep consumers in control of when they click or not and not trick them, ensure ad networks can not compromise trusted websites, and support responsible tracking of consumers with real opt-in.

I think only then will the need for ad-blockers go away.  I don’t think ad blockers have ever really been about blocking advertising – they have always been about maintaining control over the exploitation of a consumer’s Internet experience.  And for that, they serve more the purpose of an anti-virus, pop-up blocking, privacy supporting, malware-prevention, PC cleaning tool to me.

And in a world where people still fall for telephone ‘Microsoft support scams’, still install rogue Facebook applications in the hope of gaining a Dislike button, and still believe they can change the world via a status update (or at least think it will keep their Facebook data being sold off or made public), the need for protection like this shows no sign of going away just yet.


Permalink Leave a Comment

Next page »