Arduino UNO Test App

I have been using Arduino UNO’s for various projects for quite some time now and have been looking for an easy way to basic connectivity on new projects that I build. The first and obvious choice was to use the Firmata firmware as the basic communications protocol but opted not to go for this setup for 2 reasons: firstly, the Firmata firmware does a lot more than I currently needed, and secondly, the protocol being used (which is loosely based on midi) is just too complicated to use easily.

With this in mind I set out to write my own basic communications protocol firmware for the Arduino Uno. I found an interesting blog post (http://forums.trossenrobotics.com/tutorials/how-to-diy-128/complete-control-of-an-arduino-via-serial-3300/) which listed an easy to understand protocol. In my final firmware I have modified this protocol for use in my project. The protocol I am using can be viewed in the header of the Arduino code file.

Once the protocol had been written and tested using the serial monitor I set out to write a Visual Basic app to control all analog inputs and digital inputs and outputs from the same graphical interface, thereby providing an easy way of testing the hardware on most of my future projects before writing dedicated firmware for the project.

My final graphical interface can be seen here:

ArduinoTestApp

If anyone would like to make use of this project, you can download the complete Arduino Uno code and windows app here:

https://drive.google.com/file/d/0B_16rI3mrTZiY2JxNnpVRkJaeUE/view?usp=sharing

Nextbook 8 with Windows 8.1

I was recently given a Nextbook 8 with Windows 8.1 OS to review to see if it would be useful as a teaching tool. The unit has 2GB ram, a quad core processor and 16GB storage running full Windows 8.1 (Metro apps + Desktop programs available to install).

nextbook8

There is something magical about carrying around a full desktop version of Windows 8 in your bag or “large” jacket pocket. Having access to all your usual apps sounded fantastic. The screen is a bit of a fingerprint magnet compared to my other devices but is bright, clear and responsive.

However, that’s where the honeymoon with this device ended. As always, great on paper but less than average in real use – and this is marked down to one oversight only. Having only 16GB storage is not nearly enough to create a useful experience. Of the 16GB, almost 5GB are taken by the repair partition which leaves only 11GB for the Windows 8 installation and any apps and data. On first use, after setting up the device, only 3GB is left for data files and any apps/programs you need to install to make it useful. Having a microSD slot allows you to increase the storage for data and media files – however, this does nothing to increase the ability to install more apps.

For the price this device will sell many units but I think that the owners will soon feel disappointed with this major drawback. The manufacturers should have ideally increased the price and provided a unit with a minimum of 32GB of storage, thereby making it useful beyond simply browsing the internet.

Digispark “Arduino-Compatible” Microcontroller Board

I few months ago I came across a project on kickstarter that I thought would be perfect for my small projects. I often use Arduino development boards in my projects but they are usually too big to use permanently in the project. This digispark board based on the Atmel ATTiny seemed to tick a lot of boxes so I ordered three to test.

digispark

Well, it seems that I wasted my money. Even though I think that the designer had a great idea, the execution thereof is just not up to scratch. There are far too many large problems with the board to make it useful.

The first problem I encountered was trying to program the device: both my windows 7 and windows 8 machines refused to acknowledge the driver and hence the hardware when plugged in (and yes, I did follow the instructions on their website). After much fiddling and trying to upload a program to the board, I finally succeeded. However that success was short lived – the process is extremely intermittent and seems to work once every 5 to 10 times I try to program it. Changing boards did not seem to help at all.

Secondly, once programmed, I found that my board does not power up from a USB socket on a psu. WTH? Ridiculous because now testing becomes a problem.

This was a great idea but very poor execution. When it works it is useful. Unfortunately it works so seldom like it is supposed to that they have now been relegated to the bottom drawer on my cabinet with my other obsolete junk.

Namibia 2013

We finally have settled back into our routine after an amazing trip totaling 5600km through Namibia. We left just before Christmas and arrived back home on New Years eve. The complete journey took us firstly to Kimberley and then to Upington on the banks of the Orange River. The next day we crossed the border into Namibia and spent the night at the Quiver Tree Lodge outside Keetmanshoop. The following day we arrived at Harnas Wildlife Foundation where we were due to spend the next 6 days with family and friends.

After 6 days and with sad hearts we left Harnas for Ai-Ais Hot Springs Resort in the Fish River Canyon for 2 nights to break the trip home. From there it was one overnight stop again in Kimberley and then home.

Details on the complete journey can be read here.

The road ahead...

The road ahead…

 

Another NAS drive using apc.io board

apc1

Following on from my setup of using a raspberry pi as a NAS drive, I decided to use my apc.io 8750 board which was lying in the bottom of my drawer as I had no other use for it. I followed the same procedure as detailed in my previous post but once the webmin server was installed I could not access it – it kept on giving me an authentication failure message. To then change my webmin access password I used the following command in the Linux terminal:

  • sudo /usr/share/webmin/changepass.pl  /etc/webmin root “your-password”

This then allowed me to access my apc.io webmin server and the setup was then as my previous post. One important consideration though is that to use this board headless (ie with no monitor or keyboard attached), you need to create a dummy vga connection to enable the board to boot up. This is done simply by connecting a resistor between pins 1 and 6 on the vga input.

vga_dummyAfter testing my throughput using the same drive connected to the apc.io board was better then the raspberry pi. I tested using a 1GB file to transfer to both systems and got the following results:

raspberry pi average: 3.0 MB/s

apc.io average: 4.5 MB/s

These throughput rates do not compare to my dedicated Netgear raid NAS unit (at 14 MB/s) but they are still very usable for general work and backing up.

Creating a NAS drive using a Raspberry Pi and Webmin

After my WD NAS (network attached storage) drive failed, I realised it was too expensive to replace it. All I needed was a drive on my network for accessing occasional files and backing up data.

I decided that I could use a Raspberry Pi to create my own NAS drive. However, working with the terminal is a pain in the arse so I first installed Webmin, a utility to provide a GUI to the Linux based Raspberry Pi via a web browser. This allows me to run the Pi as a headless device with no keyboard, mouse or monitor attached.

To start I installed Raspbian with the “Boot to Desktop” option disabled and SSH enabled. This allowed me to use PuTTY to remotely control the Raspberry Pi. The default username is pi and the password is raspberry.

From within PuTTY on my windows machine I performed the following:

  • First I changed the default password:
    • sudo passwd pi
  • I then added a new user:
    • groups (this will display all the groups that are currently on the Linux box)
    • sudo useradd -m -G “list all the groups from above separated by a comma” USERNAME
    • sudo passwd USERNAME (to provide a password for the new user)
  • Once this was done I shut down PuTTY and then restarted and logged in with my new username. I then performed the following updates and installations:
    • sudo apt-get update
    • sudo apt-get install ntfs-3g (install support for ntfs drives)
    • sudo apt-get install samba samba-common-bin (install support for Windows sharing)
    • sudo apt-get install xrdp (optional – to provide the facility to access via Windows remote desktop connection)
  • I then installed webmin which turned out to be a bit of a process:
    • sudo wget http://prdownloads.sourceforge.net/webadmin/webmin_1.730_all.deb
    • sudo dpkg –install webmin_1.730_all.deb (this displayed dependency errors – Note double dash(-) before install command.)
    • sudo apt-get install libnet-ssleay-perl libauthen-pam-perl libio-pty-perl apt-show-versions
    • sudo apt-get -f install
  • Once this was complete I added my username as a Samba user:
    • sudo smbpasswd -a USERNAME

Once this process was complete I could now open up my web browser and access the webmin server using the following address: <raspberrypiIPaddress>:10000 to be presented with the login screen. Once logged in I was presented with the following screen:

webmin1

Oh happy days 🙂

Now to set about configuring the system to allow sharing of a drive plugged into one of the USB ports. Note that once any changes have been made to select Save to apply the changes.

Browse to Hardware -> Partition on Local Disks.

webmin2

If your drive is not mounted you need to mount it – I used /mnt/disk1 mounted on SCSI device A partition 1 – this is found in System:Disk and Network Filesystems in version 1.72 of webmin.

Now browse to Servers -> Samba Windows File Sharing and then select the Windows Networking icon. Here you can update the workgroup name and add a server name if you want to:

webmin4

“Create a New File Share” option. In this page I used “data” as the share name and the partition I just created as the “Directory to share”:

webmin3

Once this share has been created we need to allows access to the share. Select the share that you just created and then select “Security and Access Control”. Here you can control who has access to the share and whether the share is writable. In the following screenshot the share is accessible to user Peter and full read/write access and no guest access is allowed:

webmin5

That’s it! You should now be able to use Windows file explorer to browse to your network share and access it.

Performance:

Write and read speeds of this system (Raspberry Pi B version) does not approach my dedicated NAS system but is usable for general file access.

Testing using a 200MB file gave a write speed = 3 MB/s and a read speed = 5.8 MB/s.

Update on performance:

Last week I got my hands on a new Raspberry Pi2 and gave it a whirl as a NAS drive to see how it compares with the older B version. As it turns out the performance improvements are quite large.

Using a drive formatted as ntfs and a 200MB test file I obtained the following results:

Write speed = 8.2 MB/s

Read speed = 11.0 MB/s

As can be seen this is about a 100% improvement on the older Pi and almost rivals my dedicated NAS unit (which has a read speed of 14 MB/s). I’m impressed.