Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
TaylorIsAGoodboy committed Jan 14, 2022
1 parent 5c5fc84 commit 88df9fc
Show file tree
Hide file tree
Showing 138 changed files with 300 additions and 460 deletions.
79 changes: 79 additions & 0 deletions Changelog
@@ -0,0 +1,79 @@
## Changelog

2022-01-14
1.Added support for RAK5146-SPI,CM3 and CM4

2021-12-22
1.Added support as923-2 as923-3 as923-4

2021-11-12 V4.3.0
1.Modify the global_conf files to configre the gateway to connect to TTN v3.

2021-06-03 V4.2.9

1.Added support for RAK5146-USB and change its sx1302_hal version from V2.0.1 to V2.1.0.

2021-03-09 V4.2.8
1.Added support for RAK2287-USB.
2.Remove some obsolete models.

2021-01-21 V4.2.7
1.Only upgraded for RAK2287, added EU433 and CN470 for RAK2287.

2020-11-25 V4.2.6
1.Added support for RAK7248C.
2.Added support for class B in global_conf.json, but it is disabled by default. When needed, you can enable it in /opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/global_conf.json.

2020-09-01 V4.2.5
1.Add AS920_923.
2.EU433 changed to 8 consecutive channels.

2020-07-20 V4.2.4
1.Add other region global_conf.json for RAK2287.
2.Modify sx1302 tx power param.
3.Add RAK2285 support.

2020-07-09 V4.2.3
1.Some naming changes.

2020-06-28 V4.2.2
1.Fix a display issue with gateway-config.
2.Delete the temperature printing of RAK2287.

2020-05-02 V4.2.1
1.Added support for RAK2287 spi version.

2020-02-14 V4.2.0
1.Added support for RAK2246 spi version.
2.Fix the bug that the internet cannot be accessed after ppp0 redial.
3.install.sh can pass --help parameter to see more installation information.
4.Install the latest version of chirpstack by default.
5.gateway-version print more information.
6.gateway-config and gateway-version show the actual gateway_id.
7.Create a rak_ap file in the /boot directory to restore to ap mode.
8.Modify the global_conf.json file of 7246 to make the transmit power more accurate.
9.When there is no match for tx power, the nearest smaller power will be used.Semtech UDP (legacy) packet forwarder
10.Delete default DNS(8.8.8.8, 223.5.5.5), the gateway will use the DNS assigned by the router to which it is connected.
11.In case of GPS connection, automatically change the system time to GPS time.

2019-12-17 V4.1.1
Added support for rak2247/rak833 spi version.

2019-12-02
Fix a bug. There is a mistake word "diable" in rak/gateway-config script, line 272, it should be do_ChirpStack disable.

2019-11-19 V4.1.0
1.LoRaServer changed its name to ChirpStack.
2.ChirpStack turns off ADR by default.
3.Unconfigure the ip of eth0 to 192.168.10.10.
4.Users can change the gateway_id in local_conf.json.
5.Increase i2c rate for rak7243.
6.Install chirpstack only on Raspberry Pi 3 and Raspberry Pi 4. Pi zero can't run ChirpStack.
7.In the AP mode, the gateway IP address is 192.168.230.1.

2019-09-19 V4.0.0
Use lan0's mac address when eth0 does not exist.

2019-05-24 V2.9
1.Multiple models are integrated with one common version.
2.Upgrade LoRa server to 3.0.
78 changes: 0 additions & 78 deletions README.md
Expand Up @@ -25,85 +25,7 @@ This project currently provides support for the below platforms.
* RAK5146(SPI)
* RAK5146(SPI) with LTE

## Changelog
2021-06-03 V4.2.9

* 1.Added support for RAK5146-USB and change its sx1302_hal version from V2.0.1 to V2.1.0.

2021-03-09 V4.2.8

* 1.Added support for RAK2287-USB.
* 2.Remove some obsolete models.

2021-01-21 V4.2.7

* 1.Only upgraded for RAK2287, added EU433 and CN470 for RAK2287.

2020-11-25 V4.2.6

* 1.Added support for RAK7248C.
* 2.Added support for class B in global_conf.json, but it is disabled by default. When needed, you can enable it in `/opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/global_conf.json`.

2020-09-01 V4.2.5

* 1.Add AS920_923.
* 2.EU433 changed to 8 consecutive channels.

2020-07-20 V4.2.4

* 1.Add other region global_conf.json for RAK2287.
* 2.Modify sx1302 tx power param.
* 3.Add RAK2285 support.

2020-07-09 V4.2.3

* 1.Some naming changes.

2020-06-28 V4.2.2

* 1.Fix a display issue with gateway-config.
* 2.Delete the temperature printing of RAK2287.

2020-05-02 V4.2.1

* 1.Added support for RAK2287 spi version.

