Monday 25 February 2013

Psst.. Like freebies and reviewing products? Try Bzzagent

Not sure if anyone out there reading my blog will be interested in this, but I'm going to be taking a break from technology for a moment.

Before Christmas I came across a site called Bzzagent. You register, answer some surveys and then (hopefully) you get signe dup to campaigns to match your likes/interests and get items sent through the post for free for you try and review.

I got my first campaign in Febuary 2013 - Vanish Oxy action.

What did I get?

- 2 x 500g packs of Vanish
- Handful of £1.50 off vouchers for Vanish to give out to friends and family
- Booklet for removing stains
- Information about the campaign
- A rather nice little white cardboard box (yeah i'm pretty sad, I like little boxes and recycle them for sending ebay sales in)

So far I've used the Vanish on my daily washing and saw no difference (half a scoop), however washed a stained old Duvet that I've had for years and it's come out nice and white again. Good job Vanish!

So if you like free products and to review them give Bzzagent a go! You've got nothing to lose :) I'm looking forward to the next campaign already: https://www.bzzagent.co.uk/


2013 Web Design Trends

As part of the other projects that I have, I also undertake web-site design for clients (not just as part of larger projects).

I've had a few clients interested in a new website, but I havne't managed to capture their imagination with any of the designs that they have so far seen.

2013 seems to be the year of the Large Photo Background. People love minimal websites, they're easy to navigate and have very little content for the users to update (and believe me, users hate providing and udpate content!).

I made a few didferent mock-ups using Large Photo Background and bam, caught.

Certainly seems to be a trend that people are loving at the moment. Below are a few of my favourite websites out there suing this trend (working 25/02/2013):

http://www.davidia-int.hr/
Decorating and Architecture - what more do you need to show off these skills than some amazing photos? This type of website certainly seems to lend itself to this indsutry sector and get the most out of what they do.

http://ringvemedia.com/
Travel - we go places to see and experience them, so full photo websites will naturally be the perfect way of showing people what's there. I love the dull cityscape shown, it gives it real feeling.

http://www.davidnolangallery.com/
Art - galleries are all about displaying art, so why shouldn't our websites be an extension of this? This is another one of those sectors that this type of web-design was born for.

http://www.designhousestockholm.com/
Design - Show off your companies items in full-page glory! 

Closing Words
Great you say, these are (nearly) all high-end company/designer websites. Yes, they are - but this trend lends itself to even the smallest of small clients in rural areas. I have one in a remote village, they do boring things. Nothing exciting can get taken from what they do, but their office is in a glorious small village surrounded by fields. Green Fields. Endless Green Fields with a blue sky. That for me, was inspiration as it's best - so you can now guess what it looks like.

Large scale photos, minimal information but something to keep people interested.

Bah bah bah dah dah... i'm loving it


Thursday 21 February 2013

PageGate and SMS Messaging using a USB/3g Dongle

Anyone out there use PageGate? Anyone out there heard of PageGate?

It's another system that I maintain for a client. Basically, it acts as a gateway allowing emails, modems and other things to communicate with it and then forward a text or email on to a specific recipient. 

Why? That's not important, suffice to say it routes hundreds of emails and turns them into texts via AQL. AQLs service has been great so far (thanks guys) but a lot of cash is being burnt by having to pass it through another portal so the decision has been made to send the texts ourselves using a £10 USB dongle.

Thats the plan. Enter Des to make it work.

PageGate does support USB dongles, but it doesn't make it very clear (the product is great, but there are so many things it can do it isn't all documented).

A bit of playing around and yielded the following method:

1: Install and get your USB dongle working in the system
2: Open PageGate admin and go to Connectors
3: Select your connector (1 in my case) and give it an Auto init string and set the Serial Port to the correct COM port number that the dongle is tied to.
4: Now go to your carrier section
5: Add a new carrier and name it (GiffGaff in this case for us)
6: Set the following: Protocol GSM-AT, Baud 11500, Parity None, Data Bits 8, Stop Bits 1, Init String AT+CSQ and click apply
7: Now go to your recipients and create a new one
8: In settings, set the carrier to the one we just created above
9: In ID/PIN enter the mobile number of the person you want the text to go to (this is the bit not well documented!)

