Radio Remote Decoding

This article is about decoding radio remote controls using Arduino or similar hardware and a cheap 433Mhz radio receiver (£2 on Ebay) and was written to serve a purpose: NONE of the existing libraries I could find out there managed to detect all of my radio remote controls.

Cheap radio remotesI’m interested in adding radio remote for mains control to my house control system which is basically an Atmel 1284 chip with Ethernet and radio network.  Although it is easy to make a remote switching unit that will be part of a network and control mains lights, it is overkill and it is also quite difficult to find dirt cheap mains to 5v supplies to go into one of the limited range of plug-in-the-wall project boxes along with a controller and a relay.

With that in mind I started to look at the many mains switch remotes available out there. These generally work using simple 433Mhz radio receivers and accepting a code which could be almost any length but is normally somewhere between 10 bits and 50 bits.. the encoding techniques vary. Generally speaking these do not use any kind of “rotating” encoding for security and simply use a block of data, repeated as long as you hold the remote button.

BUYER BEWARE: If you want to control lighting using plug-in-the-wall 433Mhz controllers you should be aware of two things…

[a] the cheap controllers you find in the likes of B&Q use a single frequency which is EASILY blocked by other, similar transmitters.  I found when experimenting with a radio link at 433Mhz that it was easily blocked just by holding a button down on a mains remote controller.

[b] I found a nice cheap set of these plug-in-the-wall mains switches at ALDI recently, 3 remotes and a handset for £10 – what a bargain – but then looking at the fine print – you “train” them by turning them on and pressing a handset button within a few seconds – and that’s fine.. but, I thought, what about power cuts? Sure enough – you have to re-train them every time. What idiot came up with that brilliant idea? Going around the house re-training remotes every time the power fails? Surely not?  But I tested them and that is how they work. They are boxed up ready to be returned – not “fit for purpose”. That is, to be fair, the first time I’ve come across this but if you order online – beware!

ReceiverOk, so what could be difficult the handset lets out a 433Mhz modulated signal when a button is pressed – and the mains blocks pick up this signal, decode it and turn the plug on or off – so all you have to do is read the signal coming off the handset and use Arduino (or PIC etc) existing libraries to record and play back, right? Wrong – I had at least two handsets that use a code which was so long the existing learning libraries could not handle them AT ALL.

Eventually after much reading and learning I decided to do my own thing.

Scope with noise from radio receiverSo, easy enough, (both the transmitter and receiver which I’ve linked to below have ground, power and signal leads – nothing else – the receiver appears to have two signal leads but they are connected together – you need only use either one) assuming the output of the simple receiver is LOW on standby, press the remote and look for the start bit – capture the length of each change of state until the end?  Right?

Well, no… the package is sent over and over – so you have to look for gaps between packages. Easy? Well yes except for AGC – automatic gain control. When the receivers are receiving “nothing” they get more sensitive and in my office the spikes coming out of the output were horrendous. I tried ignoring narrow pulses with limited results then I twigged.. if you run the remote control near the receiver – the noise goes away as the AGC (automatic gain control) kicks in…

433Mhz transmitterSo – press the remote control button – THEN start scanning – and store the gaps between pulses – say, 300 of them.  I did this with some REALLY simple code looking for high and low using the micros() function in Arduino (millis() is way too course) and keeping the code tight by simply storing the actual value of MICROS() in a long array.. ok not efficient but for temporary storage it works and I can get consistent results.

I discovered that all the controls send repeated packages with a short absence of signal in-between. Given the noise issue, the first package often gets scrambled – the breakthrough came when analysing the stored values and realising the solution is to search for the first repeat – i.e. after the first BREAK –hence ignoring the first package – previous attempts to use that had yielded varying results at the start of the package. By the time the second package kicks in the AGC has adjusted and the noise has all but gone.

So this would give me an output like this typical one from a handset.

tmpBFEC

They vary of course in length (not from key to key in that case just the order of bits varies) but from handset manufacture to another model or manufacturer).

What I did notice were pairs of zeros… ie pulses twice the width of others. On reading up this is called Manchester coding (or a variation) – I chose to ignore this – but knowing there will never be more than TWO different pulse widths helps a lot… in reality I realise that there is only one period in this type of encoding.. see this for pictures and explanation if you are interested. http://en.wikipedia.org/wiki/Manchester_code

As you can see from that link, the clock and data are encoded into the one signal.

But for my purposes it’s really NOT important to either understand or use this knowledge. All that is necessary is to send that stream out – fixed width per pulse as per the original and if there are two identical adjascent values (ie 00 or 11, detected by longer and shorter pulses compared to a fixed value indicated by the first pulse) then obviously you simply send the status quo to the output bit for twice the length of time.

But this uses up a lot of storage.  Looking at various handsets I discovered the largest signal seems to be around 40 or so bits… I made up a 12-byte array and wrote a routine to bit-shift the entire array by one bit – hence allowing me to convert the string above to a more sensible set of bytes.

image

In addition I added a byte at the start which represents the width of the basic pulse – as this could be as high as 1200us, I divided this by 10 to fit into a byte. In the example below you see 33 added to the start – ie 330us pulse width. On experimenting, that slight loss of accuracy seems unimportant and it saves a byte.

tmp4A7F

And so for any given button – we now have 11 bytes (in this case) to encode it. I decided that was GOOD ENOUGH.  A little routine to read from the end backwards, sending out pulses (or no pulse) for the duration specified in the first byte – VOILA I was accurately switching mains lamps on and off via my cheap transmitter.

Most of the code is unique, some bits are variations on stuff I found on the web (thanks to all who’ve taken the time to put their ideas up on the web) – and is provided here UTTERLY without support – no comments on styling please – if you’re having trouble reading radio remotes for your purpose – I hope this is useful.

The transmitter and receiver are here

http://www.ebay.co.uk/itm/433Mhz-RF-Wireless-Transmitter-Receiver-Set-NEW-/131093418464?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item1e85c6d1e0

Change input and output pins to suit your project – any pin will do, if you get nothing having pressed your remote then sent A to the board via the Arduino serial monitor, then try messing with INTER_CMS-MS and MIN_POS_WIDTH but I suggest not before you do that, you check with a scope that something is actually coming in.

Clearly in any end gadget you make for your use, you’d not include the learning part or it’s huge TBUFF array. When I get a minute I plan to come up with a means to simply store the data in EEPROM and read from that…  mind you – if you use a 1284 chip instead of the old 328, memory isn’t quite the problem.

If you need more range, you could consider putting the transmitter (NOT the receiver) on a higher voltage up to 12v. I tested mine at 12v and the signal from the 5v logic still worked perfectly. The increase in range is noticeable – I’d say 50% better coverage.  If you blow up your board however, that’s your responsibility – don’t come back to me…

This is all suitable for short bursts to control stuff – don’t get any ideas about continuous home control signalling unless you can guarantee there are no other 433Mhz transmitters in use! I went down this route before realising it’s a non-starter and am now looking at the slightly more expensive frequency hopping chips for more sophisticated use – but if all you want to do is turn something on and off – this could be for you.

 

// I used a simple 433Mhz tx and RX pair - 1 pin each needed. Output of radio assumed 1 when something there ie active high
// No interrupts or clever tricks used
// Using F() in strings merely to keep RAM down, and PROGMEM for arrays - that's the data you see on the serial display for one particular button press... 
// Could store this in EEPROM or whatever... for now could get a lot of these for a particular application into ROM without using up precious RAM
// None of the PROGMEM stuff is essential - just there to minimise RAM use
// Coding Peter Scargill June 2014. www.scargill.net

#define PIN_DATA_IN 2
#define PIN_DATA_OUT 11
#define SERIAL_SPEED 115200
#define INTER_CMD_MS 100
#define CMD_REPEATS 5
#define COMPRESSED_ARRAY 12 // assume that's enough
#define MIN_POS_WIDTH 200 // used before we have the period - assumed minimum acceptable PERIOD less than which we ignore - in Microseconds
#define MAX_NEG_WIDTH 2000 // assumed maximum acceptable ZERO state in uS above which is assumed a gap between blocks of data
#define READINGS 300 // For temporary storage while learning, need 4 bytes per reading... so WATCH OUT - 328 only has 2k of RAM
#define TIMEOUT_VALUE 3000000 // Number of microseconds before we give up the ghost - ie 3 seconds - likely won't happen due to noise

// Byron reports 39us*10 for period - didn't work - so I put in 59 - works a treat.

