Next revision | Previous revision |
guides:lora_tracking_guide [2016/06/20 18:29] – created daveake | guides:lora_tracking_guide [2016/06/20 23:25] (current) – daveake |
---|
* MOSI MOSI | * MOSI MOSI |
* MISO MISO | * MISO MISO |
* NSS CE0 (CE1 for 2nd module) | * NSS CE0 for module 0, CE1 for module 1 |
* SCK SLCK | * SCK SLCK |
* DIO0 Any free GPIO pin | * DIO0 Pin 22 (BCM 25, WiringPi 6) for module 0, Pin 36 (BCM 16, Wiring Pi 27) for module 1 |
* DIO5 Any free GPIO pin | * DIO5 Pin 18 (BCM 24, WiringPi 5) for module 0, Pin 32 (BCM 12, Wiring Pi 26) for module 1 |
| |
Or you can [[https://store.uputronics.com/index.php?route=product/product&path=61&product_id=68|buy a board designed for the task]]. | Or you can [[https://store.uputronics.com/index.php?route=product/product&path=61&product_id=68|buy a board designed for the task]]. |
Install Raspbian on an SD card as usual, and boot the Pi from it. Then run: | Install Raspbian on an SD card as usual, and boot the Pi from it. Then run: |
| |
* sudo raspi-config | <code>sudo raspi-config</code> |
| |
and enable SPI. | and enable SPI. |
If you are using Raspbian Lite (recommended if you are dedicating the Pi to this task so don't need the X desktop) then you need to install git: | If you are using Raspbian Lite (recommended if you are dedicating the Pi to this task so don't need the X desktop) then you need to install git: |
| |
* sudo apt-get install git | <code>sudo apt-get install git</code> |
| |
Install WiringPi as follows | Install WiringPi as follows |
| |
* cd | <code>cd |
* git clone | git clone git://git.drogon.net/wiringPi |
* cd wiringPi | cd wiringPi |
* ./build | ./build</code> |
| |
Install SSDV (to decode and store images locally): | Install SSDV (to decode and store images locally): |
| |
* cd | <code>cd |
* git clone https://github.com/fsphil/ssdv.git | git clone https://github.com/fsphil/ssdv.git |
* cd ssdv | cd ssdv |
* sudo make install | sudo make install</code> |
| |
Install these libraries: | Install these libraries: |
| |
* sudo apt-get install libcurl4-openssl-dev | <code>sudo apt-get install libcurl4-openssl-dev |
* sudo apt-get install libncurses5-dev | sudo apt-get install libncurses5-dev</code> |
| |
Finally, install the gateway software itself: | Finally, install the gateway software itself: |
| |
* cd | <code>cd |
* git clone https://github.com/PiInTheSky/lora-gateway.git | git clone https://github.com/PiInTheSky/lora-gateway.git |
* cd lora-gateway | cd lora-gateway |
* make | make |
* cp gateway-sample.txt gateway.txt | cp gateway-sample.txt gateway.txt</code> |
| |
| |
===== Gateway - Configuration ===== | ===== Gateway - Configuration ===== |
| |
| ==== System Configuration ==== |
| |
All configuration items are held in /home/pi/lora-gateway/gateway.txt which you can edit with any text editor (e.g. vim, nano if you're a noob, or emacs if you're a bit weird). The first part of the file contains general configuration for the installation, which normally you would only need to edit once: | All configuration items are held in /home/pi/lora-gateway/gateway.txt which you can edit with any text editor (e.g. vim, nano if you're a noob, or emacs if you're a bit weird). The first part of the file contains general configuration for the installation, which normally you would only need to edit once: |
| |
* tracker=YOUR_CALLSIGN - Put in whatever you like for the callsign (e.g. your ham radio callsign or IRC nick) | <code>tracker=YOUR_CALLSIGN - Put in whatever you like for the callsign (e.g. your ham radio callsign or IRC nick) |
* EnableHabitat=Y - Leave this is "Y" for "Yes" to upload telemetry to Habitat. "N" is useful for payload testing. | EnableHabitat=Y - Leave this is "Y" for "Yes" to upload telemetry to Habitat. "N" is useful for payload testing. |
* EnableSSDV=Y - Leave this is "Y" for "Yes" to upload SSDV to the SSDV server. "N" is useful for payload testing. | EnableSSDV=Y - Leave this is "Y" for "Yes" to upload SSDV to the SSDV server. "N" is useful for payload testing. |
* JPGFolder=ssdv - this is the folder (relative to /home/pi/lora-gateway) where SSDV images will be stored. | JPGFolder=ssdv - this is the folder (relative to /home/pi/lora-gateway) where SSDV images will be stored. |
* LogTelemetry=Y - Leave this as "Y" to append telemetry to /home/pi/lora-gateway/telemetry.txt | LogTelemetry=Y - Leave this as "Y" to append telemetry to /home/pi/lora-gateway/telemetry.txt |
* LogPackets=Y - Leave this as "Y" to append packet information to /home/pi/lora-gateway/packets.txt | LogPackets=Y - Leave this as "Y" to append packet information to /home/pi/lora-gateway/packets.txt |
* CallingTimeout=60 - If the tracked payload uses calling mode, then the gateway will return to original frequency (calling channel) after this number of seconds. | CallingTimeout=60 - If the tracked payload uses calling mode, then the gateway will return to original frequency (calling channel) after this number of seconds. |
* ServerPort=6004 - The program emits JSON tracker telemetry to this port. | ServerPort=6004 - The program emits JSON tracker telemetry to this port. |
* Latitude=0.0 - Your position | Latitude=0.0 - Your position |
* Longitude=0.0 - Your position | Longitude=0.0 - Your position |
* Antenna=Watson W-50 - Your antenna | Antenna=Watson W-50 - Your antenna</code> |
| |
| If your LoRa board has LEDs on it, you may be able to control them using these settings: |
| |
| <code>NetworkLED=<wiring pi pin>. Is on if the gateway detects an active network connection |
| InternetLED=<wiring pi pin>. Is on if the gateway detects an internet connection |
| ActivityLED_0=<wiring pi pin>. Flashes on when a packet is received on LoRa module 0 |
| ActivityLED_1=<wiring pi pin>. Flashes on when a packet is received on LoRa module 1</code> |
| |
| |
| ==== Channel Configuration ==== |
| |
| The remainder of the file has 2 sections, 1 each for the 2 possible LoRa modules. |
| |
| Parameters in each of these sections have "_0" or "_1" at the end. "_0" refers to the module connected to the SPI CE0 pin on the Pi, while "_1" refers to the module connected to the SPI CE1 pin. The dual-LoRa board mentioned above has large CE0 and CE1 labels so you know which is which. Obviously, if you have one module but configure the wrong one, it's not going to work. |
| |
| If you use a board other than the one mentioned earlier, you may need to tell the gateway which Pi pins connect to the DIO0/DIO5 pins on the LoRa modules. The gateway software assumes, unless told otherwise, that the pins listed above (in the Gateway - Hardware section) are connected; if not then use the DIO0_x= and DIO5_x settings below. |
| |
| **If your LoRa board is soldered correctly but the software isn't receiving data from the module(s), then these settings are most likely wrong.** |
| |
| <code>frequency_<n>=<freq in MHz>. This sets the frequency for LoRa module <n> (0 for first, 1 for second). e.g. frequency_0=434.450 |
| AFC_<n>=<Y/N>. Enables or disables automatic frequency control (retunes by the frequency error of last received packet). |
| mode_<n>=<mode>. Sets the "mode" for the selected LoRa module. This offers a simple way of setting the various |
| LoRa parameters (SF etc.) in one go. The modes are: |
| 0 = (normal for telemetry) Explicit mode, Error coding 4:8, Bandwidth 20.8kHz, SF 11, Low data rate optimize on |
| 1 = (normal for SSDV) Implicit mode, Error coding 4:5, Bandwidth 20.8kHz, SF 6, Low data rate optimize off |
| 2 = (normal for repeater) Explicit mode, Error coding 4:8, Bandwidth 62.5kHz, SF 8, Low data rate optimize off |
| 3 = (normal for fast SSDV) Explicit mode, Error coding 4:6, Bandwidth 250kHz, SF 7, Low data rate optimize off |
| 4 = Test mode not for normal use. |
| 5 = (normal for calling mode) Explicit mode, Error coding 4:8, Bandwidth 41.7kHz, SF 11, Low data rate optimize off |
| SF_<n>=<Spreading Factor> e.g. SF_0=7 |
| Bandwidth_<n>=<Bandwidth>. e.g. Bandwidth_0=41K7. Options are 7K8, 10K4, 15K6, 20K8, 31K25, 41K7, 62K5, 125K, 250K, 500K |
| Implicit_<n>=<Y/N>. e.g. Implicit_0=Y |
| Coding_<n>=<error_coding>. e.g. Coding_0=5 (4:5) |
| lowopt_<n>=<Y/N>. Enables or disables low data rate optimization. |
| power_<n>=<power>. This is the power setting used for uplinks. Refer to the LoRa manual for details on setting this. ** Only set values that are legal in your location (for EU see IR2030) ** |
| UplinkTime_0=<seconds>. When to send any uplink messages, measured as seconds into each cycle. |
| UplinkCycle_0=<seconds>. Cycle time for uplinks. First cycle starts at 00:00:00. So for uplink time=2 and cycle=30, any transmissions will start at 2 and 32 seconds after each minute.</code> |
| |
| |
| |