-
Notifications
You must be signed in to change notification settings - Fork 40
How to install a gateway on Raspberry Pi with a Rpi Hat
Gwendal edited this page Jun 23, 2020
·
4 revisions
Rpi Hat's are Raspberry Pi extension boards including a Ublox Nina module (NRF52840) already flashed with Wirepas Sink firmware. They can be bought from : https://store.clemanis.com/en/iot/1187-raspberry-hat.html
This step is optional, Rpi Hat boards should already be flash with the dualmcu_app. This procedure can help you if your network is running on a newer stack version.
- Compile dualmcu_app from wm-sdk (https://github.com/wirepas/wm-sdk):
- make app_name=dualmcu_app target_board=promistel_rpi_hat
- Flash the Ublox module on the board.
- Flash a Raspbian Lite linux distribution using Balena Etcher (for example) on your µSDCard.
- Add file named "ssh" (without extension) to the boot partition if you want ssh access.
- In file cmdline.txt from boot partition remove : console=serial0,115200 console=tty1
- In file config.txt from boot partition add at the end dtoverlay=pi3-disable-bt and dtoverlay=pi3-miniuart-bt
- See https://www.raspberrypi.org/documentation/configuration/uart.md for an explanation. Note that Bluetooth is not usable in this configuration.
- Sink is available on /dev/ttyAMA0 of the Rapsberry Pi linux.
- Plug the SDCard to raspberry Pi and boot.
- Disable Bluetooth serial : sudo systemctl disable hciuart
- Install the Wirepas gateway software (sink service and transport service) :
- sudo apt update
- sudo apt install python3 python3-dev python3-gi libsystemd-dev
- wget https://bootstrap.pypa.io/get-pip.py && sudo python3 get-pip.py && rm get-pip.py && sudo pip3 install --upgrade pip
- mkdir wirepas
- cd wirepas
- wget https://github.com/wirepas/gateway/releases/download/v1.3.0/sinkService-arm.tar.gz
- tar -xvf sinkService-arm.tar.gz (note that sink service is precompiled for Raspberry Pi)
- wget https://raw.githubusercontent.com/wirepas/gateway/master/sink_service/com.wirepas.sink.conf
- sed -i 's/user="wirepas"/user="pi"/g' com.wirepas.sink.conf
- sudo mv com.wirepas.sink.conf /etc/dbus-1/system.d/
- sudo pip3 install wirepas_gateway (this may take some time, grpcio package takes several minutes to build).
- Create transport service configuration file in wirepas folder (/home/pi/wirepas/settings.yml) * mqtt_hostname: address or IP of WNT backend * mqtt_port: 8883 (or 1883 if unsecure) * mqtt_username: mosquittouser * mqtt_password: your backend password * gateway_id: your gateway name (must be unique)
- Use this guide to start sink service and transport service automatically with system
-
https://github.com/wirepas/gateway/wiki/How-to-start-a-native-gateway-with-systemd
- Change the user to pi (both sinkService and transportService).
- Change the sinkService path and baudrate
- Change serial port to /dev/ttyAMA0
- Change the settings.yml file path
-
https://github.com/wirepas/gateway/wiki/How-to-start-a-native-gateway-with-systemd
- Reboot the gateway.
- Configure the Sink (network address, …) using wm-node-config:
- Ex. : wm-node-conf set -n 1 -r 17 -N 9763135 -c 7 -s sink1 -S 1 (wm-node-conf --help for usage).
- Don’t forget the -S 1 option to start the Sink.
- If you use WNT (Wirepas Network Tool), don’t forget to enable the diagnostics for this network in WNT Client.