Showing posts with label Edenvale. Show all posts
Showing posts with label Edenvale. Show all posts

02 April, 2014

Raspberry Pi East Rand Jam Session #1

Some background

I bought a Raspberry Pi a long long time ago ... when it was still R 360.00. They are now over R 500 with the exchange rate.

I have been wanting to play with the RPi for quite some time now, but have just not had the will power or energy to do anything other than the XBMC setup.

Clive, a friend from work, said he was also interested in jamming a bit with the RPi so we set a date for Sunday the 30th March. We went out to a local electronic shop the week before to buy a few parts such as LEDs to make a basic circuit we could connect to the GPIO pins. We also got a USB keyboard and mouse from Matrix warehouse.

I had also advertised the Jam session on the RaspberryPiAfrica facegroup page. But no-one was interested in joining us. Pity.

Soon enough Sunday morning arrived and after a lekker breakfast we set up ourselves up close to the ADSL modem so we could connect our RPi's to the internet.

We had both already downloaded NOOBS 1.4.3 and we copied the unzipped files to the 8 Gig SD cards we had previously bought (also from Matrix computers in Edenvale).

Then we booted them both up and told the NOOBS interface we wanted to install Raspbian as per this page.  We only had one HDMI screen at this stage so we took turns to use the screen as and when each RPi needed the next command instruction.

(Task 1 - Remote desktop)

Then I remembered one can Remote Terminal into the Pi and a quick search later we found this command which we both executed on our RPi's:

sudo apt-get install xrdp

From then on we could remote terminal into the Raspberry pi's.
Oh yes on the ADSL router I gave both Rpi's pre-defined DHCP IP addresses so the IP addresses would remain the same after reboots and for the next jam session(s) as well.

(Task 2 - FM Transmitter)

Our first real project was the FM Transmitter.
We found this info and followed the 3 or 4 easy steps. However I don't know what the micro usb cable is meant to be used for, and we used a single wire (incorrectly!) to connect to pin 4.

We got a total distance of about 5 to 7 meters, and I think we were using the wrong pin. I'll redo it at our next jam session.

Clive also had a look at how it works, and saw it was based on a simple c++ program.

(Task 3 - Blinking LED)

We then set out to do the Blinking LED.

This took us quite awhile to complete.

We initially used this web page, but I found the instructions were not that clear (the unclear bit was where the GPIO software was to be downloaded from. Later on I realised the link was there... it was just not obvious). We also had to figure out how the breadboard worked, as it has been close to 20 years since I last worked with electronics down to this level.

We each built our LED circuit. We linked a 270 ohm resistor to positive and the other side to the LED. Clive remembered that the leg length of the LED denotes to which side of the circuit it should be connected. The other side of the LED was then connected to ground. We then tested each of our circuits with 2 penlight batteries (close to 3 volts) from my trusty GPS receiver.
The circuit worked!
Then it was time to link it up to the RPi.
I know one has to be very careful when connecting the pins of the Pi, as an incorrect connection can blow the chip. So we took our time to understand how the GPIO pins work.

From this page we saw we needed to download some stuff (We also used some info from here) After getting the code into the directory,  unzipping it, building it,  and then finally executing the following commands:
  gpio -v and
  gpio readall
and checking the output we realised we had two different version of the Pi.

Both Clive and I have the version B boards, but Clive had the revision 1 board and I had the revision 2 board. And there were pin differences. After a lot of head scratching and googeling we realised there are chip pins, output pins and BCM pins. All very confusing, but the output pins we would be using for GPIO0, GPIO1 and GPIO2 were the same on the two boards.

Note: Since Clive works quite a bit with Java he knew all the unix commands quite well, and he mentioned that the jar files Java uses are a lot the same (as in use) as the tar files unix uses.

We linked up our circuit wires to the Pi on output pins 9 and 11 (from my understanding pin 6 was the same as 9) and executed the following commands (as per this page)
  gpio mode 0 out
  gpio write 0 1 and
  gpio write 1 1 

It worked!

Clive wrote the python script to automate the blinking and once it was running on his Pi, we copied it over to my Pi (with some difficulty). I must also note Clive knew "vi" (a unix editor) quite well. I don't know it at all. (I have used it in the past and didn't like it then, and don't like it now). I resorted to opening the file in "File manager", by navigating to the file and then right clicking on it and editing in a nice GUI environment. Much easier, and more intuitive.

This was the first time I ever played with Python. Up to now all I knew about Python was that indentation is a way of grouping commands. The script was easy enough to understand.

We then set out to build another 2 LED circuits and soon had them hooked up as well.
I modified my python script to blink as per the video below.

Not exactly as I wanted it (2 LEDs must stay on all the time). I'll fix that in our next jam session (if there is time). The plan is also to build a little traffic light out of the 3 colour LEDs.

We started at 10 AM and by now it was already 4 PM. 6 Hours in total spent playing with the pi, and getting 2 "interface-with-the-real-world" projects done.

For our next jam session we hoping to have a few more people over on the 11th May, and we planning to do the following:
  1) Get a usb camera to work over the internet.
  2) Get a traffic light to work (playing with python)
  3) Get some switches to plug into the breadboard so we can read from them, and then do something with the LEDs.
  4) If there is time left, check up on the FM transmitter and see if we can get more distance out of it.

One thing though ... I think one has to be very careful by getting to much information on the net about the RPi. If one web page tells you to do one thing it might be with their specific code or binary file. Applying this to some other binaries downloaded might end up in disaster.

I will blog again as to the results of the next JAM session.

If you are interested in joining us then visit the RaspberryPiAfrica page on Facebook

And in the wise words of RWJ .... "I approve this post" - Over and Out.

26 January, 2012

Bike Ride 9 - To Dullstroom via Loskop dam by sand road, and back to Johannesburg via tar backroads, a good weekend outing

The weekend of the 21st and 22nd January 2012 was my first truly long distance ride. And it was an AWESOME weekend.

Background
I had joined up on the Think Bike forum, and browsing around saw that there was a trip planned from Bapsfontein, using mostly sand roads to Dullstroom via Loskop dam. This looked like lots of fun. So I signed up for the ride, and couldn't wait for the weekend to arrive. It would have been nice if Trish came along, but with hindsight it was maybe better, as I think some of the sand roads would have been to rough with two of us on the bike.

The originator of the ride was a guy with the nick name "iamgigglz", (each time I see his nick I think of a geocache we did close to Bapsfontein [Biggels will like it here]) and the idea was make a non technical ride from Bapsfontein, all the way to Dullstroom via Loskop dam, using as much sand road as possible. In the Garmin track log below, the purple sections are the sand roads we took, and the red ones are tar.

Que Sera to Bronkhorstspruit 
Sand road: 8 km
Tar road: 34 km

Photo taken by "Fox"
I arrived at Que Serra at about 7H30, and saw only one bunch of guys in the whole parking lot. It must be the guys leaving for Dullstroom, so I parked my bike close by and introduced myself. I got to hear a lot of names, but honestly couldn't remember many. Some guys asked me where the 69 of my forum name came from (my forum name is AntonD69). "It's the year I am born in" was my reply. They all laughed, as they thought otherwise.
After a hearty breakfast of bacon, eggs, pap, and tea (or coffee) all for R55.00 we left for our first route stop in Bronkhorstspruit. This is also where I got my first proper taste of sand road. I was about the 3rd bike of 12 to go onto the sand road, but as I felt very uneasy on the dirt, lots of the bikes started to pass me. A few times the front tyre was sliding along the gravel and I panicked a few times. Luckily I did not drop the bike, and slowed down grammatically. At the end of the sand ride the others were patiently waiting for me. Shjoe ... I made it.
I was later to learn this is the way it is done. The mavericks (fast guys) go on ahead, having their speedy fun, but once one arrives at a intersection or tar road, where the group could possibly be split up, all wait till everyone has regrouped. Lots of times either Brendon or luv2ride was behind me making sure that even the slow ones make it all the way (thanks guys).
We all filled up with petrol, as the next fuel stop would only be Loskop dam. My tank made it all the way to Dullstroom, with still lots of fuel to spare.


