There are plenty of war stories about getting your LoRaWAN gateway outside. I wanted to share my experience, especially summarising the bits and pieces I remained unsure about after reading Going outdoor with TTN Gateway and Increase your range... here on the TTN Labs pages.
Motivation for the project: I started out with the Kickstarter edition of the TTN Gateway, featuring a 12V wall plug and the default 868 MHz stub antenna. I'm intending to share my gateway with the local community, and it very soon became evident that my range of about 100m around the house was no good for that purpose. The gateway was mounted in a large window of a comparatively tall family home, and getting an external antenna and gaining another two or three more meters by mounting it on the roof seemed the logical next steps to improve the situation. After some intense sunshine in the spring, the case of my gateway melted away, adding a further incentive to prepare the inevitable move to a more durable home.
Challenges and Solution
The schematic shows the original situation and the intended modifications: My TTN Gateway was mounted inside a large window on the top floor. The LoRaWAN signal reached about 100m in that direction of the house, and a miserable 30m in the opposite direction. The plan was (a) to get a better antenna and (b) mount it on the roof.
The gateway requires power and Wifi to work. While I could have kept the TTN Gateway inside the house and simply brought the antenna signal through the wall, I have zero talent and no nerves for drilling holes into our house. If you don't know what you're doing, wasting money on useless kit, counterproductive components or having your gateway killed during the next thunderstorm seemed plausible scenarios for someone like myself. I looked at this for several months, even contemplating flimsy flat cables to bring the antenna signal through the window and such. Ultimately, I opted for good signal over convenience. That meant bringing the gateway outside. The Wifi can easily get there, meaning that power supply and weather protection posed my two biggest issues.
Thanks to gentlemen like BoRRoZ and BjoernA, I was soon convinced that a good antenna doesn't necessarily have to be expensive, and that the odd SMA-to-BNC adapter is cheaper than anticipated. I resorted to a waterproof box (after learning that things like cable glands exist, and how to use them), and decided to supply said box with 220V from a rain-protected outside mains socket, which I convert to 12V with a stabilised power brick for LED rails. Thus, relying on the existing Wifi in the house, I didn't need to drill any other holes than the ones needed to physically mount the antenna on the roof.
Components / BoM
To make a long story short, I got away with
Aurel GP 868 MHz incl. 3m cable (e.g. from Conrad)
SMA-male to BNC-female (e.g. from Conrad)
Spelsberg IP66 case 182x180x90 (e.g. from Conrad)
2x M20 cable gland (e.g. LappKabel Skintop, from Conrad)
2x M20 locknut (e.g. LappKabel Skintop, from Conrad)
12V 1A AC/DC (e.g. from Conrad)
power cord with IP44 plug (e.g. from Conrad)
Yes, I'm aware that this is more than what I could probably have paid (a) buying from other vendors or (b) buying an outdoor gateway in the first place, but where's the fun in the latter, huh?
Gutting the TTN Gateway
At this stage, I assume you've lost your fear of propping things open. The white lid of my TTN Gateway came off rather voluntarily, giving sight to the green PCB with its LoRaWAN goodness and blue shiny lights.
If you haven't done so already, disconnect the gateway from power and unscrew the antenna. The next step may differ for you, because my case had previously melted away and taken a weird shape. I had to use a bit of force to break the PCB out of the case, taking extra care not to bend the PCB and not to do any harm to the pigtail antenna connector, which is needed to connect the external antenna to the gateway.
The image shows the working PCB in its new home.
You need two openings in your outdoor case, one for the antenna cable, and one for the power supply. The cable glands are pretty self-explanatory, but I hadn't even known that they exist until I was told... First, you punch out the M20 holes from your box (mine just needed some encouragement with a light hammer and a screw driver). You then tighten the cable glands to the box, using the locknuts on the inside of the box. Then you thread your antenna and power cables through the cable glands. I left the tightening until I was satisfied with the final arrangement. Note if you're using the same components that I've proposed, the antenna cable connector on the antenna side fits through the cable gland, whereas the gateway facing antenna connector doesn't. Hence, first fit the antenna cable through the gland, then connect it up to the antenna. Make sure you're leaving enough antenna cable inside the box for the pigtail to connect it to the PCB, and sufficient power cable to allow yourself a bit of space when connecting and placing the AC/DC converter.
Note: I'm the last one who should give advise on dealing with potentially deadly electricity. I'm describing here what I did. This is not to encourage you to try anything stupid, in case you're not sure if you should or shouldn't...
Use a voltmeter to check the polarity of the 12V wall plug that came with the TTN Gateway. I decided to use the same barrel adapter for convenience, cutting it off the wall plug with about 10cm of cable remaining at the barrel. There are screw connectors on both the 12V and 220V ends of the power brick. First, connect the 220V terminals, then check for polarity on the 12V terminals, and make sure you can replicate the barrel's original polarity. I opted for a three-wire power cable because of the IP44 classification of the plug. The third wire is not needed, and I isolated it with electrical tape. While the power brick is rated 1A and less than the wall plug that came with the TTN Gateway, in practice this hasn't made a difference.
Connecting the antenna
Using the pigtail adapter that was previously needed for the stub antenna, the TTN Gateway PCB can connect to the BNC cable of the Aurel GP via the SMA-to-BNC adapter. I was a bit worried that the connection from antenna to BNC cable, from BNC cable to BNC/SMA adapter, from BNC/SMA adapter to the pigtail, and from the pigtail to the PCB would result in considerable signal loss. That may be. However, in the light of my performance improvements I'm absolutely happy with the current solution.
Closing and mounting
Before putting the TTN Gateway back into action, place the power brick and the PCB in the waterproof case. Make sure there are no free wires and that the connections cannot become lose. The PCB can be screwed to the case, however, I resorted to Blu-Tack to keep bits and pieces in place. I gave the gateway a test run before finally putting in the screws that seal the case.
I attached the antenna to a piece of scrap metal, which I bent to fit our roof.
I went for a few walks with the TTN Mapper app, using an Adafruit Feather LoRaWAN board and a simple 8.6cm wire antenna as test equipment. I was only interested in maximum range at SF7. With just a 100 EUR investment and two hours of my time, I managed to increase the reach of my TTN Gateway from a 130m semi-circle to an area of about 2x3 km.