2020-02-14 V4.2.0

* 1.Added support for RAK2246 spi version.
* 2.Fix the bug that the internet cannot be accessed after ppp0 redial.
* 3.install.sh can pass --help parameter to see more installation information.
* 4.Install the latest version of chirpstack by default.
* 5.gateway-version print more information.
* 6.gateway-config and gateway-version show the actual gateway_id.
* 7.Create a rak_ap file in the /boot directory to restore to ap mode.
* 8.Modify the global_conf.json file of 7246 to make the transmit power more accurate.
* 9.When there is no match for tx power, the nearest smaller power will be used.[Semtech UDP (legacy) packet forwarder](https://github.com/Lora-net/packet_forwarder/blob/master/lora_pkt_fwd/src/lora_pkt_fwd.c#L2517-L2527)
* 10.Delete default DNS(8.8.8.8, 223.5.5.5), the gateway will use the DNS assigned by the router to which it is connected.
* 11.In case of GPS connection, automatically change the system time to GPS time.

2019-12-17 V4.1.1
* Added support for rak2247/rak833 spi version.

2019-12-02
* Fix a bug. There is a mistake word "diable" in rak/gateway-config script, line 272, it should be do_ChirpStack disable.

2019-11-19 V4.1.0
* 1.LoRaServer changed its name to ChirpStack.
* 2.ChirpStack turns off ADR by default.
* 3.Unconfigure the ip of eth0 to 192.168.10.10.
* 4.Users can change the gateway_id in local_conf.json.
* 5.Increase i2c rate for rak7243.
* 6.Install chirpstack only on Raspberry Pi 3 and Raspberry Pi 4. Pi zero can't run ChirpStack.
* 7.In the AP mode, the gateway IP address is 192.168.230.1.

2019-09-19 V4.0.0
* Use lan0's mac address when eth0 does not exist.

2019-05-24 V2.9

* 1.Multiple models are integrated with one common version.
* 2.Upgrade LoRa server to 3.0.

## Installation procedure

Expand Down
2 changes: 1 addition & 1 deletion chirpstack/install.sh
Expand Up @@ -11,7 +11,7 @@ fi

rpi_model=`do_get_rpi_model`
if [ $rpi_model -ne 3 ] && [ $rpi_model -ne 4 ]; then
echo_warn "ChirpStack is not support for this rpi model."
./rak7246.sh
exit 0
fi

Expand Down
60 changes: 60 additions & 0 deletions chirpstack/rak7246.sh
@@ -0,0 +1,60 @@
#!/bin/bash

SCRIPT_COMMON_FILE=$(pwd)/../rak/rak/shell_script/rak_common.sh
source $SCRIPT_COMMON_FILE

sudo dpkg --add-architecture armel

GATEWAY_EUI=`do_get_gw_id`

cp init_sql.sql /tmp/init_sql.sql -f
if [ "$1" = "create_img" ]; then
echo ""
else
sed -i "s/0000000000088888/$GATEWAY_EUI/g" /tmp/init_sql.sql
fi

# 1. install requirements
apt -f -y install dialog mosquitto mosquitto-clients redis-server redis-tools postgresql apt-transport-https dirmngr

# 2. setup PostgreSQL databases and users
sudo -u postgres psql -c "create role chirpstack_as with login password 'dbpassword';"
sudo -u postgres psql -c "create role chirpstack_ns with login password 'dbpassword';"
sudo -u postgres psql -c "create database chirpstack_as with owner chirpstack_as;"
sudo -u postgres psql -c "create database chirpstack_ns with owner chirpstack_ns;"
sudo -u postgres psql chirpstack_as -c "create extension pg_trgm;"
sudo -u postgres psql chirpstack_as -c "create extension hstore;"
sudo -u postgres psql -U postgres -f /tmp/init_sql.sql
rm -f /tmp/init_sql.sql

#rm *.deb -f
#3.2 download chirpstack packages
wget https://artifacts.chirpstack.io/downloads/chirpstack-application-server/chirpstack-application-server_3.10.0_linux_armv6.deb
wget https://artifacts.chirpstack.io/downloads/chirpstack-gateway-bridge/chirpstack-gateway-bridge_3.11.0_linux_armv6.deb
wget https://artifacts.chirpstack.io/downloads/chirpstack-network-server/chirpstack-network-server_3.10.0_linux_armv6.deb

#3.3 install chirpstack packages
dpkg -i chirpstack-application-server_3.10.0_linux_armv6.deb
dpkg -i chirpstack-gateway-bridge_3.11.0_linux_armv6.deb
dpkg -i chirpstack-network-server_3.10.0_linux_armv6.deb

#4. configure lora
# configure chirpstack Server
#cp -f /etc/chirpstack-network-server/chirpstack-network-server.toml /etc/chirpstack-network-server/chirpstack-network-server.toml_bak
cp -rf ./chirpstack-network-server_conf/* /etc/chirpstack-network-server/
chown -R networkserver:networkserver /etc/chirpstack-network-server

# configure chirpstack App Server
#cp -f /etc/chirpstack-application-server/chirpstack-application-server.toml /etc/chirpstack-application-server/chirpstack-application-server.toml_bak
cp -f ./chirpstack-application-server.toml /etc/chirpstack-application-server/chirpstack-application-server.toml
chown -R appserver:appserver /etc/chirpstack-application-server

# start chirpstack-network-server
systemctl restart chirpstack-network-server

# start chirpstack-application-server
systemctl restart chirpstack-application-server

# start chirpstack-gateway-bridge
systemctl restart chirpstack-gateway-bridge
echo "Install ChirpStack success!"
2 changes: 1 addition & 1 deletion choose_model.sh
Expand Up @@ -105,7 +105,7 @@ function do_set_model_to_json()
elif [ $1 -eq 12 ]; then
GW_MODEL=RAK5146
do_set_spi_to_json 1
INSTALL_LTE=1
INSTALL_LTE=1
else
# Never come here
echo "error"
Expand Down
2 changes: 1 addition & 1 deletion install.sh
Expand Up @@ -58,7 +58,7 @@ while true; do
fi

if [ $rpi_model -ne 3 ] && [ $rpi_model -ne 4 ]; then
INSTALL_CHIRPSTACK=0
INSTALL_CHIRPSTACK=1
fi
shift;
fi
Expand Down
2 changes: 1 addition & 1 deletion lora/rak2246/global_conf/global_conf.as_915_921.json
Expand Up @@ -133,7 +133,7 @@
"gateway_conf": {
"gateway_ID": "0000000000000000",
/* change with default server address/ports, or overwrite in local_conf.json */
"server_address": "router.as2.thethings.network",
"server_address": "au1.cloud.thethings.network",
"serv_port_up": 1700,
"serv_port_down": 1700,
/* adjust the following parameters for your network */
Expand Down
2 changes: 1 addition & 1 deletion lora/rak2246/global_conf/global_conf.as_915_928.json
Expand Up @@ -143,7 +143,7 @@
"gateway_conf": {
"gateway_ID": "0000000000000000",
/* change with default server address/ports, or overwrite in local_conf.json */
"server_address": "router.as2.thethings.network",
"server_address": "au1.cloud.thethings.network",
"serv_port_up": 1700,
"serv_port_down": 1700,
/* adjust the following parameters for your network */
Expand Down
2 changes: 1 addition & 1 deletion lora/rak2246/global_conf/global_conf.as_917_920.json
Expand Up @@ -133,7 +133,7 @@
"gateway_conf": {
"gateway_ID": "0000000000000000",
/* change with default server address/ports, or overwrite in local_conf.json */
"server_address": "router.as2.thethings.network",
"server_address": "au1.cloud.thethings.network",
"serv_port_up": 1700,
"serv_port_down": 1700,
/* adjust the following parameters for your network */
Expand Down
2 changes: 1 addition & 1 deletion lora/rak2246/global_conf/global_conf.as_920_923.json
Expand Up @@ -130,7 +130,7 @@
},
"gateway_conf":{
"gateway_ID":"0000000000000000",
"server_address":"router.as2.thethings.network",
"server_address":"au1.cloud.thethings.network",
"serv_port_up":1700,
"serv_port_down":1700,
"forward_crc_disabled":false,
Expand Down
2 changes: 1 addition & 1 deletion lora/rak2246/global_conf/global_conf.au_915_928.json
Expand Up @@ -139,7 +139,7 @@
"gateway_conf": {
"gateway_ID": "0000000000000000",
/* change with default server address/ports, or overwrite in local_conf.json */
"server_address": "router.au.thethings.network",
"server_address":"au1.cloud.thethings.network",
"serv_port_up": 1700,
"serv_port_down": 1700,
/* adjust the following parameters for your network */
Expand Down
2 changes: 1 addition & 1 deletion lora/rak2246/global_conf/global_conf.cn_470_510.json
Expand Up @@ -193,7 +193,7 @@
"gateway_conf": {
"gateway_ID": "0000000000000000",
/* change with default server address/ports, or overwrite in local_conf.json */
"server_address": "router.cn.thethings.network",
"server_address":"au1.cloud.thethings.network",
"serv_port_up": 1700,
"serv_port_down": 1700,
/* adjust the following parameters for your network */
Expand Down
2 changes: 1 addition & 1 deletion lora/rak2246/global_conf/global_conf.eu_433.json
Expand Up @@ -200,7 +200,7 @@
"gateway_conf": {
"gateway_ID": "0000000000000000",
/* change with default server address/ports, or overwrite in local_conf.json */
"server_address": "localhost",
"server_address":"eu1.cloud.thethings.network",
"serv_port_up": 1700,
"serv_port_down": 1700,
/* adjust the following parameters for your network */
Expand Down
2 changes: 1 addition & 1 deletion lora/rak2246/global_conf/global_conf.eu_863_870.json
Expand Up @@ -131,7 +131,7 @@
"gateway_conf": {
"gateway_ID": "0000000000000000",
/* change with default server address/ports, or overwrite in local_conf.json */
"server_address": "router.eu.thethings.network",
"server_address":"eu1.cloud.thethings.network",
"serv_port_up": 1700,
"serv_port_down": 1700,
/* adjust the following parameters for your network */
Expand Down
2 changes: 1 addition & 1 deletion lora/rak2246/global_conf/global_conf.in_865_867.json
Expand Up @@ -126,7 +126,7 @@
"gateway_conf": {
"gateway_ID": "0000000000000000",
/* change with default server address/ports, or overwrite in local_conf.json */
"server_address": "router.as.thethings.network",
"server_address":"eu1.cloud.thethings.network",
"serv_port_up": 1700,
"serv_port_down": 1700,
/* adjust the following parameters for your network */
Expand Down
2 changes: 1 addition & 1 deletion lora/rak2246/global_conf/global_conf.kr_920_923.json
Expand Up @@ -133,7 +133,7 @@
"gateway_conf": {
"gateway_ID": "0000000000000000",
/* change with default server address/ports, or overwrite in local_conf.json */
"server_address": "router.kr.thethings.network",
"server_address":"au1.cloud.thethings.network",
"serv_port_up": 1700,
"serv_port_down": 1700,
/* adjust the following parameters for your network */
Expand Down
2 changes: 1 addition & 1 deletion lora/rak2246/global_conf/global_conf.ru_864_870.json
Expand Up @@ -133,7 +133,7 @@
"gateway_conf": {
"gateway_ID": "0000000000000000",
/* change with default server address/ports, or overwrite in local_conf.json */
"server_address": "router.ru.thethings.network",
"server_address":"eu1.cloud.thethings.network",
"serv_port_up": 1700,
"serv_port_down": 1700,
/* adjust the following parameters for your network */
Expand Down
2 changes: 1 addition & 1 deletion lora/rak2246/global_conf/global_conf.us_902_928.json
Expand Up @@ -131,7 +131,7 @@
"gateway_conf": {
"gateway_ID": "0000000000000000",
/* change with default server address/ports, or overwrite in local_conf.json */
"server_address": "router.us.thethings.network",
"server_address":"nam1.cloud.thethings.network",
"serv_port_up": 1700,
"serv_port_down": 1700,
/* adjust the following parameters for your network */
Expand Down
2 changes: 1 addition & 1 deletion lora/rak2247_spi/global_conf/global_conf.as_915_921.json
Expand Up @@ -188,7 +188,7 @@
},
"gateway_conf": {
"gateway_ID": "0000000000000000",
"server_address": "router.as2.thethings.network",
"server_address": "au1.cloud.thethings.network",
"serv_port_up": 1700,
"serv_port_down": 1700,
"keepalive_interval": 10,
Expand Down
2 changes: 1 addition & 1 deletion lora/rak2247_spi/global_conf/global_conf.as_915_928.json
Expand Up @@ -201,7 +201,7 @@
"gateway_conf": {
"gateway_ID": "0000000000000000",
/* change with default server address/ports, or overwrite in local_conf.json */
"server_address": "router.as2.thethings.network",
"server_address": "au1.cloud.thethings.network",
"serv_port_up": 1700,
"serv_port_down": 1700,
/* adjust the following parameters for your network */
Expand Down
2 changes: 1 addition & 1 deletion lora/rak2247_spi/global_conf/global_conf.as_917_920.json
Expand Up @@ -188,7 +188,7 @@
},
"gateway_conf":{
"gateway_ID":"0000000000000000",
"server_address":"router.as2.thethings.network",
"server_address":"au1.cloud.thethings.network",
"serv_port_up":1700,
"serv_port_down":1700,
"forward_crc_disabled":false,
Expand Down
2 changes: 1 addition & 1 deletion lora/rak2247_spi/global_conf/global_conf.as_920_923.json
Expand Up @@ -189,7 +189,7 @@
},
"gateway_conf":{
"gateway_ID":"0000000000000000",
"server_address":"router.as2.thethings.network",
"server_address":"au1.cloud.thethings.network",
"serv_port_up":1700,
"serv_port_down":1700,
"forward_crc_disabled":false,
Expand Down

0 comments on commit 88df9fc

Please sign in to comment.