Skip to content

Simple GPS receiver for traccar #41

@slydiman

Description

@slydiman

It is not an issue.
I just want to share an useful information.
GPoint does not support multiple GPS receivers.
Multiple GPS receivers may be useful in case of using different systems GPS/Glonass/Galileo/Beidou, etc.
They may work very differently in conditions of interference or jamming.
It is possible to configure the second GPS receiver to send data directly to the traccar server.

Install remserial. Create /etc/init.d/gnss

#!/bin/sh /etc/rc.common

USE_PROCD=1
START=96
STOP=01

start_service() {
    ### MeiG SLM828: 
    ### Configure ttyUSB1 port for RAW mode
    #stty -F /dev/ttyUSB1 raw -echo -echoe -echok 115200
    ### Enable modem GPS port
    #echo -e 'AT+GPSCFG="outport",1\r\n' > /dev/ttyUSB1
    #echo -e 'AT+GPSRUN=0,30,100,0,1\r\n' > /dev/ttyUSB1

    ### Ebyte E108-GN03G via UART TTL/USB: 
    ### Configure ttyUSB0 port for RAW mode
    #stty -F /dev/ttyUSB0 raw -echo -echoe -echok 9600
    ### Enable only GGA and RMC NMEA messages each 10 sec
    #echo -e '$PCAS03,10,0,0,0,10,0,0,0,0,0,,,0,0*02\r\n' > /dev/ttyUSB0

    procd_open_instance
    procd_append_param command remserial -r x.x.x.x -p 5005 /dev/ttyUSB3
    procd_set_param respawn
    procd_set_param stdout 1
    procd_set_param stderr 1
    procd_set_param pidfile /var/run/gnss.pid
    procd_close_instance
    echo "gnss service start"
}

Write AT commands to the modem port to initialize GPS if necessary.
x.x.x.x is the IP address of the traccar server. 5005 is the port for t55 protocol on the traccar server, which supports native NMEA messages. /dev/ttyUSB3 is the modem's NMEA port or USB to serial converter (CP210x or CH341) with GPS/GNSS UART module.

Don't forget permissions

chmod 0777 /etc/init.d/gnss

Then enable and start the service

/etc/init.d/gnss enable
/etc/init.d/gnss start

Some GPS/GNSS UART modules may be configured via TTY port.
I recommend Ebyte E108-GN03G-TTL.
You can select necessary/supported NMEA messages and configure the period (usually such modules report the data each second by default).

Note t55 protocol on the traccar server expects an unique ID, otherwise the IP may be used instead of an ID. But usually IP is dynamic.
You can configure nginx proxy on the same server where traccar is running and forward NMEA messages from nginx proxy to traccar. Then IP (127.0.0.1) will be const.

/etc/nginx.conf

...
stream {
	server {
		listen 55005;
		proxy_pass 127.0.0.1:5005;
		proxy_connect_timeout 5s;
		proxy_timeout 10s;
	}
}
...

Don't forget to change the port in remserial parameters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions