Thursday, December 27, 2012

Mini Wireless Keyboard/Touchpad and Nano USB Wifi Adaptor that works with Raspberry Pi


As part of my Christmas presents I got a couple of bits to go with my Raspberry Pi.
As I sometimes take the Raspberry Pi out and about I wanted a mini wireless keyboard/touchpad to pack in my box of wires.
I heard good things about the Rii 2.4GHz Wireless Mini PC Keyboard Touchpad so added it to my wish list. I plugged in the dongle to the Raspberry Pi, turned on the keyboard and it worked first time. No problems at all.  I read some comments that the range is very short. I'm getting about 3 metres from it as I haven't tested any further.  Very happy. Keys are big enough for me to use comfortably and the main keys are all in the expected places.  It also has a laser pointer built in if needed.
Also, the extra function keys beyond [F8] are at [FN],1,2,3,4 so you do get the full 12 functions keys but only the first 8 are shown.
The one I received was in a plain white box.

I also got the Edimax EW-7811UN Wireless 802.11b/g/n 150Mbps Nano USB Adaptor.
Using Raspbian it worked first time with no additional drivers required.

With the 2 of these plugged in I have a full functioning compact computer with only the power and HDMI coming from it.

So, when I'm logging in remotely using Xming and Putty I can put the Raspberry Pi where ever there is a spare socket and work away.

I also got  the beautiful Pibow Colour Raspberry Pi Case.  and the Adafruit Pi Cobbler Breakout Kit. So, very happy with the presents.





Note: Links are to Amazon UK stores where mine came from.  My wife has learned that the best thing is for me to email her actual links rather than having me expect her to known what I'm looking for.
One year a link went from being a processor to a couple of wires. luckily she checked with me before buying.





Friday, December 21, 2012

Learning Scratch for CodeClub


I've signed up to run a CodeClub at my kids school from  January.
Before I received the official course work I thought it might be a good idea to actually try and make something with Scratch. So, I put together a simplistic shooter.

You can see it and download it from the Scratch Site.
Dragon vs The Ghosts
http://scratch.mit.edu/projects/winkleink/2847788


You can play the game in a browser as well if you don't want to install Scratch.

The game took about 2 to 3 hours to make using the built in graphics and sounds. With most of that time me just figuring out how to use Scratch.  For those who have experienced Scratch before I'd expect a game like this would take less than 30 minutes.

Also, I just saw that Scratch 2.0 is going into public beta on the 28th of January and that the Raspberry Pi Foundation are supporting work to improve Scratch's performance on the Raspberry Pi.
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=77&t=26361

It's looking good for Scratch.

Sunday, November 25, 2012

Great Day at Milton Keynes Raspberry Jam (25th Nov)

Today was the 4th Raspberry Jam at Milton Keynes today and it was another great event.  I brought along my simple Raspberry Pi controlling an Arduino over the network (more later)

Best of all I got to see some brilliant projects.

There was Daniel Bull's BerryIO a fantastic web interface for controlling the GPIO pins on the Raspberry Pi.  Not only is BerryIO functional but the interface is gorgeous. Ideal for an event at the National Museum of Computing with it's switches and lights..  Daniel had a problem with the wifi at the Museum,but luckily after the last visit I had brought along an old wifi router to act as a wifi/Ethernet switch. So, Daniel got to use the network to get the BerryIO working.  It was really interesting to see how it worked and has inspired me to see if I can improve the quality of my own web interface.

There is a great video on raspi.tv showing off BerryIO - go check it out


Next to BerryIO was a project by raspi.tv (I think it was Alex) where he was using a Raspberry Pi to control 2 relays to turn on/off a light and fan.  Light if it got dark and fan if it got hot being expertly  demonstrated by (I assume) his son.
Again, there is a great write up on raspi.tv with a video


There was also a Raspberry running RISC OS. I was amazed how fast it is and how responsive it is.  Hopefully, somebody way more capable than me will have some fun with it. I'm really looking forward to seeing what's possible.

The final project I took peek at appeared to be a project after my own heart as it was Arduino MIDI interface.  I didn't get a chance to talk the person who brought it along but it looked really cool and maybe if I see it again I'll find out what the knobs and buttons on the little red board do.




In amongst these great projects I set up my Raspberry Pi and Arduino with the Linksys router in a corner.  This time I brought an extension lead which was lucky as I only had 1 socket for 3 plug.
This is a revised version of the Arduino + ENC28J60 project I posted about before but using an ebay purhcaed W5100 based shield so I could use the official library from the Arduino people.  Others may disagree but to me the W5100 board may cost a little more but the time saved unless you know the ENC28J60 board inside out is well worth it. Especially as the generic versions of the W5100 board are not available.
I got mine on ebay.co.uk from EachDesk, so you can search their store for the board.  It was delivered in a few weeks from Hong Kong.  The current list for the W5100 shield costs less than £7.00.
The ENC28J60 boards are on ebay.co.uk for as little as £3.19 so yes, less than half price, but really it's only £4 more expensive for a whole lot of reduced grief.

My project allows you to control as many Arduino as you want over Ethernet/Internet from a web server running on a Raspberry Pi.
On the Raspberry Pi is a LAMP server with an entry in the mySQL database for each Arduino and then for each pin on the Arduinos that you wish to control or read.
The Raspberry Pi presents a simple web interface with switches to switch on and off the pins on the Arduino.  When you click [ON] a GET statement is called from the Raspberry Pi to the Arduino using fopen in PHP.  The Arduino has a web server running on and when it receives the request it interprets the GET command to find out which pin is being actioned and what to do with it.
Then the Pin is either set HIGH or LOW depending on the request.

For today I also set it up to read 2 of the Analogue pins. 1 with a rotary pot on it
and the other with an Light Dependent Resistor (LDR).

Giving the ability to turn on/off 3 LEDs and read the values for the pot and the LDR through the web interface.

After the command is actioned the Arduino then sends back a web page with the status of the Digital Pins and the Analogue Pins.

The Raspberry Pi then interprets this page and compares it to the pins being controlled based on the database entries.  It updates the interface so that only the Pins listed in the database  that are High (On) have the option to be set Low (Off). With the unused pins not presented.  What this means is that the Sketch on the Arduino is generic and the specific pins  controlled is defined by the database and not the Sketch.

My next steps are to add a little bit of security as at present if you know the IP address of the Arduino you can control the pins directly when my goal is that you have to use the web interface.

I also need to update the database scheme and the PHP page to better manage the analogue inputs and also use the PWM lines.  This will mean the Arduino code would have to be modified so the digital pins being used for PWM can be defined but I think this is a small price to pay for the ability to take full advantage of the Arduino's capability.

After the Jam some of us got a private guide to the WITCH - the oldest working computer.  BBC piece and videowikipedia article. It's a 10 bit computer using dekatron based memory, rather than relays or core storage.  This was the first time I'd heard of dekatrons, so that alone was interesting.




This was another wonderful Jam and I'm looking forward to attending more. if you're interested in the Raspberry Pi or just seeing fun projects then definitely find a Jam to go along to or if there isn't one in your area see if you can arrange one.