Sunday, 24 February 2013

Epileptic Seizure Detector (3)

I installed an accelerometer on the underside of the floorboard where my son sleeps to see if there is any chance of detecting him having an epileptic seizure by the vibrations induced in the floor.
I used the software for the seizure detector that I have been working with before (see earlier post).

The software logs data to an SD card in Comma-Separated-Values (CSV) format, recording the raw accelerometer reading, and the calculated spectrum once per second.  This left me with 26 MB of data to analyse after running it all night.....

I wrote a little script in Python that uses the matplotlib library to visualise it.   I create a 2 dimensional array where there is one column for each record in the file (ie once column per second).  The rows are the frequency bins from the fourier transform.  The values in the array are the amplitude of the spectral component from the fourier transform.
The idea is that I can look for periods where I have seen high levels of vibration at different frequencies to see if it could detect a seizure.  The results are shown below:
Here you can see the background noise of a few counts in the 1-7 Hz range.   The 13-15Hz signal is a mystery to me.  I wonder if it is the resonant frequency of our house?
Up to 170 sec is just me walking around the room - discouragingly little response - maybe something at about 10 Hz.  This is followed by me sitting still on the floorboard up to ~200 seconds (The 10 Hz signal disappears?)
The period at ~200 seconds is me stamping vigorously on the floorboard, to prove that the system is alive.
Unfortunately the period after 200 seconds is me lying on the floorboard shaking as vigorously as I could, and it is indistinguishable from the normal activity before 170 seconds.

So, I think attaching a simple IC accelerometer to a floorboard will not work - attaching it directly to the patient's forearm looks very promising, but not the floorboard.

I am working on an audio breathing detector now as the next non-contact option....

The code to analyse the data and produce the above chart can be found on github.  It uses the excellent matplotlib scientific visualisation package.

Wednesday, 13 February 2013

Epileptic Seizure Detector (2)

Update to add another spectrum...

I have been working on setting up the Epileptic Seizure Detector.  I tried wearing it for a while, and simulating the shaking associated with a tonic-clonic seizure.   Some example spectra collected on the memory card are shown below:
This shows that the background noise level is at about 4 counts.   
Wearing the accelerometer on the biscep gives a peak up to about 8 counts at 7 Hz, but it is not well defined.  
Wearing the accelerometer on the wrist gives a much more well defined peak at 6-7 Hz. (and it raised an alarm nicely).

I have also tried an ADXL345 digital accelerometer.  The performance is similar to the analogue one, but I think it may be slightly more sensitive.  Example spectra with the accelerometer attached to the biscep are shown below.  ONe is a simulated fit.  The other is a false alarm going down the stairs.  Not that much difference!


Therefore I think there is scope for this set up to work if it is worn as a wrist watch, but just attaching it to other parts of the body may not be sensitive enough.

I wonder if I could make a wrist sensor that is watch sized, with a wireless link to a processor / alarm unit?

Not sure if I will be able to persuade Benjamin to wear a wrist sensor though....Might have to think about microphones.

Saturday, 9 February 2013

Soldering onto Surface Mount ICs

I recently bought an accelerometer IC to use on my epileptic seizure detector project.  It is a tiny surface mount device as you can see below.
I gave a lot of thought to how to connect wires to it.  I did consider conductive glue, but it would be difficult to hold them all still for long enough for it to set, so I went back to solder.  This is how I did it...

1.  Mount the IC onto stripboard using apoxy adhesive:

2.  While the glue is setting, modify the soldering iron by wrapping some 1mm2 copper wire around the tip to give a very fine tip.  Use solder to increase the heat transfer between the wire and the tip:

3.  Tin the solder pads on the IC, using some very fine solder (I got some 32swg solder off ebay).

4.  Obtain some very fine copper wire (I disassembled some cheap alarm flexible cable, and used strands from that).

5.  Hold a strand of wire onto a solder pad, and touch it with the soldering iron to melt the solder and create the joint.

6.  Repeat for all connections:


7.  Route the fine wires to the copper tracks, and solder on.  I used the insulation from the original alarm  cable to prevent short circuits:

Fiddly, and not very neat, but it worked for me - it is being used in my prototype epileptic seizure detector.



Epileptic Seizure Detector (1)

Our son worried us a bit a couple of weeks ago when he had quite a nasty fit, so I have been thinking about making an alarm to warn a carer that a person in their charge is having a seizure.

