Skip to content

fandrej/glonassd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This file by Russian

glonassd

GPS/GLONASS tracker server for Debian

About

glonassd is a linux daemon that receives data from a GPS / GLONASS trackers, processing and preserving them in a database.
Written in C, сompiled with gcc 6.3.0 for x86_64-linux-gnu.

Tracker protocols

Receiving: Arnavi-4/5, Galileo (all versions), GPS101-GPS103, SAT-LITE / SAT-LITE2, Wialon IPS, Wialon NIS (SOAP / Olympstroy), EGTS (ERA-GLONASS), TQ GPRS (H02).
Sending (forwarding): all receiving without reencode or reencode to EGTS, Wialon NIS, WialonIPS, Galileo.
Protocols can be added using plug libraries.

Database

PostgreSQL
Redis
Oracle
Databases can be added using plug libraries.

Features

  • Data transfer on the fly to another server with transcoding to a different protocol (to Wialon NIS or EGTS only) or without transcoding.
  • Automatic restoration of connections to the remote server when the connection is broken.
  • Storing data at the time of connection failure with the remote server and sending the stored data after the restoration of communication.
  • The maximum number of relay servers: 3 for each terminal.
  • Perform scheduled tasks (maximum 5 timers).
  • Easy configuration using two .conf files (Examples: glonassd.conf, forward.conf)
  • Extensibility through plug libraries without recompilation daemon.
  • Run in daemon or simple application mode

Compilation

make all for compile daemon + database library + terminals libraries
make glonassd for compile daemon only
make pg for compile database (PostgreSQL) library
make name for compile terminal name library

Additional information about threed party libraries

Installation

Create folder for daemon an copy in it files **glonassd, .so, .sql, or use folder where project compiled.
In you PostgreSQL database create table "tgpsdata" (see script tgpsdata.sql).
If you use firewall, enable ports for incoming terminal connections.

Configuration

In glonassd.conf file in server section edit values for:
listen - IP addres listen trackers interface
transmit - IP addres retranslation to remote server interface
log_file - full path to log file
db_host, db_port, db_name, db_schema, db_user, db_pass - parameters for you PostgreSQL database
Comment or uncomment terminals sections for used terminals and edit listeners ports.

For forwarding terminals data to remote server see comments in forward section of the glonassd.conf file.
For schedule database tasks see comments about timer parameter in server section of the glonassd.conf file.

Check the POSIX message queue size limits

Test the system message queue length limit using ulimit -q or ulimit -a and check the value of the 'POSIX message queue'. By default, it is 819200 bytes. Increase this value at least to 81920000. To do this, add the following lines to the /etc/security/limits.conf file:

root       soft    msgqueue        81920000
root       hard    msgqueue        81920000
*       soft    msgqueue        81920000
*       hard    msgqueue        81920000

and reboot the system. If the message "mq_send(config->db_queue) message queue is already full" appears in the log file during operation, then the queue size must be increased further.

Run

From daemon folder use ./glonassd start command for start in console mode, CTRL+C for stop.
Use -d parameter for start in daemon mode.
Use -c path/to/config/file parameter for config file not in daemon folder.
If daemon configured as automatically startup, use service glonassd start and service glonassd stop for start/stop if needded.

Autostart configure

Edit DAEMON variable in glonassd.sh file for correct path to daemon folder.
Copy glonassd.sh file in /etc/init.d folder.
Use chmod 0755 /etc/init.d/glonassd.sh for make it executable.
Use systemctl daemon-reload and update-rc.d glonassd.sh defaults for enable autostart daemon.
Use update-rc.d -f glonassd.sh remove for diasble autostart without delete glonassd.sh file.
Delete /etc/init.d/glonassd.sh file and use systemctl daemon-reload for fully cleanup daemon info.

License

The glonassd is open-sourced software licensed under the MIT license.

Documentation and API

Documentation to be written.

Author

Andrey Fedorov, Kurgan, Russia.
mailto:[email protected]

Epilog

This daemon is part of navigation service of locman.org.

Fixes

12.06.2020

  • Fixed receiving big data (from other servers)
  • EGTS protocol fixed
  • CPU usage improved
  • Redis database added

01.05.2021

  • Added TQ GPRS (H02) receiver protocol (SinoTrack ST-901 device)
  • Added WialonIPS retranslation protocol
  • Added Galileo retranslation protocol
  • Small fixes

13.11.2021

  • Added library for working with Oracle database
  • Improved logs in databases libraries

04.04.2022

  • Added processing of CT_MSGTO, CT_MSGFROM EGTS_COMMANDS_SERVICE messages of the EGTS protocol

17.04.2022

  • Added GoSafe protocol (Gosafe G*/Proma Sat G* devices)

About

GPS/GLONASS tracker server for Debian

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published