If you have made a LoRa-enabled tracker, what you will be interested in knowing next is how to build a LoRa gateway. This gateway will allow you to receive and decode messages sent by the LoRa tracker. We have also made some minor modifications/corrections to the stock software provided by Dave Ackerman to allow upload of messages up to the tracker. This will allow the user to potentially display messages of his/her choosing on an OLED display, for example (Refer to our tracker setup guide for how exactly you might hook up an OLED to the tracker).
What you will need for the gateway:
1. Raspberry Pi with 40 GPIO pins (important so that LoRa will fit (B+/V2/V3 preferred))
2. LoRa board with the same modules as the one found on your tracker
3. Any necessary antennae for LoRa (be they stubby or Yagi)
4. Any 5V, 2A rated micro-USB charger
5. Micro-SD card (preferably Class 10 and 32GB or larger but at least 8GB)
6. Micro-SD card reader/adapter
7. HDMI cable with a monitor
8. USB mouse and keyboard
9. Powered USB hub (only if you are using Raspberry Pi A+ or similar with only 1 USB port)
10. Ethernet cable or USB2.0/3.0 WiFi dongle
Step 1) You will want to get Raspbian on your micro-SD card. You may use Raspbian Lite if you wish but Raspbian is preferable for ease of use. As of time of writing (31st May 2016) the gateway has been fully tested with the Jessie distribution of Raspbian.
There are 2 methods of installing Raspbian. In both cases, a computer is required. For most users, NOOBS is recommended and the guide can be found here: https://www.raspberrypi.org/documentation/installation/noobs.md
For advanced users or users who wish to save space on their micro-SD cards AND are comfortable with using image writing tools, the guide for that can be found here: https://www.raspberrypi.org/documentation/installation/installing-images/
Step 2) Insert the SD card into your Pi and connect all USB devices, HDMI cable and Ethernet cable (if applicable) before powering up the Pi by plugging in the charger.
If you are using NOOBS, follow the on-screen instructions to install Raspbian. If you have used image writing tools, the Pi should automatically boot into Raspbian and eventually display the GUI desktop once boot is complete.
Step 3) Set up an internet connection on your Raspberry Pi. If you are using Raspbian Lite, refer to Step 2 of our tracker guide here.
If you are using an Ethernet connection, it should be automatically connected to the internet via your router. Test this by clicking on the built in web browser on the top left and navigating to a web page of your choice (google.com for example). If it does not work, reboot the Pi with the drop down menu on the top left and selecting shutdown → reboot. If it still does not work, try and turn on DHCP in your router. The steps for this are specific to every router but in general it involves using a computer and finding out the IP address of your router (with ipconfig/all on windows terminal for example). Enter that IP address into a web browser’s URL bar. Log on if required and look around for the setting to turn on DHCP.
If you are using WiFi, click on the WiFi symbol on the top right hand corner and find your network SSID. Click on it and enter any password required. You should now be connected to the internet. Test this by clicking on the web browser in the top left corner and navigating to a web page of your choice (google.com for example). If this does not work, try rebooting the Pi with the drop down menu on the top left and selecting shutdown → reboot. Repeat the WiFi process. If this still does not work, try this : http://www.howtogeek.com/167425/how-to-setup-wi-fi-on-your-raspberry-pi-via-the-command-line/
If you are using a corporate network and experience issues, be it on WiFi or Ethernet, please contact your IT support team for any further steps that you may require.
If you are an Imperial staff/student, please contact the IT helpdesk for further steps that you will need to take, especially if you are using WiFi and trying to connect to Imperial-WPA.
Step 4) You can follow the instructions on this website to setup the rest of the gateway: http://www.pi-in-the-sky.com/index.php?id=making-a-lora-gateway
Congratulations! You now have a working gateway.
Further notes about Gateway
To configure your gateway, open terminal with the icon in the top left corner and type:
sudo nano gateway.txt
For more explanation on what the different options are, refer to: https://github.com/PiInTheSky/lora-gateway/blob/master/README.md
Gateway with upload capability
We will be uploading our code to Github soon. Essentially what you will want to do is replace gateway.c in the lora-gateway folder with the gateway.c from our github. After you have done that, go to terminal and type:
Create a folder for your messages to go to. You may create it in the lora-gateway folder if you wish.
You will then want to configure gateway.txt to set it up for upload. Basically, uncomment everything on the LoRa channel you wish to upload on. You will also want to uncomment the line smsfolder. Type in the full directory of your sms folder there. Do not include any quotation marks. It would usually be /home/pi/yourdirectory or /home/pi/lora-gateway/yourdirectory if you created the folder in lora-gateway.
Your messages need to be saved in the format number.txt (e.g 1.txt, 2.txt, 3.txt … 10.txt … 100.txt etc). The idea is that the gateway will check for 1.txt initially and once it's been found and successfully sent, it will check for 2.txt on the next uplink time slot and so on. This method allows you to store the messages you send on the gateway for review later.
If you wish to change the format or the way in which the messages are formatted/sent, you can open gateway.c in a text editor and edit void TestMessageForSMSAcknowledgement(int Channel, char *Message)
Preparation for actual flight
You may wish to turn on upload to habitat (for telemetry) and SSDV server by setting EnableHabitat=Y and EnableSSDV=Y.
You may also wish to delete any previous telemetry and previous upload messages by clicking on telemetry.txt and deleting it and going to the upload message folder and selecting everything and deleting it. Make sure to go to recycle bin on desktop and deleting everything that went in there as well.
If there are no power sockets readily available at the launch site, you may wish to purchase a battery kit for the Raspberry Pi and some AA batteries to go with it.
Also consider if the area has Ethernet or WiFi connection or if you'll just be using a mobile hotspot should you wish to have internet connection for the upload to habitat/SSDV server. Set up the connection according to Step 3) of this guide (mobile hotspot is the same as WiFi for setup purposes).
And that it it from me. I hope your balloon has a great flight!