Software Interface¶
The software interface is implemented using REST API over HTTP. Authentication is required for the HTTP requests with the username being admin and a blank password as default.
The default IP address is 192.168.1.92/24.
The HTTP RESTAPI server runs on port 5000.
API URLs¶
- /system/config
- Contains system-level configuration items such as IP address and system password.
- /system/status
- Access to system status information.
- /system/restart
- A PUT here will restart the system.
- /system/update_firmware
- Provides firmware update functionality by accepting a firmware update bin file.
- /system/log/api
- API Engine logs are readable using a GET on this URL.
- /system/status/can_interfaces
- Detailed CAN Interfaces status is readble using a GET on this URL.
- /can/config and /can/stats
- Access to CAN subsystem configuration and statistics.
- /sent/config
- Configuration of SENT interfaces.
- /sent/data/<int:ch>
- Provides access to SENT channel data items.
- /lin/tcp_config
- TCP configuration of LIN interface.
- /lin/ldf_upload/<int:ch>
- Endpoint to upload LDF Files.
- /lin/config/<int:ch>
- LIN Port specific and LIN Frame specific configuration.
Establishing Communication¶
The choice of client tooling is open for the user. Here it is shown how to use the curl command line application in order to interface with the AutobusGW.
Reading out system configuration:
curl -u 'admin:' -H "accept: application/json" -X GET "http://192.168.1.92:5000/system/config" | python -m json.tool
In case jsontool is present (installable with ‘pip install jsontool’ on systems with pip), one can pretty print the returned json this way:
curl -u 'admin:' -H "accept: application/json" -X GET "http://192.168.1.92:5000/system/config" | python -m json.tool
Setting data objects using HTTP PUT with system/config as an example:
curl -u 'admin:my_example_password' -H "Content-Type: application/json" -i -X PUT "http://192.168.1.92:5000/system/config" -d @sysconfig
In the example above, the system password has previously set to ‘my_example_password’ and the system configuration to be uploaded is present in a file named ‘sysconfig’. One can get the current data object using a GET request in order to obtain the current contents before issuing a PUT request.