That's it - give it a test and you should find your text arrive straight to he mobile device.

It's a great bit of software, the guys at PageGate should be proud especially with V6 our now which I haven't yet tried.

The above is working for me in the UK, so our US cousins may not get the same results. Also, the mobile number that I used was left as an 07 number and NOT changed to an international 44. Does it make a difference  I'm not sure, but it works so i'm not going to find out :)


Update: I saw someone reference this article on the PageGate forum, so will update this with a few points that seemed to confuse them: the SMS messages are sent over the GSM network and do not require a data connection. However, some of the modems you can buy use a protocol known as Hi-Link, which makes the dongle act as a local Ethernet device - this doesn't work correctly with the above as you need the dongle in its traditional operation mode. If you check the manual there are often ways of making the mode operate in this way instead.

Hope that clears a few things up.


Tuesday 19 February 2013

Python, Raspberry Pi and Raspbian (Debian)

I've been doing a lot of development with Python on the Raspberry Pi's, and I just wanted to share a few thoughts from the middle of my project.

Coding Application
When I first started coding I was using nano of the Raspberry Pi, however I have now moved my development on to my Windows based PC. The best light-weight coding application that I have found for Python has been Notepad++. There are many alternatives out there, but I find this works well for all of the different languages that I code in.

IDLE (the real-time editor for Python) I didn't really get on with, and prefer editing the code and then running it afterwards.

Indentation
When starting to work with Python, I was constantly getting thrown by the indentation and lack of semi colons at the end of each line. It's something I came more accustomed with having spent more time coding.

Now, I'm a big fan of the way it works and I prefer it. It forces people to be neat coders and that's something that i'm all for.

GPIOs
I got a Raspberry Pi when they first were released and getting the GPIOs to work were easy enough, but no-where near as easy as it is now.

If anyne has a Raspberry Pi and hasn't yet had a chance to work with the GPIOs I would strongly recommend it. For the main project I am working on, i'm using some ADC cobbler code from adafruit which in turn pulls data from an 8 channel ADC chip. This is mounted on a separate power board which powers our unit.

On a side note, did you know you can power the Raspberry Pi by apply a voltage the 5v pin on the GPIO? A word of warning, if you do this you bypass the built in liquid fuse which protects the board - so be sure to incorporate a replacement into your power board design.

Terminal/Linux Commands
The other great thing I like about Python is being able to pass commands through to the local console of the operating system.

Import os
os.system("something here") 

This allows the command to be sent through to the local terminal - allowing greater control over the system. You can pass reboot commands, turn lan devices on and off - all sorts.

Mix this with a local light SQL server and you can do some pretty impressive things!

Closing Words
That's all i've got to say today, since my last post other projects have risen to the top of my list so i'll be carrying on with the mesh system soon and trying to get DHCP working. 

I had a play with the v3 Google API for it's map system last night and may do a quick write up on here. It's part of this project too, allowing me to plot locations of my Raspberry Pi units on a map of a given area. More about this later!

Saturday 16 February 2013

Bridging ETH0 and WLAN0 for Raspberry Pi Meshing

Following on from my post yesterday, I decided to (quickly) give bridge the ports a go before popping out for the day (it's the weekend after all!)

Everything is pretty much the same as before, except if you are using Raspbian you'll need the brctl tool:

sudo apt-get install bridge-utils

Again, if the above fails its worth doing a sudo apt-get update

Once installed, we use the bridge command thusly if we're following on from my last post:

1: sudo brctl addrbr mesh-bridge 

2: sudo brctl addif mesh-bridge eth0

3: sudo brctl addif mesh-bridge bat0

4: if config eth0 up

5: ifconfig bat0 up

6: ifconfig mesh-bridge up

What you should find is that you now have a working bridge, but like me you probably won't be able to ping your other node anymore.

Not to worry - we've now taken bat0 out of the equation, so we need to remove the IP we set last post

7: sudo ifconfig bat0 0.0.0.0

and then add our ip to mesh-bridge instead. Assuming we are currently on Node 2, then we'll assign it 192.168.2.2

8: sudo ifconfig mesh-bridge 192.168.2.2

and then it all started working again for me. I'm going to start messing around with getting DHCP working next so we'll see what happens.


Friday 15 February 2013

Raspberry Pi, Raspbian, Wireless and BATMAN-ADV for meshing

A project that I have recently been working on has now got to the point where we need to remove some access points and allow Raspberry Pis to do the job for us. 

Why you say? Because they're cheaper (Model A's are £15 now) and also allow more control as the 'router' can also be used for other purposes.

