Copyright Micropelt

Setting up MTCAP gateway - Manual Configuration

This guide provides steps to setup the MTCAP Gateway by Manual Configuration

 

  • Set up MTCAP hardware

  • Wire Gateway to computer by direct Ethernet cable

  • On computer, open a command prompt and run `ipconfig`

  • Remember the IP of your computer

  • On computer, set IP to fixed IP 192.168.2.250

  • On computer, set default GW to 192.168.2.1

  • Open browser and enter default startup gateway IP 192.168.2.1

  • Ignore “unsecured connection” and continue to access IP 192.168.2.1

  • Set Username and Password

  • Set date, time, and time zone

  • Setup, Network Interfaces, br0, change “Mode” from “Static” to “DHCP Client”

  • LoRaWAN, Network Settings, change "Mode" from "Disabled" to "Network Server"

  • LoRaWAN, Network Settings, Network, “Join Delay” 5 seconds

  • LoRaWAN, Network Settings, Network, “Queue Size”: Default is 16, range is 0 to 1024, recommended value is 1 to prevent storage and sending of stale packets

  • LoRaWAN, Network Settings, Settings, “Min Datarate” “5 – SF7BW125”

  • LoRaWAN, Network Settings, Settings, “Max Datarate” “5 – SF7BW125”

  • LoRaWAN, Network Settings, Server Ports, enter a Username (valve) and Password (LikeARecordBaby)

  • LoRaWAN, Network Settings, “Max Tx Power (dBm)” “14dBm”

  • LoRaWAN, Network Settings, “Rx 2 Datarate” “5 – SF7BW125”

  • LoRaWAN, Network Settings, click Submit

  • Firewall, Settings, Input Filter Rules, add “Allow Inbound”, click Submit

  • Administration, Access Configuration, SSH Settings, “Enabled” should be ticked, click Submit

  • Wait for “Save and Apply” to go red, then click it, click OK to reboot (takes forever)

  • Reset the IP address on your computer to DHCP client.

  • Find the gateway’s new IP address

Setting up MQTT (Allows communication with mycorrhiza)

  • Open PuTTY

  • Log in to the gateway

  • `cd /etc/mosquitto`

  • `sudo vi mosquitto.conf` <You may be prompted for your password; enter it>

  • On the keyboard, press `i`

  • At the top of the mosquitto.conf file, enter the following:

pid_file /var/run/mosquitto.pid
user root
port 1883
protocol mqtt
log_dest file /var/log/mosquitto.log
log_type error
log_type warning
log_type notice
log_type information
log_type subscribe
connection_messages true
log_timestamp true
allow_anonymous false
password_file /etc/mosquitto/passwords.txt

  • Use the keyboard arrow keys to navigate through the file. (Except for the above lines,) throughout the file, for every line that does not already start with a `#`, type a `#` at the start of the line.

  • On the keyboard, press `esc`

  • On the keyboard, type `:wq` and press `enter`

  • `sudo mosquito_passwd -c passwords.txt cool_dude wears_sunglasses`

  • After creating the password file and entering the first username and password, to enter more usernames and passwords:

`sudo mosquito_passwd -b passwords.txt <user> <password>`

`cd ..`

`cd ..`

`sudo /etc/init.d/mosquitto stop`

`sudo /etc/init.d/mosquitto start -c /etc/mosquitto/mosquitto.conf`

  • Mycorrhiza should now be able to find and connect to the Gateway MQTT Broker