RAK5146 GPS error

I have 2 RAK5146 concentrators in a RAK7391 server. I am using the UDP packet forwarder as I need the GPS location. I am running 2 UDP packet forwarders to make use of the 2 RAK5146’s installed. The configuration for packet forwarder 1 is as follows:

version: '2.0'

services:

  udp-packet-forwarder:
    image: rakwireless/udp-packet-forwarder:latest
    container_name: udp-packet-forwarder-c1
    restart: unless-stopped
    privileged: true
    network_mode: host
#    volumes:
#      - ./global_conf.json:/app/global_conf.json:ro
    environment:
      SERVER_HOST: localhost
      MODEL: "RAK5146"
      INTERFACE: "USB"
      HAS_GPS: 1
      RADIO_DEV: "/dev/ttyACM1"
      GPS_DEV: "/dev/ttyAMA0"
      GATEWAY_EUI_SOURCE: "chip"

The configuration of rhte second packet forwarder is as follows:

version: '2.0'

services:

  udp-packet-forwarder:
    image: rakwireless/udp-packet-forwarder:latest
    container_name: udp-packet-forwarder-c2
    restart: unless-stopped
    privileged: true
    network_mode: host
#    volumes:
#     - ./global_conf.json:/app/global_conf.json:ro
    environment:
      SERVER_HOST: localhost
      MODEL: "RAK5146"
      HAS_GPS: 0
      RESET_GPIO: 0
      GATEWAY_EUI: "0016c001ff1e54b3"
      RADIO_DEV: "/dev/ttyACM2"

However, both the packet forwarders wants to access the GPS on /dev/ttyAMA0. As a result I am getting the warning on both packet forwarders (only one log shown):

udp-packet-forwarder-c2  | WARNING: [gps] could not get a valid message from GPS (no time)
udp-packet-forwarder-c2  | WARNING: [gps] could not get a valid message from GPS (no time)
udp-packet-forwarder-c2  | WARNING: [gps] could not get a valid message from GPS (no time)

Why ido both packet forwarders want to access the GPS even though it is disabled in the one? How can a prevent one of the packet forwarders from trying to access the GPS device?

Any help or suggestions would be helpfull

Hello @christolinde
Indeed this looks like a bug in the image we are using.
I opened an issue on the github repo (see Service tries to open GPS UART even if GPS is disabled with HAS_GPS=0 · Issue #11 · RAKWireless/udp-packet-forwarder · GitHub).

As a walkaround: you can set the GPS_DEV to something unexisiting. I think the service will not fail although it will complain and the other one will get full access to the right interface.

Hello @christolinde
Check the latest image (V2.2.0). It should not open a connection to the GPS if HAS_GPS equals 0.

Hi @xoseperez

Everything is now working after installing the latest image.

1 Like