ntrip caster rep 2.0.20180730 documentation · to install python modules we encourage to use...

15
NTRIP CASTER REP 2.0.20180730 DOCUMENTATION

Upload: others

Post on 25-Jul-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: NTRIP CASTER REP 2.0.20180730 DOCUMENTATION · To install Python modules we encourage to use “pip”, a recommended tool for installing Python packages. “pip” tool installation

NTRIP CASTER REP 2.0.20180730

DOCUMENTATION

Page 2: NTRIP CASTER REP 2.0.20180730 DOCUMENTATION · To install Python modules we encourage to use “pip”, a recommended tool for installing Python packages. “pip” tool installation

Rev. 20180730

1

INSTALATION AND CONFIGURATION – NTRIP CASTER REP

¿WHAT IS CASTER REP?

Caster REP is a software designed to operate as NTRIP caster with different RTCM data sources. The

caster resembles a network server with some mount points, which hands over RTCM packets emitted by

the mount point selected to the user. A NTRIP caster manage with an unique IP and port all RTCM data

from different GNSS stations (each of them with different IPs) and it deliver to the user who has

requested it.

Caster REP is designed to operate only with RTCM 3.1 version packets.

NTRIP is a network transport protocol for RTCM data via Internet.

RTCM is an information structured standard emitted by GNSS reference stations.

MINIMUM SOFTWARE REQUIREMENTS

Caster REP has been tested successfully on Linux (Ubuntu) as on Windows (Windows 10) Operating

Systems.

To summarize, the next picture shows a scheme with the minimum requirements needed to install.

Then you will get run Caster REP properly.

PYTHON 2.7

Caster REP 2.0 use Python language, 2.7 version (2.7.x) to run the scripts needed.

Page 3: NTRIP CASTER REP 2.0.20180730 DOCUMENTATION · To install Python modules we encourage to use “pip”, a recommended tool for installing Python packages. “pip” tool installation

Rev. 20180730

2

To test if Python is installed on the system, there will be to open a command shell and type the

command “python”. If it is not recognized means Python is not installed or defined as a system

environment variable.

Python installation on Ubuntu/Debian:

In a command shell run with superuser permission the next command:

sudo apt install python

Python installation on Windows:

Download the executable file from the official website:

https://www.python.org/downloads/release/python-2715/

This version is 2.7.15 but is valid whichever 2.7.x.

NOTE 1: During the installation, don’t forget to install Python as system environment variable.

NOTE 2: When some Caster REP script is executed the first time there will be to allow the Windows

firewall to access.

Page 4: NTRIP CASTER REP 2.0.20180730 DOCUMENTATION · To install Python modules we encourage to use “pip”, a recommended tool for installing Python packages. “pip” tool installation

Rev. 20180730

3

PYMONGO

The pymongo library is required to make connections to MongoDB databases in Python. To install

Python modules we encourage to use “pip”, a recommended tool for installing Python packages.

“pip” tool installation

Pip tool is a Python packages installer and it will be used to install libraries in a straightforward

way.

To install pip on the system, you could execute the “get-pip.py” file with Python, which is

included on Caster REP files. Being on the file directory, run in a shell:

“pip” tool installation on Windows

python get-pip.py

“pip” tool installation on Ubuntu/Debian

sudo python get-pip.py

The version included is 10.0.1 but you could download the latest version from the official

website: https://pip.pypa.io/en/stable/installing/.

pymongo installation on Windows using pip

pip install pymongo

pymongo installation on Ubuntu/Debian using pip

sudo pip install pymongo

This will install required libraries tu use MongoDB in Python and also the “bson” library which is needed

to store binary data in MongoDB. In case of have another 2bson” library installed you should remove it

before to install pymongo

Page 5: NTRIP CASTER REP 2.0.20180730 DOCUMENTATION · To install Python modules we encourage to use “pip”, a recommended tool for installing Python packages. “pip” tool installation

Rev. 20180730

4

MONGODB 3.5

Caster REP 2.0 uses MongoDB as NoSQL database based on documents and it is open source!

MongoDB installation on Ubuntu/Debian:

You could follow the installation instructions about how to init and install MongoDB on the

official website

https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/

https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/

You could execute MongoDB running the command “mongod” in a shell. Later it will be showed

how to run MongoDB using user authentication.

MongoDB installation on Windows:

Download the installer executable file for MongoDB Community Server 3.6.5 version from the

official MongoDB website.

https://www.mongodb.com/download-center#community

https://www.mongodb.com/dr/fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-

ssl-3.6.5-signed.msi/download

Ensure having created store and configuration folders for MongoDB with read and write

permissions.

C:\data

C:\data\db

You could executer MongoDB running the mongod.exe file placed at “bin” directory where

Mongodb is installed. For example: “\Program Files\MongoDB\Server\3.6\bin\mongod.exe”.

Later it will be showed how to run MongoDB using user authentication

IMPORTANT: Users and roles configuration for MongoDB

If MongoDB is newly installed, there will be to configure users and their roles. Next is explained how to

create one admin user and a normal user who will use Caster REP.

More information: https://docs.mongodb.com/manual/tutorial/enable-authentication/

Run the MongoDB process without authentication request

To start the MongoDB “daemon” process without authentication request only will be run the

process named “mongod”. In Ubuntu/Debian you could type the “mongod” command. In

Windows will be with the “mongod.exe” file at MongoDB installation directory.

Make a MongoDB connection

To make a connection to an active MongoDB Instance running in your system you would have to

use “mongo” process. In Ubuntu/Debian you could type the “mongo” command. In Windows will

be with the “mongo.exe” file at MongoDB installation directory.

Page 6: NTRIP CASTER REP 2.0.20180730 DOCUMENTATION · To install Python modules we encourage to use “pip”, a recommended tool for installing Python packages. “pip” tool installation

Rev. 20180730

5

Create an admin user (if you consider needed)

To create and admin user with any database permission you will have to run the next two

commands. You only will have to change USER and PASSWORD fields.

use admin

db.createUser({

user: "USER",

pwd: "PASSWORD",

roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]

})

Create an user with read and write permissions to CasterREP database

To create an user with read and write permissions for CasterREP database you will have to run

the next two commands. You only will have to change the USER_CASTERREP and

PASSWORD_CASTERREP fields.

use casterrep

db.createUser({

user: "USER_CASTERREP",

pwd: "PASSWORD_CASTERREP",

roles: [ { role: "readWrite", db: "casterrep" } ]

})

NOTE: USUARIO_CASTERREP y CONSTRASEÑA_CASTERREP parameters will be used on Python

and PHP configuration files. Don’t forget to change them also.

Run MongoDB process with authentication requirement

To start the MongoDB “daemon” process without authentication request only will be run the

process named “mongod”. In Ubuntu/Debian you could type the “mongod” command. In Windows

will be with the “mongod.exe” file at MongoDB installation directory.

To start the MongoDB “daemon” process without authentication request there will be to give

the “--auth” parameter when execute “mongod” command. For example:

Ubuntu/Debian mongod --auth

Windows mongod.exe –auth

Page 7: NTRIP CASTER REP 2.0.20180730 DOCUMENTATION · To install Python modules we encourage to use “pip”, a recommended tool for installing Python packages. “pip” tool installation

Rev. 20180730

6

APACHE HTTP WEB SERVER

Caster REP 2.0 uses a graphical user interface based on web pages, therefore it will be needed a local

web server to deploy this service. However this will depend by the user, the most commonly used are

LAMP, XAMPP, WAMP, etc.

Ubuntu/Debian installation

sudo apt install apache2

Windows installation

https://www.apachefriends.org/es/index.html

http://www.wampserver.com/en/

IMPORTANT: php_mogodb driver and PHP.ini file configuration

The web server requires a “mongodb” driver to support access to MongoDB in PHP.

You could download it from the official website, but it depends on the PHP version installed in the

system and also the web server installed (32 bit or 64 bits)

The latest version for the driver recommended and tested for MongoDB 3.6.5 is 1.4.4. You could

download from the next links.

mongodb driver installation for PHP on Ubuntu/Debian

Follow the instructions: http://php.net/manual/es/mongodb.installation.pecl.php

For example, if PHP version used is 7.2:

sudo apt install php-pear

sudo apt install php7.2-dev

sudo pecl install mongodb

Finally add the mongodb extension on “php.ini” file:

extension=mongodb.so

mongodb driver installation for PHP on Windows

Download the driver for your PHP version from the PECL repository.

http://pecl.php.net/package/mongodb/1.4.4/windows

Choose 7.2 version named “Thread Safe (TS) x86”.

Unzip and place the “php_mongodb.dll” file on the folder “…/php/ext/” of your web server.

Finally add the mongodb extension on “php.ini” file:

php_mongodb.dll

IMPORTANT: A reboot will be needed to save changes on the web server.

Page 8: NTRIP CASTER REP 2.0.20180730 DOCUMENTATION · To install Python modules we encourage to use “pip”, a recommended tool for installing Python packages. “pip” tool installation

Rev. 20180730

7

CASTER REP INSTALLATION

The straightforward steps are:

Download the Caster REP project zip file

Unzip the downloaded file.

Inside the “python” folder, place the “casterrepPy” folder on someywhere of your system with

execution permission allowed.

Inside the “web-GUI” folder, place the “casterrep” folder on your directory where your web

server host the websites.

CONFIGURATION BEFORE EXECUTION

Python configuration file

In Python files you need to modify some global variables to adjust it to your system. These are placed on

“config_file.py” file.

NEAREST_MOUNTPOINT – Define how you named the nearest station solution in your streams

database.

RTCM_CAPTURE_SERVER_HOST - RTCM3 capture server Host/IP.

RTCM_CAPTURE_SERVER_PORT – RTCM3 capture server port.

CASTER_SERVER_HOST - Main NTRIP caster server Host/IP.

CASTER_SERVER_PORT - Main NTRIP caster server port.

MONGODB_HOST_PORT – MongoDB instance where is running mongod on your system

(IP:PORT). By default is localhost:27017

MONGODB_AUTH_USER - User authentication for CasterREP MongoDB database

MONGODB_AUTH_PASSWD – Password authentication form CasterREP MongoDB database.

RAWDATA_TIMEOUT – Define the age to consider the raw data expired from an station in

seconds. By default is 30.

PHP configuration file

In PHP files you need to modify some global variables to adjust it to your system. These are placed on

“conf.php” file.

$ip – MongoDB instance running Host/IP

$port - MongoDB instance running port

$user - MongoDB casterrep database user access

$pasw - MongoDB casterrep database password access

$dashboard_rate - Refresh rate for the dashboard page.

Initialize MongoDB database for CasterREP

Run in a command shell the “init_mongodb.py” script with Python. You could find the file inside

CasterREP python folder.

python init_mongodb.py

This will create by default a network solution “NEAREST” and an admin user.

Page 9: NTRIP CASTER REP 2.0.20180730 DOCUMENTATION · To install Python modules we encourage to use “pip”, a recommended tool for installing Python packages. “pip” tool installation

Rev. 20180730

8

IMPORTANT: By default the admin user is “admin” and the password is “casterrep”. This could be

changed on the graphical user interface under the “Edit users” tab.

Page 10: NTRIP CASTER REP 2.0.20180730 DOCUMENTATION · To install Python modules we encourage to use “pip”, a recommended tool for installing Python packages. “pip” tool installation

Rev. 20180730

9

USER MANUAL - NTRIP CASTER REP

LAUNCH OF CASTER REP

Run RTCM packets capture server

Open a command shell at your casterrepPy directory and run the next command:

Ubuntu/Debian sudo python rtcm3_capture.py

Windows python rtcm3_capture_WIN.py

Don’t forget to configure the streams/stations which send RTCM code to your configured IP:Port

Run server which acts as a NTRIP caster

Open a command shell at your casterrepPy directory and run the next command:

Ubuntu/Debian sudo python caster_server.py

Windows python caster_server.py

Now both servers will be available at configured IP:port inside “file_config.py” file

Capture the mountpoint RTCM data from an external NTRIP caster:

Open a command shell at your casterrepPy directory and run the next command:

Ubuntu/Debian sudo python ntrip_client.py IP PORT –c –m MOUNTPOINT –u USUARIO

–p CONTRASEÑA

Windows python ntrip_client.py IP PORT –c –m MOUNTPOINT –u USUARIO –p

CONTRASEÑA

IP, PORT, MOUNTPOINT, USUARIO Y CONTRASEÑA are required parameters.

Capture the mountpoint RTCM data connecting directly with a station which operates as a server:

Open a command shell at your casterrepPy directory and run the next command:

Ubuntu/Debian sudo python ntrip_client.py IP PORT –s –m MOUNTPOINT

Windows python ntrip_client. py IP PORT –s –m MOUNTPOINT

IP, PORT, MOUNTPOINT are required parameters.

WEB BASED GRAPHICAL USER INTERFACE DISPLAY

The web interface which allows to Caster REP manage all streams/stations and all the users will be

available in your local web server. If the folder has been not renamed, you probably could find it on

“localhost:casterrep”

Now the different tab screens will be described.

Page 11: NTRIP CASTER REP 2.0.20180730 DOCUMENTATION · To install Python modules we encourage to use “pip”, a recommended tool for installing Python packages. “pip” tool installation

Rev. 20180730

10

LOGIN

The admin user by default is “admin” and the

password is “casterrep”. This may be changed

after the initial login in “Edit users” tab.

Remember that only the administrator has

access granted to the graphical user interface.

Users credentials are not valid to enter.

All pages are protected under login request. If a

not logged user try to enter will be redirected

to this login page.

DASHBOARD

This is the main panel which hosts a summary of all content. For example:

Number of streams/stations which are registered in the database

Numbr of users who are registered in the database

Number of streams/stations which are actually emitting RTCM packets to Caster REP

Number of users which are actually connected to Caster REP

On the left side, there is a navigation menu:

Create and configure streams/stations

Edit information or delete streams/stations

Create new users

Edit or delete users

Page 12: NTRIP CASTER REP 2.0.20180730 DOCUMENTATION · To install Python modules we encourage to use “pip”, a recommended tool for installing Python packages. “pip” tool installation

Rev. 20180730

11

A map with the streams/stations statuses and connected users con las estaciones y usuarios

Return to the main dashboard

There is a panel with a list which contains all streams stations and also their status (emitting on green,

not emmiting on red, network solution on blue and not active on gray)

There is also a panel with a list which contains all users connected to caster REP and their information.

All tables has dynamic response. Then you could make search filters or resize them on the browser. This

page has auto-refresh. The rate in seconds of this refresh you could change it on “conf.php” file, under

“$dashboard_rate” variable. You could modify it.

NEW STREAM

Stream is a RTCM data flow which is emitted by a station. In this tab, you coud create a new stream. The

information asked will be used to build the caster REP sourcetable.

Besides this information, you would have to configure some parameters as identifier and enconder

password to accept data from station inside the RTCM capture server. The same data will be configured

in the station also.

Lastly you could enable or disable (not delete) the stream.

Page 13: NTRIP CASTER REP 2.0.20180730 DOCUMENTATION · To install Python modules we encourage to use “pip”, a recommended tool for installing Python packages. “pip” tool installation

Rev. 20180730

12

EDIT STREAMS

In this tab, the administrator could modify information from different streams and delete them also.

NOTE: If you delete by chance the network solution “NEAREST” you will have to run again the

“init_mogodb.py” file to create it by default and this will create also the default administrator user. This

script does not delete any database, only insert data.

Note 2: If you rename o modify the network solution’s mountpoint name you will have to modify it

inside “config_file.py” file also. Then your caster will recognize the new mountpoint name as the

network solution mountpoint.

Page 14: NTRIP CASTER REP 2.0.20180730 DOCUMENTATION · To install Python modules we encourage to use “pip”, a recommended tool for installing Python packages. “pip” tool installation

Rev. 20180730

13

NEW USER

As the same way we have defined before the creation of new streams, there is a tab to create new

users. Each and every user you create will be normal type, not administrator. The username and the

password will be used to connect to caster REP.

EDIT USERS

This tab will be show a list with all users registered. Then the administrator could modify information or

delete the user.

NOTE: Is you delete by chance the admin user you will have to run again the “init_mogodb.py” file to

create it by default and this will create also the default administrator user. This script does not delete

any database, only insert data.

NOTE 2: In this panel you could modify administrator username and password given by default.

LIVE MAP

Page 15: NTRIP CASTER REP 2.0.20180730 DOCUMENTATION · To install Python modules we encourage to use “pip”, a recommended tool for installing Python packages. “pip” tool installation

Rev. 20180730

14

In this tab you could see all station which are been registered in database and their statuses. Likewise

with the users who are actually connected to caster REP and have sent NMEA position message.

Clicking on icons a popup will be showed with more information.

The content of this map will be refreshed automatically every 30 seconds. It is not required to refresh

the complete page.