Skip to content

A relay server used to send NTCIP commands based on configuration and HTTP POST requests

License

Notifications You must be signed in to change notification settings

Trellis-Logic/ntcip-relay-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ntcip-relay-server

This continer is used to convert POST http requests to actions on an NTCIP Server.

Given this config.json:

{
    "pedcall_oid": "1.2.3.4"
    "ntcip_controller_ip": "192.168.88.1",
    "ntcip_controller_port": "5501",
    "ntcip_community": "administrator",
    "ntcip_version": 1,
    "http_server_port": 8080
}

The resulting POST curl invocations on the pedcall endpoint on the local server at port 8080 will result in NTCIP/SNMP set commands on the NTCIP controller at IP address 192.168.88.1 and port 5501.

Operations will be performed on the oid specified at "1.2.3.4". A curl command formatted like this:

curl -X POST -F "phase_control_group=1" -F 'phase=1' -F 'signal_type=True' -F "mib=1.2.3.4" http://localhost:8080/pedcall/

will result in an integer 1 value set on the mib at 1.2.3.4.1, and a command formatted like this:

curl -X POST -F "phase_control_group=1" -F 'phase=1' -F 'signal_type=False' -F "mib=1.2.3.4" http://localhost:8080/pedcall/

will result in an integer 0 value set on the mib at 1.2.3.4.1

To verify, you may query with a command like this:

snmpwalk -v2c -c administrator localhost:5501 1.2.3.4

Note that phase values are defined slightly different than the NTCIP convention and specify bits to set rather than the ultimate phase value. A phase value of 4 means bit 3 is set which corresponds to actual phase value 8.

Building and running with docker

Run ./docker/build.sh to build followed by ./docker/run.sh

Integrating with Services

The docker/service directory is intended for integrating with the services repository. See the example documentation there for further information.

About

A relay server used to send NTCIP commands based on configuration and HTTP POST requests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages