2017-02-26 19:40:44 +00:00
#Environment Variables
##Required global variables
* GW_ID required
* GW_KEY required
2017-06-13 15:58:30 +00:00
This gateway ID and gateway Key for TTN will be used to fetch the gateway's information form the TTN console. When SERVER_TTN is true, this will also be used to conenct and forward packets to TTN.
2017-02-26 19:40:44 +00:00
##Optional global variables
2017-06-13 15:58:30 +00:00
* GW_CONTACT_EMAIL optional - default an empty string
The gateway owner's contact information. Will be overridden by the value from the TTN console.
* GW_DESCRIPTION optional - default an empty string
A description of this gateway. Will be overridden by the value from the TTN console.
2017-03-04 23:17:50 +00:00
* GW_RESET_PIN - default 22
2017-06-13 15:58:30 +00:00
The physical pin number on the Raspberry Pi to which the concentrator's reset is connected. See the [README ](README.md ) file for a description and a list of common values.
2017-02-26 19:40:44 +00:00
* GW_GPS optional - default False
2017-06-13 15:58:30 +00:00
* If true, use the hardware GPS.
* If false,
2017-02-26 19:40:44 +00:00
use either fake gps if a location was configured in the TTN console,
otherwise try using fake gps with the reference location as set via environment variables,
otherwise don't send coordinates.
* GW_GPS_PORT optional - default /dev/ttyAMA0
The UART to which the hardware GPS is connected to.
* GW_REF_LATITUDE optional - default 0
The latitude to use for fake gps if the coordinates are not set in the TTN console.
* GW_REF_LONGITUDE optional - default 0
The longitude to use for fake gps if the coordinates are not set in the TTN console.
* GW_REF_ALTITUDE optional - default 0
The altitude to use for fake gps if the coordinates are not set in the TTN console.
2017-06-13 15:58:30 +00:00
* GW_FWD_CRC_ERR optional - default false
Forward packets with an invalid CRC.
* GW_FWD_CRC_VAL optional - default true.
Forward packets with a valid CRC.
* GW_ANTENNA_GAIN optional - default 0.
Set this to the dBd gain of your antenna. The dBd value is the dBi value minus 2.15dB, ie. dBd = dBi-2.15. This is used to reduce the TX power of the concentrator to stay within the legal limits.
2017-02-26 19:40:44 +00:00
##Server variables
All server variables are optional, but when a server is enabled, it is recommended to set all variables to configure it completely.
2017-06-13 15:58:30 +00:00
* SERVER_TTN optional - default true
2017-02-26 19:40:44 +00:00
Should the gateway connect to the TTN backend
* SERVER_1_ENABLED optional - default false
* SERVER_1_TYPE - default "semtech"
* SERVER_1_ADDRESS
* SERVER_1_PORTUP - only when using type semtech
* SERVER_1_PORTDOWN - only when using type semtech
2017-06-13 16:45:24 +00:00
* SERVER_1_GWID - only when using type ttn
* SERVER_1_GWKEY - only when using type ttn
2017-02-26 19:40:44 +00:00
* SERVER_1_DOWNLINK - default false
* SERVER_2_ENABLED optional - default false
* SERVER_2_TYPE - default "semtech"
* SERVER_2_ADDRESS
* SERVER_2_PORTUP - only when using type semtech
* SERVER_2_PORTDOWN - only when using type semtech
* SERVER_2_GWID
* SERVER_2_GWKEY
* SERVER_2_DOWNLINK - default false
* SERVER_3_ENABLED optional - default false
* SERVER_3_TYPE - default "semtech"
* SERVER_3_ADDRESS
* SERVER_3_PORTUP - only when using type semtech
* SERVER_3_PORTDOWN - only when using type semtech
* SERVER_3_GWID
* SERVER_3_GWKEY
* SERVER_3_DOWNLINK - default false
2017-06-13 15:58:30 +00:00
## Note about boolean values
Use `true` and `false` as lower case words to enable or disable features via environment variables. Any other format will not be interpreted correctly.
2017-02-26 19:40:44 +00:00
#Logal debugging
```
docker run --device /dev/ttyAMA0:/dev/ttyAMA0 --device /dev/mem:/dev/mem --privileged -e GW_TYPE="imst-ic880a-spi" -e GW_DESCRIPTION="test gateway" -e GW_CONTACT_EMAIL="" -e GW_ID="" -e GW_KEY="" newforwarder
```
Make a copy of `Dockerfile.template` to `Dockerfile` .
```
FROM resin/raspberrypi-buildpack-deps
...
CMD ["bash"]
```