Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/simeononsecurity/docker-rtklib-onocoy-rtkdirect

Docker Container that Takes in USB or TCP Based Serial GPS Receiver Output and Forwards the Data to Either Onocoy or RTKDirect or Both.
https://github.com/simeononsecurity/docker-rtklib-onocoy-rtkdirect

base docker gps ntrip onocoy receiver rtcm rtcm3 rtkdirect rtklib rtklibexplorer station

Last synced: 6 days ago
JSON representation

Docker Container that Takes in USB or TCP Based Serial GPS Receiver Output and Forwards the Data to Either Onocoy or RTKDirect or Both.

Awesome Lists containing this project

README

        

# RTKLIB and NTRIPSERVER Docker Image for ONOCOY and RTKDIRECT

[![Sponsor](https://img.shields.io/badge/Sponsor-Click%20Here-ff69b4)](https://github.com/sponsors/simeononsecurity)[![Docker Image CI](https://github.com/simeononsecurity/docker-rtklib-onocoy-rtkdirect/actions/workflows/docker-image.yml/badge.svg)](https://github.com/simeononsecurity/docker-rtklib-onocoy-rtkdirect/actions/workflows/docker-image.yml)

This Docker image provides a convenient setup for running [RTKLIB](https://www.rtklib.com/) and [NTRIPSERVER](https://github.com/simeononsecurity/ntripserver) with support for [ONOCOY](https://www.onocoy.com/) and [RTKDIRECT](https://rtkdirect.com/) services.

The image follows the guides we created for the individual services. If you'd like to do this manually, without Docker, please read the articles listed below:

- [ONOCOY GPS/GNSS Receiver Basestation on a Budget](https://simeononsecurity.com/other/onocoy-gps-gnss-reciever-basestation-on-a-budget/)
- [DIY RTKDirect Reference Station Guide](https://simeononsecurity.com/other/diy-rtkdirect-reference-station-guide/)
- [Triple Mining Geodnet, Onocoy, and RTKDirect GPS Revolution](https://simeononsecurity.com/other/triple-mining-geodnet-onocoy-rtkdirect-gps-revolution/)

Follow the instructions below to use this image effectively.

## Prerequisites

Before using this Docker image, make sure you have the following prerequisites installed on your system:

- Docker: [Install Docker](https://docs.docker.com/get-docker/)
- Docker Compose (optional): [Install Docker Compose](https://docs.docker.com/compose/install/) if you prefer using Docker Compose for managing containers.

### Hardware

For recommended hardware for this project please read the following:

- [Triple Mining Geodnet, Onocoy, and RTKDirect GPS Revolution - Hardware Requirements](https://simeononsecurity.com/other/triple-mining-geodnet-onocoy-rtkdirect-gps-revolution/#hardware-requirements)
- [Unveiling the Best GPS Antennas for Onocoy and Geodnet](https://simeononsecurity.com/other/unveiling-best-gps-antennas-onocoy-geodnet/)
- [Affordable Precision Positioning GNSS Modules](https://simeononsecurity.com/other/affordable-precision-positioning-gnss-modules/)

## Getting Started

1. **Pull the Docker Image**

Pull the latest version of the Docker image from Docker Hub:

```bash
docker pull simeononsecurity/docker-rtklib-onocoy-rtkdirect:latest
```

2. **Run the Docker Container**

Run the Docker container, ensuring that you provide the necessary environment variables and parameters:

> You don't have to specify both Onocoy and RTKDirect credentials. The backend script is smart and looks to see if they have been set. You can use one or both and this should function perfectly.

> If the environment variable `ONOCOY_USE_NTRIPSERVER` or `RTKDIRECT_USE_NTRIPSERVER` is specified, the docker container will use **NTRIPSERVER** for Onocoy or RTKDirect respectively, otherwise it'll use **RTKLIB** for the connection to Onocoy and/or RTKDirect. The container will still use RTKLIB for the splitting of the feed no matter what.
> `LAT`, `LONG`, `ELEVATION`, `INSTRAMENT`, and `ANTENNA` are all optional and are only used if RTKLIB is being used and NTRIPSERVER is not.

> You may specify `TCP_OUTPUT_PORT` to change the tcp server's output port if using docker's [host networking mode](https://docs.docker.com/network/#drivers). Otherwise use the appropriate docker [port mappings](https://docs.docker.com/network/#published-ports).

> You can host any RTKLIB or tcp server instance on another machine and retreive the data using our dockers tcp client mode by defining `TCP_INPUT_IP` and `TCP_INPUT_PORT`. In which you'll specify your tcp servers ip and port.

> **Note:** Always consult your receiver manufactures documentation to get the correct serial connection information such as `baud rate`, `data bits`, `partity`, and `stop bits`.

**Known Default Serial Settings for the Following GPS Receivers**

| GPS Receiver | Baud Rate (bps) | Data Bits | Parity | Stop Bits |
|-----------------|------------------|-----------|--------|-----------|
| UM980 | 115200 | 8 | None | 1 |
| UM982 | 115200 | 8 | None | 1 |
| Bynav M20 | 115200 | 8 | None | 1 |
| Bynav M21 | 115200 | 8 | None | 1 |
| Ublox F9P | 38400 | 8 | None | 1 |
| Ublox M8* | 9600 | 8 | None | 1 |

```bash
docker run \
-td \
--restart unless-stopped \
--name sosrtk \
--device=/dev/ \
-e USB_PORT= \
-e BAUD_RATE= \
-e DATA_BITS= \
-e PARITY= \
-e STOP_BITS= \
-e ONOCOY_USERNAME= \
-e ONOCOY_PASSWORD= \
-e RTKDIRECT_MOUNTPOINT= \
-e RTKDIRECT_USERNAME= \
-e RTKDIRECT_PASSWORD= \
-e LAT= \
-e LONG= \
-e ELEVATION= \
-e INSTRUMENT= \
-e ANTENNA= \
simeononsecurity/docker-rtklib-onocoy-rtkdirect:latest
```

Ensure you replace the placeholder values (`<...>`) with your specific configuration.

Ex.
```bash
docker run \
-td \
--restart unless-stopped \
--name sosrtk \
--device=/dev/ttyUSB0 \
-e USB_PORT=ttyUSB0 \
-e BAUD_RATE=921600 \
-e DATA_BITS=8 \
-e PARITY=n \
-e STOP_BITS=1 \
-e ONOCOY_MOUNTPOINT=YOUR_ONOCOY_MOUNTPOINT \
-e ONOCOY_USERNAME=YOUR_ONOCOY_MOUNTPOINT_USERNAME \
-e ONOCOY_PASSWORD=YOUR_ONOCOY_MOUNTPOINT_PASSWORD \
-e RTKDIRECT_MOUNTPOINT=YOUR_RTKDIRECT_MOUNTPOINT \
-e RTKDIRECT_USERNAME=YOUR_RTKDIRECT_MOUNTPOINT_USERNAME \
-e RTKDIRECT_PASSWORD=YOUR_RTKDIRECT_MOUNTPOINT_PASSWORD \
-e LAT=37.7749 \
-e LONG=-122.4194 \
-e ELEVATION=50 \
-e INSTRUMENT="Your GPS Receiver" \
-e ANTENNA="Your Antenna" \
--log-driver json-file \
--log-opt max-file=5 \
--log-opt max-size=10m \
simeononsecurity/docker-rtklib-onocoy-rtkdirect:latest
```

3. **Monitor Logs**

Monitor the container logs to check for any issues or to observe the RTKLIB operation:

```bash
docker logs sosrtk
```

4. **Customize Configuration**

If needed, you can customize the `docker-init.sh` script and rebuild the Docker image with your changes.

## Docker Compose (Optional)

If you prefer using Docker Compose, create a `docker-compose.yml` file with your desired configuration and run:

```bash
docker-compose up -d
```

This will start the container in detached mode.

## Notes

- Ensure that your system allows access to the specified USB port and that the necessary permissions are set.
- Adjust environment variables according to your specific requirements.

Now you have a Dockerized RTKLIB setup with ONOCOY and RTKDIRECT support. Customize the configuration based on your needs and enjoy precise real-time kinematic positioning!

This script sets up environment variables, configures `str2str` commands based on specified parameters, and runs them in the background.

Feel free to customize the script and Dockerfile to meet your specific RTKLIB configuration requirements.


Explore the World of Cybersecurity




SimeonOnSecurity Logo

## References

- [Give Access to Host USB for Serial Device on Docker Container](https://kb.shawnchen.info/knowledge-base/docker/give-access-to-host-usb-for-serial-device-on-docker-container/)