Bronkhorstspruit to Loskop dam
Sand road: 73 km
Tar road: 37 km
taken by "iamgigglz"
After we all filled up with fuel, and met at the other end of town we set off for Loskop dam. We hit some more dirt road, which wasn't as bad as the 1st patch, and I was able to keep up (mostly) with the group. I decided to stay at the back, then there would be nothing for me to proof, nor the need to worry about anybody passing me. I saw some guys stand up on their foot pegs and ride at around 60 to 70 km per house over the sand. I initially thought it was their way to get above the dust, but at the smoke break stop after the 1st patch of sand road I was to learn from luv2ride that its a better way to get across the sand. He always stands on his pegs whenever he crosses sand. As the day progressed I slowly started to stand more and more. First I started at slow speeds and higher gears, but by the end of the day was pretty good. I just sat down on the seat when we got to corners. I still wasn't confident enough to stand and lean with them. 

As I felt a little more relaxed now riding on sand I was starting to enjoy the scenery a little more, but still had to concentrate a heck of  lot on the road. We entered some beautiful hills and valleys. Amazing greenery all the way around. Its such a pity that I could only take photos at our stops. At one point coming down a hill, we passed a small rural village, and from afar one could see two rusted tins standing in the middle of the road. WTH (or F)? AS I got closer and closer, I saw the tyre marks go past the right of the tins, and started to follow, and then saw a donga of about .5 metres deep and maybe a meter across where the tins where. So now I know what 'rural' traffic cones look like.
At Loskop we stopped for lunch at the Bospot Restaurant. I had a Cheese hamburger, which had a nice thick patty, and a sprite. Total cost I think was R56.00. I cleaned my visor with a tisshe, and then from Gryshond was able to use a slightly wet shamy which made it nice and clean. (Note to self: Get one for sand roads). We stopped over at the dam wall for some photos.
While at the dam wall I decided to go and attempt the cache 1.4 km away, but on arrival saw I had to climb a small hill. In full bike gear, a full stomach and the midday heat, I decided to rather leave it.
After returning to the others at the dam wall, and taking some more photos we left for Dullstroom.


Loskop dam to Dullstroom / Elandskloof
Sand road: 72 km
Tar road: 60 km


The first part of the ride down into the valley was on tar, but soon enough we turned off onto a dirt road, with a game fence on the one side. Beautiful greenery all the way around. It was on this stretch of road with a long open, compacted sand that I took the bike up to 100 kmph. Only for a short bit though then it was down to 70-80 again. At the end they were all waiting for me again, and we decided to go to a small pub which came highly recommended.
On entering the small village of Laersdrif, we passed a small grey stone church, and then onto a farm or something where the pub was to be. The last section was on gravel, where the front wheel was sliding a bit, and now with much more experience I didn't find it that bad.
The pub was closed but we were greeted by two dogs. The big one seemed very happy to see us. After a rest, and some cold water, we took the road again, which was to be the last sand section before we get to Dullstroom.
Just by the Police station we turned back onto the sand road, and drove past farms and small rural villages. It amazes me that one can ride for 5 to 10 minutes, with no settlements in sight, and then a huge house is found, with no clear means of income. I would have thought one would see sheep, or cattle.
We entered a small pass, and rapidly, within 2.5 km, climbed from 1700 m asl to about 1900 m asl. Most of the way up the pass I rode in 1st and 2nd gear, and lots of times I stood up as well. Just when it got a little to technical, I opted to sit down. 
At a T-junction we regrouped, and on this stretch was another geocache, but as we got to it, I opted to rather leave it, as I did not want to keep the group up, and it was nearing 17H00, and we still had to get meat and drinks for the evening.
Once in Dullstroom, some people filled up their bikes, I phoned Trish to say we had arrived, and then drew some money at the ATM, and bought a lekker T-Bone steak, a piece of wors, and 6 rolls, as well as 2 beers, and some milk for tea. All in all it came to just over R100.00.
Once we all had our stuff, we set of for the last stop of the day; Elandskloof.