I've used BATMAN adv before in the past, but only through other devices such as Open-WRT routers and Open-Meshs but now it was time to get a mesh functioning for myself.

There is a fair bit of guidance out there, but I found bits missing and nothing quote as straightforward as I was hoping, so the below is my guide to getting two Raspberry Pi units with wifi dongles talking to each other.

1: Download a compiled BATMAN advanced kernel - it doesn't seem to ship with Raspbian. I got it from here. On a side note, Airmesh, where did you go? Your work looked like it was going to be interesting!

2: Install Raspbian to two SD card and boot the Pi's up and login - I won't go into details here as it's been covered oh so many times everywhere else

3: Copy the downloaded file to the following path on both Pi's:
/lib/modules/X.X.XX+/kernal/net/batman-adv/
X.X.XX+ will be your kernal version - there will most likely only be a single folder in there

4: In the above folder, now rename the file to batman-adv.ko (on both Pi's)

4: Run the following on both Pi's:
sudo depmod -a

5: You will most likely need to get BATCTL (batman control) which allows for easier control of BATMAN (again, on both Pi's): 
sudo apt-get install batctl
if it fails, do a sudo apt-get update and then rerun the command

6: Now its time to run batman-adv on both units:
sudo modprobe batman-adv

7: To setup a simple mesh between two raspberry pis, copy and paste the following lines on the first unit:

sudo ifconfig wlan0 mtu 1528
sudo ifconfig wlan0 down; sudo iwconfig wlan0 mode ad-hoc essid my-mesh-network ap 02:12:34:56:78:90 channel 1
sudo batctl if add wlan0
sudo ifconfig wlan0 up
sudo ifconfig bat0 up
sudo ifconfig bat0 192.168.2.1

8: And the following on the second unit:

sudo modprobe batman-adv
sudo ifconfig wlan0 mtu 1528
sudo ifconfig wlan0 down; sudo iwconfig wlan0 mode ad-hoc essid my-mesh-network ap 02:12:34:56:78:90 channel 1
sudo batctl if add wlan0
sudo ifconfig wlan0 up
sudo ifconfig bat0 up
sudo ifconfig bat0 192.168.2.2

9: Check you can ping each other, unit 1 is 192.168.2.1 and unit 2 is 192.168.2.2

10: You can check if BATMAN can see the links by using the originator option
sudo batctl o

And that's it, a basic working mesh. Add more units by copy and pasting the above code and changing the last line (sudo ifconfig bat0 192.168.2.2) to the next IP address (.3, .4 etc)

The above settings will remain until the unit is rebooted, if you need to set it up again after a reboot just following the above from point 6 onwards.

Hope that helps someone

Introduction

My name is Derek - everyone calls me Des (unless you know me from way back when the Internet was young and then i'm Del).

I have a BSc in Computer Studies, an MSc in Computer Networks, a few Microsoft Qualifications and was a full Microsoft Certified Trainer until I decided to let it lapse a few years ago when training didn't seem to be the way forward.

I tried to start a blog a few years ago, but ended up never keeping it up to date as the work I was doing at the time wasn't diverse enough.

Well, I'm now the director of my own company and I've found myself doing lots of different activities  This blog is here for me as much as anyone else. It's a good place to store useful snippets of information that I may come across and want to be able to look at again in the future.

At the moment, my day to day tasks vary between the following:

  • Raspberry Pi Units and Raspbian
  • PHP Development
  • HTML and CSS
  • PYTHON Development
  • MySQL
  • IT Support
    • Windows XP, Vista, 7 and 8
    • Windows Server 2003, 2008 and 2012
    • Windows SBS 2003, 2008 and 2011
    • Exchange 2003, 2007, 2010 and 2013
  • Networking
    • Routing
    • Switching
    • WIFI
  • and everything else in-between
So expect to see posts about any and all of the above, as well as anything else that I decide needs to be shared.

Don't expect things to be in order, I tend to deal with everything one problem at a time.