There are a few different ways to do this that I have thought of:

  1. Detect Movement using an accelerometer
  2. Detect the sounds associated with the movement using a microphone
  3. Monitor the movement with a CCTV camera and use image processing to detect the abnormal movement.
I am trying option 1 (accelerometer) first, but am working on the CCTV approach in parallel by learning OpenCV.

Because our son is autistic, it will be very difficult to get him to wear a device, so I hope to detect movement through the floorboard where he sleeps, but this will be much less sensitive than detecting it directly.  Therefore, this first proof of concept version is working by attaching the accelerometer to a limb to see if I can get it working.  The issues with it are:
  1. We do not want false alarms caused by normal movement - I am addressing this by using a fourier transform to filter out only a range of frequencies of movement, in the hope that I can select the characteristic shaking of a seizure, but not detect too much normal movement.
  2. A quick shake should not raise an alarm, so to set off an alarm the acceleration in the appropriate frequency band should be more than a threshold value for a specified length of time (3 sec currently).  This will give a warning 'pip'.   If the shaking continues for 10 sec, it raises a buzzing alarm.
  3. Sensitivity will be a problem for detecting it through the floor - will need to work on that another evening.
The system uses an Arduino microcontroller, connected to a Freescale MMA7361 three axis accelerometer.   The accelerometer is a tiny (5mm x 3mm) surface mount device, so soldering it is a challenge - you can see how I did it here.
To enable data logging so I can tune it to get the frequency response, threshold etc. the arduino is also connected to a real time clock module and a SD card module.
The completed prototype is shown below:
The code is in my Arduino Projects github repository.

And here is a simple demonstration of it working - you can hear the warning 'pip' and the alarm 'buzz' in the background when I shake my arm to simulate a seizure. 
Still quite a bit of work to do - build it on stripboard to make it more robust, then try attaching it to the floor and seeing if I can detect any signal from someone shaking.  If not, I will have to minaturise it to make it wearable, and train Benjamin to wear it....


Monday, 28 January 2013

Getting Started with Raspberry Pi

I have had a Raspberry Pi single board computer in a box in the attic for a few months - I had forgotten that I had pre-ordered it, and was busy with the Arduino solar panel power meter when it arrived, so didn't do anything with it.

Well, I know that the wheelchair project will need some brackets to mount motors, lights, GPS receiver etc., and have been reading about 3d printing, and thought it would be a handy excuse err... a necessary part of the project, to try out 3d printing for these parts.   And the 3d printer will need a little print server, so I don't tie up my laptop when it is printing.   So, I am dusting off the Raspberry Pi and having a go at setting it up to see if it will be able to do that.

These are my notes, so that I can do it again if I accidentally break it...

Basic Set-Up

  • Download the Debian root filesystem image from the Raspberry Pi web site.
  • Unzip the archive to give us 2012-12-16-wheezy-raspbian.img.
  • Copy it to a 4GB SD card using dd if=2012-12-16-wheezy-raspbian.img of=/dev/sdb.  (Note, write to whole SD card, not to a partition - sdb, not sdb1).
  • Put SD card into raspberry pi, connect HDMI to TV in living room and switch on.
  • Success - boot messages displayed on TV
  • Failure - it lands in an interactive set-up utility, and I don't have a keyboard for it - doh....maybe I should have gone for openWRT.
  • Try different approach - forget the TV now I know it boots, and just connect it up to the network.  It gets is IP address from my router, and I can now ssh into it, with username pi, password raspberry.
  • Now I can run sudo rasppi-config, which is the same config utility that came up on the TV monitor.  Used this to expand root filesystem to fill SD card, but didn't see much point in changing anything else (will sort out a user in a minute and do away with the pi user).

3d Printing Stuff

  • Followed instructions at https://github.com/w-A-L-L-e/printerface, with the following exceptions:
  • mv kliment-Printrun-71e5da0/ printrun
  • Node-js needed sudo apt-get install nodejs not node-js.
  • Had to do sudo ln -s /usr/bin/nodejs /usr/bin/node to get npm install.sh to work.
  • needed to  curl https://npmjs.org/install.sh | sudo sh. to avoid directory access errors.
  • The forever@0.9.2 failed to install with lots of errors, but npm install -g forever worked.
  • But starting printerface using forever failed with an error on line 404 (monitor.send).
  • node printerface.js works though - web interface appears on port 8080.
