Skip to content

Remote Box API

Connecting

The API uses :9074 as the standard port if not otherwise defined (See .env Settings).

shell
curl -X {Method} http://localhost:9074/{Endpoint}

Endpoints

Currently available endpoints are

MethodEndpointBodyDescription
POST/tracks/main/
{
"power": bool
}
Set power on main track
POST/tracks/prog/
{
"power": bool
}
Set power on prog track
POST/vehicles/:dccAddress/speed
{
"speed": int,
"forward": bool
}
Set speed and direction of Vehicle
POST/vehicles/:dccAddress/func
{
"function": int,
"state": int
}
Set function of Vehicle

.env Settings

You can change following settings

NameTypeDefaultDescription
GIN_PORTString:9074Port for Gin API (This API)
SERIAL_PORTString/dev/ttyACM0Port for Serial Communication with DCC-EX
SERIAL_BAUDInt115200Baud Rate of Serial Port