Elandskloof

The last bit of road to Elandskloof was quite bumpy after all the rain and tyre tracks made in soft mud (which were mostly dry by now). A normal sedan would make it if it rode slowly.
After sorting every thing out at reception we rode the last 4 km down to the chalets and
Lovely little place. I had to pay R125.00 towards my share of the chalet, which was more then reasonable and slept 6 people. I stayed with Brendon and his family, and luv2ride. 
Before dinner we had a quick dip in the indoor swimming pool and jacuzzi.We had quite some trouble getting the fire to start as we had no fire-lighters, but my small pointy knife which I always carry with me, saved the day when I split up some small logs, Bear Grylls style.
The T-Bone, pap made by Speedy Vee, and buttered roll, with some rooster koekies went down well. I don't remember much after my head hit the pillow.
I awoke the next morning, and got up just after 7  and decided to go and take some early morning photos. Some people were up already, and others were still sound asleep.
The morning went quite quick. Speedy Vee made us breakfast with only 4 eggs, but with the bacon and left of boerewors from last night, it fed us chalet dwellers, and about another 4 campers. 


Once we were all packed, we took one final group photo of us all with our bikes by the water's edge, and then set of for a final visit to Dullstroom, where we had breakfast "pudding" at Harrie's Pancakes. I joined the group after completing a geocache. I am glad that I got it, as I needed a "green block" for today.

Elandskloof all the way home.
Tar road: 280 km (took 5H30m including the stops)

After breakfast "pudding", we split up as a group. Some riders wanted the fast way home, over the N4 toll road. It was iamgigglz, bikerMom, The pink Duck and me who opted for the more scenic route home, by using tar road, but avoiding the toll road and sand roads.




A pretty uneventful trip from Dullstroom to Belfast. We got onto the N4 for a few kilometres, and then back onto the R104 to Middleburg.
Somewhere on this road we had a bakkie in front of us, and all of a sudden he left the road, and rode next to the mielie fields. "He must be a farmer going into the fields" I thought. I had not even completed the thought and he was motioning to us to slow down. With this the pot holes started and it got so bad that we also left to "tar" road and joined the bakkie next to the mielie fields. This happened to us another 3 or 4 times till we got to Witbank.
In Witbank I wanted to do an earth cache. It was about the burning coal fields which is the longest burning fire in South Africa. It was also the chance to show group members what "earch caching" was all about. But alas, it was visually a very boring earth cache. I took some photos, and read out aloud the basics of the earth cache, but I think it was all lost on them. Pity. 
From Witbank the plan was to take the N12 home via Benoni, but the GPSr took us home via the N4. This was very confusing to me, as I did not recognise the road, and I had travelled the N12 many times. Three off ramps later I realised what was going on and we took the rural road toward Kendal and Ogies, and got onto the N12. We stopped one last time at the Delmas off ramp. My bum was getting seriously numb / sore by now. My water was still ice cold though, and lekker to drink after the hot ride.
Once at the R21 crossing, I waved the rest of my group goodbye and rode the last little bit in rain home. At least I wasn't soaked when I got home. With hindsight I should have invited the rest of the group over to wait for the rain to pass.


Home
Once home, Trish took all my dirty bike gear and washed it with NikWax, and I added it to the dry rack so it would be ready for Monday morning's ride to work. I also degreased and cleaned my chain, as well as the rest of the bike, and after it was dry, added special wax to the chain again.
I didn't make the Sunday night movie, and was in bed just after 8PM.