Will update when I get further....

Sunday, 6 January 2013

Design Calcs for Power Assisted Wheelchair

Update to correct my deliberate mistake...Answer is still about the same, but I am now designing to a 1 in 3 (18 deg) gradient.

A very quick go at some preliminary design calculations for the power assisted cross country wheelchair.
The idea is that the motor should be capable of preventing it slipping backwards on a 18 deg incline (fairly arbitrary, but needed to make a design assumption).
  • Based on an assumed mass of 50kg, would give a weight of 490 N.
  • This resolves to a force down the 18deg slope of 152 N.
  • Which is equivalent of a torque on an 18" (0.46m) od wheel of 85x0.46 = 35 Nm.
Alas this is more than twice the torque delivered by the bicycle hub motor (15 Nm).  Now the motor is likely to have internal gears, but it could be tricky to make some new ones to reduce its speed and increase its torque... [Update - oh no it doesn't - it is shown as gearless].
So it looks like if I am going to use hub motors, I will have to use two of them.  This would probably  be sensible, as it will be better to drive the rear wheels, but also expensive...

I have ordered an electric wheelchair conversion kit off ebay - will see how that goes.  Torque and speed should be ok, but it looks heavy and clunky, so I expect to upgrade it...

Power Assisted Cross Country Wheelchair

Our son Benjamin does not walk too well, and will suddenly run out of energy, so when we are out in the countryside we take a three wheeler cross country wheelchair for him:
He has got too big for this one, so we are going to get him the biggest one we can find:
This new one has 16" spoked wheels, so this means it should be possible to add some form of power assistance to it, as you can get some nice lightweight motors that fit into bicycle wheel hubs.
So, I intend to get an electric bicycle conversion kit, and fit it to the wheelchair.  There are a few things to deal with to make it work:
  1. Will the new hub fit in the front forks of the wheelchair? (waiting for supplier to measure it for me on Monday).
  2. Although fitting the powered wheel in the front will be the easiest mechanically (assuming it fits), the front wheel has less weight on it, so it may just spin, and not be much use, so I may have to look at how to fit it to one of the rear wheels (which then raises the concern about whether it will spin round in circles!
  3. The bike set-up will be intending to go a lot faster than I want this wheelchair to go (I guess it will target around 12mph, but I think 4mph will feel quite fast enough for me).   Mounting the hub in a smaller wheel will reduce the speed, but I think it will still be too fast (will do the sum later...), so I think I will have to modify the motor driver.    The motor is a brushless motor, which from what I have read sounds pretty much the same as a stepper motor - you have to feed it with a wave form to get it to go around (and go in the right direction).   So even if I can not simply modify the controller, I can use its power transistors etc. and use an arduino to make the waveforms.
An alternative may be to go for two electric wheelchair motors, but they look awfully heavy compared to the bike motor, so I am tempted to go with that as a trial.   If it doesn't work, I'll put the electric kit on our Hase Pino tandem to help me up the hills, as Benjamin doesn't put too much effort into pedalling!
IMAG0035

I'd be interested to hear if anyone has tried this and has experiences to share.


Sunday, 16 December 2012

Approaching a working version of Arduino Solar Monitor

Christmas is coming, so I have to get a working version of the Arduino Solar Panel monitor.

My original intent was that it would have the following features:

  1. Measure the collector differential temperature.
  2. Infer the water flow rate from pump speed.
  3. Calculate the instantaneous power being collected.
  4. Calculate hourly and daily average powers.
  5. Log this information to an SD card.
  6. To achieve (5) easily, derive the time from an external Real-Time-Clock (RTC).
Now, features 1-3 are working, phew.   Feature 5 is implemented, but I need to think about what I really want (is daily average power useful?  Or should I just integrate total heat collected in a day?

Features 5 and 6 are proving troublesome, as I think I am starting to get to the limit of a single Arduino board (or more precisely the ATMega 328 controller on the board).

The main problem is that I am running out of RAM, and am going to have to give some serious thought to how to manage it better (just like old times programming a Zilog Z80A.....).

One problem is the number of different interfaces (and hence libraries) that I am having to use to achieve this.  The base software uses:
  1. OneWire.h and DallasTemperature.h to do the temperature monitoring, using a One-Wire bus.
  2. LiquidCrystal.h to drive the LCD display, using parallel data transfer
To add SD card support and a real time clock, I will need:
  1. Wire.h and DS1307RTC.h to access the real time clock from an I2C interface.
  2. SD.h to access the SD card from a SPI interface.
Each library uses a bit of ram , and there is only 2k of ram on the chip, so I am running out of it rapidly.  When I tried to add the RTC code, the board re-booted every few seconds, which I think was an out of memory issue.

So, the de-scoped system is not going to do SD card logging.  As compensation I have added switches to the two spare digital lines to use to provide a simple user interface so you can scroll between instantaneous, hourly and daily data, and maybe even set the clock (but I do worry about running out of RAM again if I get too adventurous!

Given this, I have put the 'Version 1' hardware together, and mounted it in a cheap 2 gang socket pattress box with a blank cover cut out to hold the board:
The toggle switch on the front is for the display back-light - I thought that would be easier than a push-button if you were trying to use buttons for the interface - the new buttons are facing the bottom of the picture on the side of the front panel, so you can't see them on this photo (and I made a mess of cutting the holes for them, so it looks a bit ugly...).

Right, just got to sort out the software now.  Current version is on github.

Sunday, 9 December 2012

Odd Behaviour of Arduino

I think I have got too used to working on large computers, which have essentially infinite resources, as far as my little projects are concerned, so I am having a bit of trouble with Arduino.   The two interesting problems I have seen are:


  1. Low Battery:  The symptoms were the device operating ok for quite a while (initially around an hour, but later ~5 minutes), then doing very unexpected things - what I saw was the pin 13 LED flashing on and off, but my software was not doing anything with that pin.   It looked like the board had just lost its marbles.   It turned out that the issue was low voltage on the 9V battery that was powering it - I did not realise initially because the LED back light on the display worked fine, which is the test I was using for 'it has got power'.  When I put a volt meter on it, it was only providing around 5.3V, so I think that this was insufficient to start the arduino properly...but surprisingly was enough to light the LED ok - I have always thought that LEDs need more power than little electronic devices, so if the LED is ok, it has enough power - this is not true, so I must think of another simple check!
  2. Out of Memory:  My solar thermal monitor now works nicely with an LCD display, and I made a simple test program to write data to an SD card.  The odd thing is that merging the two together results in a program that compiles ok and loads onto the device, but when it tries to write to the SD card, the arduino re-starts (I had worse effects earlier when it would just not start at all, until I removed some code in the setup function that writes to the SD card).  I think it must be running out of memory, but I need to do some work to check this...will update this once I have fixed it.

Sunday, 2 December 2012

Arduino Based Solar Panel Power Monitor

My dad has a solar thermal collector on his roof (2x20 vacuum tube collectors).   His commercial controller gives total kWh collected, but I want an instantaneous kW indication.   I am developing this using Arduino (see Microcontrollers Revisited).

Version 1 used a 7 segment LED display:
But I have now received an LCD display off the slow boat from China courtesy of Ebay, so wanted to update it to give more information on the display.
The updated board is shown below:

I made a little mistake when I was modifying the circuit board, and when I added the LCD contrast potentiometer, I accidentally left it one of the digital output pins connected to ground if you turned the potentiometer too far.   The Arduino board suddenly stopped working altogeher, so I thought I had fried it.  I was pleasantly surprised when I powered it from a 9V battery rather than from the USB socket, because it came back to life and appeared to work normally.
We installed it on the panel, and started to get sensible readings off it this morning (see above picture), but it was reported dead this afternoon, with the Pin 13 LED flashing every now and then (which is odd because my software does not use Pin 13)....It starts to work if you power it down for a few minutes, but within 10 mins it crashes again with Pin 13 LED flashing.....So I think it is dead - will de-solder the nano and put another one in instead....

Well, replaced Arduino nano on the PCB with a new one.   It worked fine....for a while (10-15 mins), then as I was packing up, I noticed that the display was very dim, but the LED back light still worked ok, which made me think the battery was ok.   5 minutes later, it was doing the same behaviour as the previous one - no LCD display, and the Pin 13 LED flashing.   This time though, the new Aruino Nano has a working voltage regulator on the USB port.  When I plugged the board into the computer via USB, the board reset and is working fine again.....I must put a current meter on the 9V battery to make sure it is not pulling a ridiculous current or something.  If I am lucky it was just a dead battery, but I am still surprised that the LED backlight worked ok, when the arduino could not boot...I'll have to think about this a bit more...

There was definitely a dead battery involved - the 9V battery was only giving 5.9V, so I can see why the 5V voltage regulator may have been struggling.  The thing I need to find out though, is why is the battery dead?  This should be a nice low power circuit, but I will have to get a new one and check the current it is drawing.

Sunday, 25 November 2012

Microcontrollers Revisited

Quite a few years ago (probably 10), I started getting interested in using microcontrollers to do small computing tasks that required input-output, and low power consumption.   I did not get very far with them because every time I wanted to do something, I would have to write software from scratch (to talk to a display or sensor etc.).  Also there was a lot of soldering involved to put the boards together, with crytstals, capacitors etc. to support the microcontroller.

I recently discovered Arduino (http://arduino.cc), which is a simple microcontroller with a standard PCB board layout, where assembled boards are sold cheaply.  The Arduino Uno seems like a good one to use for prototypes, as all the I/O pins are taken out to headers that you can attach jumper wires to easily.   For 'production'  versions though, the Arduino Nano seems like a better option, as it is much smaller, and you can solder connections directly onto the board rather than using jumpers etc.  I bought a few of these (or at least clones of them) very cheap (~£11 each) off Ebay.

You can download a simple development environment where you can write the code for the boards in C/C++, compile it, and load it onto the board via USB - seems to work very well.

By far the best feature of Arduino though is the user contributed libraries - there are libraries for accessing one-wire devices, LCD displays etc., so you do not have to start from scratch for each project, which makes development much, much quicker.

So, I am starting to think of all of those 'I could make one of those, but it is a bit of a waste to use a full-blown computer for it' projects.   The ones I am starting on are:

  • Solar Thermal Monitor (Power Meter for water heater solar panel) - I have a first version working - see the solThMon directory in my Github repository.  A bit more description is provided in the github wiki.
  • Alternative Weather Station Receiver - the idea is to use a simple 433MHz radio receiver to read the signals from our weather station, so we do not need the big LCD display that came with it (no progress yet, but I have the hardware for it...).
To give an idea of what these things look like, here is a picture:

Sunday, 29 July 2012

Making Videos from Images

My daughter collected a nice series of images of the demolition of the old Steetley chimney in Hartlepool:

There are 25 images, so we thought it would be nice to make a little movie of them.
First they need a bit of processing, because the horizontal is not level.   We rotated the images, and trimmed off the edges to straighten them up using ImageMagick using:
mogrify -resize '700' -rotate 4 -shave '50x60' -resize '640' *.JPG 
This re-sizes the images to 700 pixels wide, rotates clockwise by 4 deg, shaves 50 pixels of the top and bottom, and 60 pixels off the sides.  It then re-sizes to 640 pixels wide. We then turned it into an mp4 avi movie file using mplayer's mencoder using:
mencoder "mf://*.JPG" -mf fps=4 -o Steetley.avi -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=800 -vf scale=640:480
This plays nicely using mplayer, and uploads to flickr too.

Final movie is here:
Or on Flickr here








Saturday, 7 July 2012

Webcam using NLSU2 and OpenWRT

I am trying to set up a simple web camera to take some photos and videos of birds on our bird table.
I have had an edimax ip camera for a long time, but have had some trouble with using and configuring it from Linux.  So, I am having an attempt with a different approach from bits of hardware I have around.   There is a Linksys NLSLU2, which is made as a network storage device, and I just picked up a logitech usb web camera.   I decided to use OpenWRT as the operating system, because I used that on a previous project (bifferboard weather station).
This post is a few notes of where I have got to, and the problems encountered.

Operating System

  • Download OpenWRT:   To start with I used a tarball of OpenWRT 'backfire' 10.03, but it problems with packages not being compatible.   Rather than understand why, I went for checking out the latest source code from the 'backfire' branch of the OpenWRT SVN repository.
  • Build OpenWRT:  This is as simple as changing into the source directory and doing 'make menuconfig', selecting the target system as 'IXP4xx', then the profile as NSLU2, exiting and typing 'make'.   This creates a flash disk image as bin/ixp4xx/openwrt-nslu2-squashfs.bin.
  • Put the NSLU2 into upgrade mode by powering off, pressing and holding the reset button with a paper clip then powering on.  Wait for ~10 sec until the top LED changes colour (very difficult for me to tell as I am colour blind...), then release the reset button.  The top LED now flashes two slightly different colours.
  • Connect the computer with the OpenWRT image on it to the same ethernet network as the NSLU2 - Wireless connections do not work!.
  • Flash the new image onto the NSLU2 using 'sudo upslug2 -i openwrt-nslu2-squashfs.bin'.
  • Once the flashing is complete, the NSLU2 reboots and you should be able to telnet into it - default ip address is 192.168.1.1, which is a pain if that is the same one as your router...
Configuring OpenWRT
The basic OpenWRT build does not do much, so it needs to be configured and the extra required packages adding:
  • Default IP Address - this can be set by editing package/base-files/files/etc/config/network [there is probably a better way to do this, but this works...].
  • Add the drivers for the USB video cameras - using menuconfig select them in the kernel config section - make sure they are selected to be built-in [*] rather than modules [M], because otherwise they are not included in the flash drive image.
  • Add some software to do something with the video source - add the mjpg-streamer and motion packages.
  • Re-build OpenWRT and re-flash it.
  • You should now be able to look at :8080?action=stream and see the image from the camera from mjpeg-stream
Making it Do Something Useful
  • mjpg-streamer seems to work nicely and produces a jpeg stream that can be viewed on a browser.  No sound though - will have to look into how to deal with that.
  • motion also seems to work - need to modify /etc/motion.conf to tell it what to do.
  • I would really like to to record video clips when motion is detected, so am currently trying to see if I can build ffmpeg to link that to motion.....
  • I have run out of time this weekend.  What I have done is just used motion and removed mjpeg-streamer, as motion provides a mjpeg stream too.  The basic set-up is:
  • Logitec usb web cam.
  • Motion records images to /tmp/cam1/// - separated into different directories to stop the numbers of files getting out of hand.
  • A little php script /cgi-bin/browse.php is used to browse through the directories and view the images.
  • I could not get ffmpeg to compile, so no videos for now.
  • This is going to be installed at my sisters, so will have to talk her through setting up her router so I can ssh into it remotely to fix it when it does not work.....
  • My version, using the same motion and php script set up, but using the edimax ip camera can be seen at http://maps.webhop.net/webcam.

Tuesday, 8 May 2012

Trouble with Ubuntu 12.04 LTS

Over the last few days I have upgraded my family's computers from Ubuntu 11.10 to 12.04.   I had been getting a bit over-confident at how good Ubuntu was, and so was not really worried about things going wrong during the upgrade, as I would have been in the past - it had been getting to the state that it 'just worked'.   So I made the mistake of doing the upgrade over a weekend when we were particularly busy, which meant it was a particular pain when things went wrong.   The issues we have had are:

  1. Our PackardBell OneTwo was un-useable - booted to a black screen - didn't have chance to work out why so I just saved some logs to report the bug later, and re-installed 11.10.
  2. My home server (my old Fujitsu Amilio laptop) appeared to upgrade without problems...but every time I tried to access it, it was dead.   I think it was suspending, even though I had set the power settings to never suspend.   Have tried leaving the lid open, with me logged in, with the screen blanked - seemed to be working when I left - need to work out what was going on there....

Monday, 7 May 2012

More on Samsung CLP-325w on Ubuntu

I have been pretty pleased with the Samsung CLP-325w - working nicely from my daughter's Ubuntu PC.
Have just had to re-install Ubuntu 11.10 on that (see separate post), so need to get the printer working again.
I had received a question about why I did not use an open source driver, and used the Samsung one last time.   The main reason was that the 'Recommended' driver when I installed the printer only worked in monochrome, not colour.
Just tried again, and used the 'recommended' driver, which was a generic PCL6 one.  Again this printed monochrome, until I realised that under the 'Printing' options it defaults to 'Normal (monochrome)' print quality.  Changing that to 'Normal' got it printing in colour.
Currently using it plugged into the USB port on the computer, because having a bit of trouble with network printing - job for next weekend.

Ubuntu 12.04 on Packard Bell OneTwo

Some of my previous posts have described my experiences of running Ubuntu Linux on my daughter's Packard Bell OneTwo 'all in one' touch screen computer.

Ubuntu 11.10 was working fine, but updated it to 12.04 last night.   No errors during update, and it was late when it finished so switched it off and went to bed.   This afternoon she reported that she had to resort to booting Windows because Ubuntu does not work - she got a black screen that she left waiting for 5 min, before giving up and booting Windows.

From a quick fiddle booting in 'recovery mode' and trying the safe graphics option, I think it is something to do with the graphics hardware not working, but am going to have to investigate more....just lent her my laptop to do her homework for now....

Went through a few options that I found on the internet, but none seemed to be quite my problem.  Also tried running 12.04 from a memory stick in case the upgrade had gone wrong, but it failed to work that way too....So I gave up - saved a selection of files from /var/log/ and re-installed Ubuntu 11.10.

Saturday, 14 April 2012

Android Development on 64 Bit Ubuntu

I have been getting back into Android development over the last few days (more on that in future post).  Because I was travelling I initially set up the development environment (Eclipse) on my work laptop running Windows XP.   All worked fine.
Then I tried to continue work on my Lenovo laptop running Ubuntu 11.10, 64 bit edition.   It refused to build R.java, which contains all the resources such as screen layouts.  No errors to say why......

After much grumbling, searching on google and reinstalling eclipse and the android sdks without success, I discovered that to get it to work on a 64 bit machine you need to install a package called ia32-libs.   (http://developer.android.com/sdk/installing.html#troubleshooting).  Don't know why, but installing it has got it building android packages again - phew!   Should have read all the way to the bottom of the page, rather than just scanning.....

Friday, 3 February 2012

Ubuntu 11.10 on a Lenovo G570 Laptop

I have just bought myself a new laptop.  I got a Lenovo G570 from PC World for just under £450.  It seems pretty good Intel i5 processor with 4GB Ram.

Installed the 64 bit version of Ubuntu 11.10.  Installation went without hitch.  Initial boot hang for some reason, but switching it off and on again solved that, and it has worked fine since.   Basically everything I have tried worked out of the box - screen, track pad mouse, web cam, USB.   Therefore absolutely no issues - a very good advert for Lenovo and Ubuntu.

I was really surprised at how powerful it is - I just installed a simple OSM tile server on it using the instructions at http://wiki.openstreetmap.org/wiki/Ubuntu_tile_server.   Loading the british isles OSM data extract took less than 2 hours.   My home server (ex laptop) - an intel dual core processor and 2GB Ram running 32 bit Ubuntu takes almost 24 hours.

I am thinking I should have bought 2 of them and use one as the server - it only uses 20 Watts when running at low load, which is probably less than my existing one.....

Sunday, 1 January 2012

Using Blender 2.5

My daughter and I have been trying to learn to use Blender 2.5 to crate 3D models for use in our simple games for Benjamin.   It has proved harder than I had expected!   The main issue seems to be that most tutorials are written for Blender 2.4, and there are lots of changes to the user interfaces in 2.5.  Plus the official documentation is still for 2.4 and documentation for 2.6 is in preparation...but not 2.5.

This is a few reminders for us for how to do things.   I will add more as I work them out.

Adding an armature to pose a model:
See http://www.youtube.com/watch?v=nNTyE9SGRYw for details of linking bones using inverse kinematics.  The author has a web site with a lot of additional information here.
  1. Add a bone in Object Mode
  2. Go to edit mode and position the bone within the model mesh.
  3. Extrude the bone to add a joint (e.g. elbow)
  4. In Object mode select the model mesh then shift-right click to select the bone.   Do control-P to bring up the 'parenting' menu and select Armature Deform with Automatic Weights.
  5. Set the model view to solid (or texture), and in the armature properties menu, select X-Ray so that you can see the bones.
  6. You can now enter pose mode and move the armature to pose the model.
  7. To do a complete skeleton you should set up the back bone to be the parents of all the other bones so you can just grab the back bone to move the model.

Saturday, 17 December 2011

Simple Games for Cheap Android Tablet

My Autistic son has developed quite a liking for hand held electronic devices - he likes our daughter's Nintendo DS with an animated dog on it, and apparently plays with an iPad at school.
I am not a fan of 'i' anythings because of the difficulty developing software for them, so I thought I would get him a cheap android based tablet to try.   Just need some software for it now.

I have got a Eken M009S from Amazon - it was just under £70.   I was hoping to develop some simple games using javascript to run in the web browser, which would mean they would work on any device, but the processor on the device is not up to it - there are some nice javascript game demos at http://kevs3d.co.uk/dev/ which work very well on my laptop, but are so slow on the tablet that they are not useable.

This is a shame as it would have been nice to develop something that would work on any platform - I think I will have to remember how to write 'native' (or at least java) android programs....