Skip to content

Commit

Permalink
Merge pull request #50 from RAKWireless/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
RAKzhuqi authored Mar 25, 2021
2 parents a7f0ec9 + e69b9ba commit adfb1c6
Show file tree
Hide file tree
Showing 64 changed files with 450 additions and 10,479 deletions.
35 changes: 18 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,24 @@ The aim of this project is to help users to use the RAK Raspberry Pi Developer G
## Supported platforms

This project currently provides support for the below platforms.
* RAK831
* RAK831(Choose RAK2245)
* RAK2245
* RAK7243/RAK7244 no LTE
* RAK7243/RAK7244 with LTE
* RAK833(USB)
* RAK833(USB)(Choose RAK2247 USB)
* RAK2247(USB)
* RAK833(SPI)
* RAK833(SPI)(Choose RAK2247 SPI)
* RAK2247(SPI)
* RAK2246
* RAK7248 no LTE (RAK2287 + raspberry pi)
* RAK7248 with LTE (RAK2287 + LTE + raspberry pi)
* RAK2285

## Changelog
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.
Expand Down Expand Up @@ -107,19 +111,16 @@ step3 : Clone the installer and start the installation (More installation option
step4 : Next you will see some messages as follow. Please select the corresponding hardware model.

Please select your gateway model:
* 1.RAK831
* 2.RAK2245
* 3.RAK7243/RAK7244 no LTE
* 4.RAK7243/RAK7244 with LTE
* 5.RAK833(USB)
* 6.RAK2247(USB)
* 7.RAK833(SPI)
* 8.RAK2247(SPI)
* 9.RAK2246
* 10.RAK7248 no LTE (RAK2287 + raspberry pi)
* 11.RAK7248 with LTE (RAK2287 + LTE + raspberry pi)
* 12.RAK2285
Please enter 1-12 to select the model:
* 1.RAK2245
* 2.RAK7243/RAK7244 no LTE
* 3.RAK7243/RAK7244 with LTE
* 4.RAK2247(USB)
* 5.RAK2247(SPI)
* 6.RAK2246
* 7.RAK7248 no LTE (RAK2287 SPI + raspberry pi)
* 8.RAK7248 with LTE (RAK2287 SPI + LTE + raspberry pi)
* 9.RAK2287 USB
Please enter 1-9 to select the model:

step5 : Wait a moment and the installation is complete.

Expand Down
2 changes: 1 addition & 1 deletion chirpstack/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ 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
#sudo -u postgres psql -U postgres -f /tmp/init_sql.sql
rm -f /tmp/init_sql.sql

#3. install lora packages
Expand Down
58 changes: 23 additions & 35 deletions choose_model.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,16 @@ do_check_variable_type_echo(){
function echo_model_info()
{
echo_yellow "Please select your gateway model:"
echo_yellow "*\t 1.RAK831"
echo_yellow "*\t 2.RAK2245"
echo_yellow "*\t 3.RAK7243/RAK7244 no LTE"
echo_yellow "*\t 4.RAK7243/RAK7244 with LTE"
echo_yellow "*\t 5.RAK833(USB)"
echo_yellow "*\t 6.RAK2247(USB)"
echo_yellow "*\t 7.RAK833(SPI)"
echo_yellow "*\t 8.RAK2247(SPI)"
echo_yellow "*\t 9.RAK2246"
echo_yellow "*\t10.RAK7248 no LTE (RAK2287 + raspberry pi)"
echo_yellow "*\t11.RAK7248 with LTE (RAK2287 + LTE + raspberry pi)"
echo_yellow "*\t12.RAK2285"
echo_yellow "Please enter 1-12 to select the model:\c"
echo_yellow "*\t 1.RAK2245"
echo_yellow "*\t 2.RAK7243/RAK7244 no LTE"
echo_yellow "*\t 3.RAK7243/RAK7244 with LTE"
echo_yellow "*\t 4.RAK2247(USB)"
echo_yellow "*\t 5.RAK2247(SPI)"
echo_yellow "*\t 6.RAK2246"
echo_yellow "*\t 7.RAK7248 no LTE (RAK2287 SPI + raspberry pi)"
echo_yellow "*\t 8.RAK7248 with LTE (RAK2287 SPI + LTE + raspberry pi)"
echo_yellow "*\t 9.RAK2287 USB"
echo_yellow "Please enter 1-9 to select the model:\c"
}

function do_set_model_to_json()
Expand All @@ -60,51 +57,42 @@ function do_set_model_to_json()
RAK_GW_JSON=./rak/rak/gateway-config-info.json
INSTALL_LTE=0
if [ $1 -eq 1 ]; then
GW_MODEL=RAK831
do_set_spi_to_json 1
elif [ $1 -eq 2 ]; then
GW_MODEL=RAK2245
do_set_spi_to_json 1
elif [ $1 -eq 3 ]; then
elif [ $1 -eq 2 ]; then
if [ $rpi_model -eq 4 ]; then
GW_MODEL=RAK7244
else
GW_MODEL=RAK7243
fi
do_set_spi_to_json 1
elif [ $1 -eq 4 ]; then
elif [ $1 -eq 3 ]; then
if [ $rpi_model -eq 4 ]; then
GW_MODEL=RAK7244
else
GW_MODEL=RAK7243
fi
INSTALL_LTE=1
do_set_spi_to_json 1
elif [ $1 -eq 5 ]; then
GW_MODEL=RAK833
do_set_spi_to_json 0
elif [ $1 -eq 6 ]; then
elif [ $1 -eq 4 ]; then
GW_MODEL=RAK2247
do_set_spi_to_json 0
elif [ $1 -eq 7 ]; then
GW_MODEL=RAK833
do_set_spi_to_json 1
elif [ $1 -eq 8 ]; then
elif [ $1 -eq 5 ]; then
GW_MODEL=RAK2247
do_set_spi_to_json 1
elif [ $1 -eq 9 ]; then
elif [ $1 -eq 6 ]; then
GW_MODEL=RAK2246
do_set_spi_to_json 1
elif [ $1 -eq 10 ]; then
elif [ $1 -eq 7 ]; then
GW_MODEL=RAK7248
do_set_spi_to_json 1
elif [ $1 -eq 11 ]; then
elif [ $1 -eq 8 ]; then
GW_MODEL=RAK7248
do_set_spi_to_json 1
INSTALL_LTE=1
elif [ $1 -eq 12 ]; then
GW_MODEL=RAK2285
do_set_spi_to_json 1
elif [ $1 -eq 9 ]; then
GW_MODEL=RAK2287
do_set_spi_to_json 0
else
# Never come here
echo "error"
Expand Down Expand Up @@ -133,23 +121,23 @@ function do_set_model()
do
read RAK_MODEL
if [ -z "$RAK_MODEL" ]; then
echo_yellow "Please enter 1-12 to select the model:\c"
echo_yellow "Please enter 1-9 to select the model:\c"
continue
fi

do_check_variable_type $RAK_MODEL
RET=$?

if [ $RET -eq 0 ]; then
if [ $RAK_MODEL -lt 1 ] || [ $RAK_MODEL -gt 12 ]; then
if [ $RAK_MODEL -lt 1 ] || [ $RAK_MODEL -gt 9 ]; then
echo_yellow "Please enter 1-10 to select the model:\c"
continue
else
do_set_model_to_json $RAK_MODEL
return 0
fi
else
echo_yellow "Please enter 1-12 to select the model:\c"
echo_yellow "Please enter 1-9 to select the model:\c"
continue

fi
Expand Down
29 changes: 5 additions & 24 deletions lora/install_for_img.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ pushd rak7243
./install.sh
popd

pushd rak2245
./install.sh
popd

pushd rak2246
./install.sh
popd
Expand All @@ -36,23 +32,14 @@ pushd rak2247_spi
./install.sh
popd

pushd rak2287_spi
pushd rak2287
./install.sh
popd

pushd rak2285
./install.sh
popd


cp ./update_gwid.sh rak7243/packet_forwarder/lora_pkt_fwd/update_gwid.sh
cp ./start.sh rak7243/packet_forwarder/lora_pkt_fwd/start.sh
cp ./set_eui.sh rak7243/packet_forwarder/lora_pkt_fwd/set_eui.sh

cp ./update_gwid.sh rak2245/packet_forwarder/lora_pkt_fwd/update_gwid.sh
cp ./start.sh rak2245/packet_forwarder/lora_pkt_fwd/start.sh
cp ./set_eui.sh rak2245/packet_forwarder/lora_pkt_fwd/set_eui.sh

cp ./update_gwid.sh rak2246/packet_forwarder/lora_pkt_fwd/update_gwid.sh
cp ./start.sh rak2246/packet_forwarder/lora_pkt_fwd/start.sh
cp ./set_eui.sh rak2246/packet_forwarder/lora_pkt_fwd/set_eui.sh
Expand All @@ -65,21 +52,15 @@ cp ./update_gwid.sh rak2247_spi/packet_forwarder/lora_pkt_fwd/update_gwid.sh
cp ./start.sh rak2247_spi/packet_forwarder/lora_pkt_fwd/start.sh
cp ./set_eui.sh rak2247_spi/packet_forwarder/lora_pkt_fwd/set_eui.sh

cp ./update_gwid.sh rak2287_spi/packet_forwarder/lora_pkt_fwd/update_gwid.sh
cp ./start.sh rak2287_spi/packet_forwarder/lora_pkt_fwd/start.sh
cp ./set_eui.sh rak2287_spi/packet_forwarder/lora_pkt_fwd/set_eui.sh

cp ./update_gwid.sh rak2285/packet_forwarder/lora_pkt_fwd/update_gwid.sh
cp ./start.sh rak2285/packet_forwarder/lora_pkt_fwd/start.sh
cp ./set_eui.sh rak2285/packet_forwarder/lora_pkt_fwd/set_eui.sh
cp ./update_gwid.sh rak2287/packet_forwarder/lora_pkt_fwd/update_gwid.sh
cp ./start.sh rak2287/packet_forwarder/lora_pkt_fwd/start.sh
cp ./set_eui.sh rak2287/packet_forwarder/lora_pkt_fwd/set_eui.sh

cp rak7243 /usr/local/rak/lora/ -rf
cp rak2245 /usr/local/rak/lora/ -rf
cp rak2246 /usr/local/rak/lora/ -rf
cp rak2247_usb /usr/local/rak/lora/ -rf
cp rak2247_spi /usr/local/rak/lora/ -rf
cp rak2287_spi /usr/local/rak/lora/ -rf
cp rak2285 /usr/local/rak/lora/ -rf
cp rak2287 /usr/local/rak/lora/ -rf

cp ttn-gateway.service /lib/systemd/system/ttn-gateway.service

Expand Down
23 changes: 10 additions & 13 deletions lora/install_normal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ INSTALL_LTE=`do_get_gw_install_lte`
mkdir /opt/ttn-gateway -p


if [ "${RAK_GW_MODEL}" = "RAK2247" ] || [ "${RAK_GW_MODEL}" = "RAK833" ]; then
if [ "${RAK_GW_MODEL}" = "RAK2247" ]; then
if [ "${LORA_SPI}" = "1" ]; then
pushd rak2247_spi
./install.sh
Expand All @@ -33,14 +33,18 @@ if [ "${RAK_GW_MODEL}" = "RAK2247" ] || [ "${RAK_GW_MODEL}" = "RAK833" ]; then
fi
popd
elif [ "${RAK_GW_MODEL}" = "RAK2287" ] ; then
pushd rak2287_spi
if [ "${INSTALL_LTE}" = "1" ]; then
cp global_conf_i2c global_conf -rf
pushd rak2287
if [ "${LORA_SPI}" = "1" ]; then
if [ "${INSTALL_LTE}" = "1" ]; then
cp global_conf_i2c global_conf -rf
else
cp global_conf_uart global_conf -rf
fi
else
cp global_conf_uart global_conf -rf
cp global_conf_usb global_conf -rf
fi
./install.sh
LORA_DIR_TMP=rak2287_spi
LORA_DIR_TMP=rak2287
popd
elif [ "${RAK_GW_MODEL}" = "RAK7243" ] || [ "${RAK_GW_MODEL}" = "RAK7244" ]; then
pushd rak7243
Expand All @@ -51,13 +55,6 @@ elif [ "${RAK_GW_MODEL}" = "RAK7243" ] || [ "${RAK_GW_MODEL}" = "RAK7244" ]; the
fi
./install.sh
LORA_DIR_TMP=rak7243
popd
elif [ "${RAK_GW_MODEL}" = "RAK2285" ]; then

pushd rak2285
LORA_DIR_TMP=rak2285
./install.sh

popd
else
if [ "${RAK_GW_MODEL}" = "RAK2246" ]; then
Expand Down
Loading

0 comments on commit adfb1c6

Please sign in to comment.