const byte g0[]PROGMEM={59,77,211,36,73,146,52,73,210,52,1}; // Byron D2on
const byte g1[]PROGMEM={59,217,150,109,217,178,45,91,18};
const byte g2[]PROGMEM={59,219,182,109,217,178,45,91,18};

byte tbuf;

byte arr[12];

// Used to set a timeout
unsigned long start_time;
unsigned long timeout;
unsigned long current_time;

unsigned long calc;

// Stores all the values read here
unsigned long readings[READINGS];
int current_reading = 0;

// Collect serial data into an array - or timeout as you prefer
void readRadioPulses()
{
    for (int a=0;a<COMPRESSED_ARRAY;a++) arr[a]=0; // wipe the eventual storage array
    for ( current_reading = 0;  current_reading <READINGS; current_reading++) // store enough values for 2 or more packages - as long values for speed
    {
        // Waits until the input goes HIGH 
            while (!digitalRead(PIN_DATA_IN))
            {
                if (micros() > timeout) return;
            }
        // When the first value comes, save that period
        readings[current_reading] = micros();
        digitalWrite(13, HIGH);
        // Wait until the input goes low

            while (digitalRead(PIN_DATA_IN))
            {
                if (micros() > timeout) return;
            }
        current_reading++;
        readings[current_reading] = micros();
    }
}

void shiftArray(int x) // move the entire array toward the highest offset by 1 bit and add least new significant bit to offset 0
{
  for (int a=sizeof(arr)-1; a>0;a--)
    {
      arr[a]<<=1; arr[a]|=(arr[a-1]&128)>>7; 
    } 
  arr[0]<<=1; arr[0]|=x;
}

// Sends the data to the serial port
void displayRadioPulses()
{
  int speed;
  byte pickone=0;
 
  for ( current_reading = 0;  current_reading < (sizeof(readings)-1); current_reading++)
    {    
      calc=readings[current_reading+1]-readings[current_reading]; 
      if (((current_reading&1)==0)&&(calc<MIN_POS_WIDTH)) { current_reading++; continue; }      
      if ((calc>MAX_NEG_WIDTH) &&((current_reading&1)==1)) { pickone++; if (pickone==1) speed=readings[current_reading+2]-readings[current_reading+1]; }
      if (pickone==1) // extract string here
          {
          if ((current_reading&1)==0) 
              { 
              if (calc>(speed+(speed/2))) 
                    {
                    Serial.print("1"); shiftArray(1);
                    }
                Serial.print("1"); shiftArray(1);
              } 
              else 
              {
                if (calc>(speed+(speed/2))) 
                  {
                    Serial.print("0"); shiftArray(0);
                  }
                  Serial.print("0");  shiftArray(0);              
              } 
          }
    }
  Serial.println(""); 
  Serial.print(speed/10); Serial.print(",");
  for (int a=0;a<sizeof(arr);a++) { if (arr[a]) { Serial.print(arr[a]); if (a<(sizeof(arr)-3)) Serial.print(",");  } }  Serial.println("");
}

void sendRadio(const byte *m, int sz) // can't do sizeof a PROGMEM array so just pass the size
{
   int scount;
   int offs;
   int period;
   byte tmp;
   period=(int)pgm_read_byte(m)*10; // get the first value, multiply by 10 and that is your period
   for (scount=0;scount<CMD_REPEATS;scount++)
     {         
       for (offs=sz-1;offs>0;offs--) // start at the end and work backwards not including offset zero which is the (period/10)
          {
          tmp=pgm_read_byte(m+offs); Serial.print(".");
           for (int r=0;r<8;r++) { if (tmp&128) digitalWrite(PIN_DATA_OUT,HIGH); else digitalWrite(PIN_DATA_OUT,LOW); start_time=micros()+period; while (start_time>micros()); tmp<<=1; }
          } 
          Serial.println("");
        digitalWrite(PIN_DATA_OUT,LOW); delay(INTER_CMD_MS);
     } 
}

