Tuesday 7 July 2015

Some thoughts on Wifi coverage

As our resident robins have built a second nest in our shed, I've been doing what I can to improve the wifi link between wifi router and PiCam.

 

My efforts may also be useful for next season (BirdBox 2016), as I plan to install two boxes further down the garden than in previous years.


It is tempting to assume that a powerful router/wifi node will solve all your problems, but I don't think that is the case.


Our garden shed is almost as far from our dedicated PiCam/BirdBox router as its possible to get and still be in our garden (certainly > 25m, but probably just < 30m).

The tiny Edimax wifi dongle used in my PiCam is inside an ABS box, which is inside a wooden shed. The signals between router and PiCam also have to penetrate the wall or double glazed kitchen window.

My D-Link wifi router has three antenna, so it transmits a very good signal.



However, the PiCam just has a dumpy Edimax wifi dongle. Whatever passes for an antenna must be very small and completely contained within the small dongle body. Therefore the transmitted signal is bound to be inferior.

Running a wireless application (that I wrote using Gambas) on the PiCam, I see the following picture.

This show a good quality signal & rate being received by the PiCam

This looks great, and for most computer/router configurations it would work very well. This is because we generally upload small amounts of data, while downloading lots (e.g. request: "show me that YouTube video"). So if our client computer sends a slow request which is received with a few data errors, but receives data fast from the server, we don't notice any problems.

Unfortunately with a Pi camera application like this one, the situation is reversed. The Pi is the server and has a weak transmit signal to the client via the router. So now we have a fast request ("stream me the bird box video") and a slow response (stuttering video).

I have a second Gambas app which scans for local wifi access points. I generally use this on my laptop, and then select a wifi router channel away from the strongest local channels.

If I run this scanner on my PiCam I see BirdBox#3 (my router on channel 6) and a second strong AP about 5 channels away.



Although this gives good results at the PiCam, I need to think about the signal coming back from the PiCam to the router. This is where I need the least competition from signals generated by neighbouring APs.

Positioning my laptop in the house, several metres from the router (BirdBox#3), I see a good signal on channel 6, with other nodes on channels 1 and 11. So its OK to leave this router on channel 6.


To assess the PiCam signal as seen by the router, I just use the router web interface, and look for the attached clients.



The PiCam is IP 192.168.0.3 with a signal of 33%. Not great, but it appears to have a reasonable data rate of 39Mbps. However these readings do fluctuate quite a lot, and my video stream does pause from time to time, so I need to look at any possible ways to improve on this.

For comparison, BirdBox 2015 was about 8m from the router and gave a reading of about 95%.

As the PiCam is currently located inside our shed, it may be possible to use a USB cable to get the dongle out of the camera enclosure (i.e. its not going to get wet, and there will be one less barrier for the signals to penetrate).

Maybe I can also poke the dongle out though a hole in the shed wall, as long as I can keep it dry.

The view from PiCam

I could also move the router back into our garage. The reduction in point-to-point distance would not be huge, but I may be able to reduce the losses currently due to the kitchen window/wall.

No comments:

Post a Comment