// Listens to SERIAL for inputs A=read, B=write demo - when reading press and hold handset FIRST
void SerialRequest()
{
   char c;
   while (Serial.available()==0);
   c=Serial.read();
    if (c=='A')
      {
        start_time = micros();
        timeout = start_time+TIMEOUT_VALUE;
        readRadioPulses();
        displayRadioPulses();
        Serial.flush();
      }
      
      if (c=='B') // try the example compressed code which includes (period/10) as first byte - can be any length
      {
       sendRadio(g0,sizeof(g0));
      } 

     if (c=='C') // toggle 2 codes back and forth for range testing
      {
       Serial.print(F("Test toggling..."));
       for (int a=0;a<200;a++)
       {
         sendRadio(g1,sizeof(g1));
         delay(1000);
         sendRadio(g2,sizeof(g2));
         delay(1000);
       }
       Serial.println(F("Done"));
      } 
}

void setup() // set serial speed, set output for the radio output - and put something on screen to show it's working - use built-in F() to save RAM
{
    Serial.begin(SERIAL_SPEED);    
    pinMode(PIN_DATA_OUT, OUTPUT);    
    digitalWrite(PIN_DATA_OUT, LOW);
    Serial.println(F("Send A to check or B to send example in PROGMEM"));
}

void loop() 
{
    SerialRequest(); // I could have just put the lot in here really
}

The Mighty 1284p

The 1284p is the next step up from the ATMega328 chip powering many of the “Arduino” type microcontroller boards and their many clones.

Why another chip? Well, anyone who has used the ATMega328 knows that it’s a great controller chip but the lack of RAM soon gets very tiring. Also if you’re messing with things like Ethernet and maybe you want a Real Time Clock, perhaps access toSD memory, the libraries have a habit of filling your FLASH memory much faster than you’d like.

1284p chipWhy the 1284p? That’s simple – there are only so many of these chips in DIP format – that is the old 0.1” pin format that is easy to use for prototyping – the other upgraded chips are surface mount and a PAIN to solder.

The 328 chip has 32Kbytes of FLASH (for your programs), 1K of EPROM (for storing data permanently) and 2K of RAM (for variables). The likes of the Ethernet code EATS up the RAM in no time. Finally, it’s also quite easy to run out of Interrupts and port bits.

Don’t get me wrong, the 328 is a great general purpose chip but it has it’s limits. A  problem with many other chips is the cost – by the time you’ve finished you may as well have bought a Raspberry Pi and the idea surely is to keep costs low.

Well, the 328 can be as cheap as a couple of pounds or so… and the 1284p can be had for double that. What do you get for your money?

  • 128K Flash (ie 4 times as much)
  • 16K RAM (ie 8 times as much – MOST welcome)
  • 4K EEPROM(4 times as much)
  • 32 pins as against 23
  • 3 interrupts as against 2
  • 8 analog ports as against 6
  • 2 UARTS as against 1

As you can see in the diagram above, putting together a prototype board is a snap (provided you have a TTL-USB converter which I use for all my kits.)

Here is the information you need. If you’re starting from scratch you need the Arduino IDE, the TTL to USB converter (for programming) and a few bits and pieces for your prototype – information for that is all here.

tmp4AFFFollow instructions and you get this on your IDE bottom right when you’ve set the right board..

The standard BLINK test which flashes a LED once a second, when modified to use output 16 – will flash physical pin 22 on and off as per my photo demo above.

Thanks here to Aidan Ruff for pointing me in the right direction and supplying the test chip – which will soon end up in some long-abandoned project (because I ran out of room in the ‘328). Magic.

To be or not to be

To fly the British flag…

tmp24B5

or not, that is the question.

image

In this case, NOT, I think! Major difference – British version has yellow jumper and costs over 3 times as much.

You can see this on Ebay over and over again – it would not be so bad if you felt you were buying a quality British product – but they’re the SAME THING.

Arduino as a Keyboard–working example April 2012

One of the things I wanted to do right at the beginning of learning about the ATMEL microcontrollers (Arduino etc) was to make USB devices – that is, devices that appear to a PC as a USB gadget, for example a keyboard. There are many uses for such devices if they are simple and cheap enough – a little box to insert your username and password for example or to time an operation regardless of what package the PC is using – sky’s the limit, if you can do it.

Sadly when scouring the web for the necessary library I first found stuff that was frankly "academic" by which I mean so incredibly complex you were losing the will to live trying to do something really basic like "hello world".  Some people really haven’t grasped the idea of creating “re-usable components”.

Then I hit on what looked like pay-dirt. A general USB library – including a keyboard library that needed just a few lines of code to make a “hello world” keyboard emulator for example. Well, of course, it didn’t work that way, the library was written in 2008 and NO WAY would the code compile in the current 2012 Arduino IDE… I ended up abandoning the effort, disappointed.

Then this evening, I’d given up for the night and was reading "Practical Arduino by Jon Oxer" (I know, sad but hey, this is how I learn and how I get to sleep, using my spare moments to read up on the technology) and I noticed the same library again… sure enough, I followed the link, grabbed the library and sure enough, it failed to compile.

And then I looked at the bottom of the web page, a little note from 2010, some minor changes. I keyed them in and VOILÀ  – code compiled… so much for the early night. I got out of bed, grabbed a USB lead, ripped it to bits and added the extra components and, taking my life into my hands, plugged the lead into my USB hub. After a few second’s silence (which seemed like ages waiting for smoke to appear) the PC announced a new keyboard had been plugged in. Wheeeeeeeeeeeeeeeee.

tmp7E03The software listing indicated I should short an input to ground on the board… and sure enough "Hello world" appeared in Notepad on my PC – problem solved.

So, what to do – if you’re reading this far, chances are you were looking for a solution. You’ve found it… This is April 2012 and the software works in the current Arduino IDE.

So – first things first – grab the library here.  The layout is weird so don’t just dump it into Arduino as-is. Take the keyboard directory and put it in your Arduino library directory. Grab the keyboard demo file – and if you try to compile it will fail. Make the trivial modifications as detailed at the BOTTOM of this page…and you’re up and running.  Note that you have to use pins D4, D5 and D2 – you can’t go changing pins… and on that same page are instructions – I basically took a standard USB to mini-usb lead, chopped off the mini end – which left me shielding and 4 cores.

tmpCF8BThe shielding I ignored and there are black (ground), red (5v), white (D-) and green (D+) leads..  you must add in the trivial components (I did it on a bit of Veroboard which include a couple of 68r resistors, a 2k2 resistor and a pair of 3v6 zener diodes – they MUST be small – ie 1.2 or 1.4w – as the larger ones have more capacitance and may hinder the USB.

I used 3v9 zeners as I had them handy but DON’T COPY ME – just because my hub has not blown up yet doesn’t mean to say it won’t.  Use 3v6. We’re talking pennies for these components unless you go to Maplin.

So to test the USB keyboard software I used a fully formed Arduino (well, my own UberBareBoard as detailed elsewhere).. but really all you need for this is the chip, an Xtal or ceramic resonator, a decoupling 0.1u cap and… erm, that’s it, oh and a 10k pull-up for the reset.. you really could make a TINY board to do this. Oh, I guess you really need a pretty LED light as well, just to prove it’s on.

That’s it, it really was THAT simple – from getting off my backside and turning the soldering iron on to having “hello world” on the screen took no more than 15 minutes.

Now the fun starts – coming up with applications for this.

Much Cheapness

I’ve christened this version of the Arduino “CheapDuino” – I do hope someone hasn’t registered the name…

The idea here was to see how cheaply I could put one of these together for and find out how easy or otherwise it might be. The “Veroboard” was the most expensive and that’s because Maplins make an obscene mark-up and I was desperate. I’ve a load more coming from China but I could not wait (usually takes around 2 weeks).

CheapDuino

What you see above (excluding the green Ethernet board on the left which is yet to be mounted) is a working Micro. I’ve put a few of these together and this is pretty much the minimum that is practical to use. Firstly, you can never have enough ground connections so I’ve put 3 of those, 3 of the 5v connections – and a 3.5v (approx) out as many peripherals run on 3v3 or thereabouts (like the Ethernet board). There’s an input pin over on the right.  I had to cheat a little – there are 3 wires and one decoupling cap underneath (for the 3v5 output).  If I’d had SLIGHTLY wider board I could have gotten the lot on the top. The board came with split track which made life easy – I had to cut only 3 tracks underneath.

This board ( call it Arduino but in fact all it has in common is the same BOOT code and compatibility) when it’s done will form the controller part of my Internet Thermostat (the other part has a similar micro and an LCD display but draws power from the main board, fed only by a 4-core telephone lead).  As to costs, you’re probably looking at £8 tops if you avoid Maplin for the board… the Atmel 328 chip was the most expensive item, £2.99 un-programmed and I’ve put together a simple programmer which simply fastens to the 60way connector on the (unpowered board) to flash the chip – once done all it needs is a 9v plug-in-the-wall and an Ethernet connection.

Things have come along – but only recently – since I used to play with PIC chips many years ago (I still have an award stuck on the wall) it seems people are still messing with those things – and until recently the libraries of code for the Atmel were pretty dire but today, with a little R&D it’s quite possible to perform miracles with these – talking to the Internet is one of them – add in the cost of the Ethernet board from China and you’re still not much over £12 – which puts this in a different ballpark to the likes of the Raspberry Pi (if Farnell ever get their act together).

This little fellow has some work to do before it ends up in my main project – I need to test the WATCHDOG and several other things to see how reliable they are – but it’s nice to know that you can knock something like this up in maybe an hour if need be at very low cost.

For reference, the unit has 32K of Program memory, 2K of RAM, 1K of EEPROM and  host of timers, A/D convertors, hardware interrupts etc all thankfully made pretty easy to use thanks to the freely available Arduino IDE. Oh, and 13 digital lines and 6 analog inputs….

My New Home Network

I’ve been using the same network I put together from cast-offs over 10 years ago when we moved into the village and we figured it was about time to bring it into the 21st century.

Armed with a budget of £300 I went off onto the web in search of new kit – and I’m very pleased with the end product… The system includes Gigabit wired networking, 80211n multi-point wireless and load balancing/fall-over protection in case my primary service provision fails and to share out the load a little when the grandkids are over hogging bandwidth. I’ll explain this….

Vigor 2800vgBut first, the starting point… when we moved over here into the countryside 11 years ago I was on a budget, having spent a bomb kitting out my home office, I simply bought bulk networking cable, a bunch of connectors and I was very lucky to get some second hand ADSL router kit from friends. One of those routers is the Draytek Vigor 2800vg which of course is too old to handle modern high speed 802.11n wireless but which has MORE than done it’s tour of duty over the years and is still an excellent and supported router.

I’ve had access to all manner of ADSL modems and most of them by comparison to the Drayteks seem “amateur”.  I ended up with 3 of these and a Netgear unit giving 4 access points around the house – I also had Orange Wireless but that was so bad I turned it off. The Drayteks have all SORTS of useful tools that other kit simply doesn’t have – like decent bandwidth monitoring facilities, VPN, interchangeable aerials (I had WAY oversize aerials on my main unit to get more range).

Why so many routers/access points? Well, our house is a cottage and it’s built out of lots of VERY thick stone – WIFI just does not go through this stuff so you might have a great signal in the living room – walk around the corner to the kitchen and it’s gone. Also as we’re on one floor the distance from the kitchen to my office is quite large.  So one Draytek router acted as the ADSL router and access point (wired and wireless), the others as simply switches/WIFI access points. I also had a dedicated 16-port switch as I have lots of kit to plug into when I’m doing a bit of R&D. The two main machines and my NAS drive (network addressable storage – i.e. a black box with 2 disks in it) are all connected together by wire as WIFI is too slow for some operations – like moving massive files back and forth.

We have Internet access via the organisation I work with – and we also have Orange Broadband. Why the latter?

Orange rubbish access pointWell, I would not use Orange by choice but as we had a house phone line and Maureen has an Orange phone, they gave us broadband for a fiver a month – can’t really say no to that especially as it gives her free calls to Orange mobiles (the kids). Both broadband setups are limited by the BT cables here in the village and give around 6.5Mb/s download and around 500Kb/s upload. The Orange router is that big grey thing on the left and it’s useless, not reliable at all but I recently found that by sticking a timer on it so it resets overnight – it becomes reliable. Not much use however without some kind of automatic fall-over if it’s in use at the time (backups etc). We were going to upgrade this until I saw the reviews of it’s replacement on Amazon – voice after voice slagging off Orange for supplying the new unit – so – stick with the devil you know.

I’d been using a software switch on our computers to select between the two networks (main network and Orange backup) to try to do some kind of load balancing -  but of course that doesn’t work on mobiles which don’t support the software etc. and it’s manual and  “fiddly” so I included provider switching in my goals for the upgrade:

  • Faster wireless
  • Faster wired connection
  • Better coverage
  • Some kind of automatic switching/backup/fall-over

We have Apple TV and my videos and music etc. are stored on the NAS unit  so speed of connectivity is important – a request from the TV has to go off to Maureen’s computer – which gets the video from the NAS box and pipes it back to her computer and on to the Apple TV… it doesn’t take many bottlenecks to mess that up.

Well, I ordered the replacement gear and the first stuff that turned up was the cable (of interest I used CABLING4LESS – they seem pretty good and delivery was quick) – I chose ready-made lengths of CAT5-e (why not CAT6? From what I can read it’s for perfectionists and the price difference is high – I also had some decent cables which were gigabit-certified and wanted to use those).

Ok, back up a second – what’s the difference between the cables? If you look at your average network lead, there are 8 connections at each end. Cat-5 only uses 4 of them – whereas Gigabit networks need all 8.  So to have a Gigabit network your modem, switches and cabling all need to be updated to CAT5-e or better. But the cable is cheap -  I think I spent £30 in all.

I bought a range of colours of Cat5-e cable and started checking to see what needed replacing. The first shocker came when looking on the roof at some of the original cables put in place a decade ago – totally SHOT. I’ve never seen cable disintegrate so quickly on touch! Amazing what several years of even British sunlight can do.

So it quickly became a gutting operation – all but one grey lead (which miraculously is in perfect condition 11 years on AND is certified for Gigabit operation – as it spans the building I was quite relieved not to have to throw that one away).

Draytek Vigor 2830nNext stop the main ADSL router. I did my homework and I’m fairly confident I picked the best of the lot – the new Draytek 2830n. This really is a winner -  with dual inputs (3 if you include the ability to use a 3G dongle as a backup -  but we’ve no 3g in the village so that’s redundant), 4 Gigabit ports, multiple LANS, multiple VPNs… load balancing.. name it and it’s got it – well under £200 from Amazon. Took around half an hour to get that running with the existing kit – which includes a 16-output switch in my office for the various gadgets.

First things first – the 802.11n higher speed WIFI claims better speed and better range and I noticed a marginal improvement in range almost tmpEA80immediately. That’s at ONE end of the building. I then fitted a TP-LINK TL-SG1016D 16-port Gigabit switch to replace the old switch to give me some more connections – one of which attachés to the lead which goes right across the building to TP-Link 5 port unmanaged switchanother, smaller new unit, the TL-SG1005D 5-port Gigabit switch – which then feeds Maureen’s computer, the Apple TV and a new TP-Link 150Mbps Wireless N Access point at the far end.Tp-Link 802.11n WIFI access point The large switch indicates what speed the connection is running (10/100 or gigabit) with green indicators which is great.

Finally I had to wire the Orange ADSL unit all the way back to the Draytek second input and make sure the Draytek was aware of the incoming Orange network. Interestingly I had a problem in that I wanted to keep the same DNS (domain name lookup) – and the only one I could find at first was OPENDNS -  but they charge if you have more than one incoming IP address – I resolved the problem eventually by forcing the network to use GOOGLE’s DNS servers (8.8.8.8 and 8.8.4.4) and up to now they are working a treat.

For Wireless I gave both units the same name – ensuring they were using completely different wireless frequencies which are ALSO distanced from the frequencies used by neighbours.

The result  – even the iPad now works seamlessly anywhere in or around the building. The overall range is WAY better – but now needing only 2 wireless units and not 5.

Apple TV works smoothly – and having set up the Draytek to work from the main ADSL line, falling over to Orange (tested by simply pulling the broadband line out – operation continues more or less seamlessly, the only change being the external address changes of course) it’s all working a treat, no failures, drop-outs etc. – and all the kit is green – keeping power usage to optimum levels (this if often overlooked – the cost of running this stuff mounts up as it’s on 24-7).

I’m currently running scheduled backups to the NAS using GOODSYNC – and cloud backups using bandwidth-restricted LIVEDRIVE (that’s a long story) with unlimited backup, consuming around 100Kb/s of my 500Kb/s upload bandwidth to keep 2 computers constantly backed up in the cloud – but because of the dual-WAN setup I’m managing to split that – one machine backs up to my main ADSL, the other backs up to the Orange ADSL – all works a treat…  and hence leaving plenty of upload bandwidth for Skype on either (though one could always make use of more precious upload bandwidth). More detail as time permits – if you Google these products – all I can say is they work for me…. older kit will be on Ebay presently…