We are trying to utilize Teltonika API to poll real-time data into TRB245 CLI but stuck with API end point as the documentation does not clearly specify the API endpoints for this activity. Can some body help? note we have installed the latest firmware version TRB2_R_00.07.12
Hello,
Thank you for your inquiry.
All TRB245 DLMS API request endpoints can be found here.
Please keep in mind that it is not possible to parse real-time data in the same way as Modbus registers.
Could you provide the error code you receive when executing an API call?
Best regards,
Hi,
Yes it was easy with ubus commands to poll modbus devices real-time data. But i am struggling with DLMS meter real-time data polling. This is the dlms command being run in TRB245 CLI and we are able to poll the data including energy values in hexadecimal - but the problem is the values are always the same - they never change. I tried to test the data in DLMS client and found the hexadecimal data to be same (note physical meter reading on the LCD display is increasing continuously). DLMS client is auto-scanning the OBIS codes and we found 1.0.96.160.0.255 with class id Data Id being displayed containing the 7 hexadecimal values - all others are meter serial no clock etc. Please advise. this is the dlms command /sbin/api POST /dlms/cosem_group/actions/test ‘{
“data”: {
“object”: [
{
“cosem_id”: “1”,
“name”: “clock”,
“enabled”: “1”,
“obis”: “0.0.42.0.0.255”,
“id”: “4”,
“devices”: [
“2”
],
“attributes”: [
“1”,
“2”
]
},
{
“cosem_id”: “1”,
“name”: “energy”,
“enabled”: “1”,
“obis”: “1.0.96.160.0.255”,
“id”: “5”,
“devices”: [
“2”
],
“attributes”: [
“1”,
“2”
]
},
{
“cosem_id”: “1”,
“name”: “meterserialno”,
“enabled”: “1”,
“obis”: “0.0.96.1.0.255”,
“id”: “6”,
“devices”: [
“2”
],
“attributes”: [
“1”,
“2”
]
},
{
“cosem_id”: “1”,
“name”: “meterfirmware”,
“enabled”: “1”,
“obis”: “1.0.0.0.1.255”,
“id”: “7”,
“devices”: [
“2”
],
“attributes”: [
“1”,
“2”
]
},
{
“cosem_id”: “1”,
“name”: “metermodelidentification”,
“enabled”: “1”,
“obis”: “1.0.0.0.6.255”,
“id”: “8”,
“devices”: [
“2”
],
“attributes”: [
“1”,
“2”
]
}
],
“devices”: [
{
“connection”: “1”,
“log_server_addr”: “0”,
“id”: “2”,
“client_addr”: “16”,
“server_addr_type”: “0”,
“name”: “Meter_5”,
“server_addr”: “1”,
“transport_security”: “0”,
“interface”: “0”,
“use_ln_ref”: “1”,
“access_security”: “0”
}
],
“connections”: [
{
“flowcontrol”: “none”,
“device”: “/dev/rs232”,
“connection_type”: “1”,
“stopbits”: “1”,
“baudrate”: “9600”,
“databits”: “8”,
“id”: “1”,
“parity”: “none”
}
],
“pretty”: “1”
}
}’ and this is the data for energy values (which is always constant) while polling/ testing “1”: “1.0.96.160.0.255”,
“2”: “{[01 00 01 08 00 FF, 221], [01 00 05 08 00 FF, 217], [01 00 08 08 00 FF, 218], [01 00 09 08 00 FF, 216], [01 00 94 08 00 FF, 212], [01 00 8F 08 00 FF, 229], [01 00 01 80 00 FF, 208]}” (Premier300-DLMS Meter).
this is the dlms command and the and the error message. Login: root
Password:
BusyBox v1.34.1 (2024-12-13 07:26:38 UTC) built-in shell (ash)
____ _ ___ ____
| _ \ _ | | / _ / |
| |) | | | | | | | _
| _ <| || | || || |) |
|| _\,|_|__/|____/
Teltonika TRB2 series 2024
Device: TRB245
Kernel: 5.4.284
Firmware: TRB2_R_00.07.11.3
Build: 0c0bb98ecfa
Build date: 2024-12-13 14:25:39
root@TRB245:~# /sbin/api POST /dlms/cosem_group/actions/test '{
“data”: {
“object”: [
{
“cosem_id”: “1”,
“name”: “meterserialno”,
“enabled”: “1”,
“obis”: “0.0.96.1.0.255”,
“id”: “4”,
“devices”: [
“1”
],
“attributes”: [
“2”
]
},
{
“cosem_id”: “3”,
“name”: “meterreading”,
“enabled”: “1”,
“obis”: “1.0.1.8.0.255”,
“id”: “5”,
“devices”: [
“1”
],
“attributes”: [
“2”
]
}
],
“devices”: [
{
“connection”: “2”,
“log_server_addr”: “0”,
“id”: “1”,
“client_addr”: “32”,
“password”: “ABCD0001”,
“server_addr_type”: “0”,
“name”: “Meter_11”,
“server_addr”: “1”,
“transport_security”: “0”,
“interface”: “0”,
“use_ln_ref”: “1”,
“access_security”: “1”
}
],
“connections”: [
{
“flowcontrol”: “none”,
“device”: “/dev/rs232”,
“connection_type”: “1”,
“stopbits”: “1”,
“baudrate”: “9600”,
“databits”: “8”,
“id”: “2”,
“parity”: “none”
}
],
“pretty”: “1”
}
}’
{“http_body”:{“success”:false,“errors”:[{“source”:“Cosem group”,“code”:16,“error”:“No DLMS connections enabled.”,“section”:“test”}]},“http_code”:422}
i took help from teltonika helpdesk while creating dlms command and was tested successfully in RUT906 - 1 device. See this is the output which is correct. But when i use the same dlms command in other RUT906/ TRB245 devices it is giving 422 error as indicated earlier. Guide me to resolve the issue. Is it that i have make some dlms configuration changes in RUT906/ TRB245 to make the dlms command run Login: root
Password:
BusyBox v1.34.1 (2025-01-17 11:09:12 UTC) built-in shell (ash)
____ _ ___ ____
| _ \ _ | | / _ / |
| |) | | | | | | | _
| _ <| || | || || |) |
|| _\,|_|__/|____/
Teltonika RUT9M series 2025
Device: RUT906
Kernel: 5.15.171
Firmware: RUT9M_R_00.07.12
Build: 51b3ff0af29
Build date: 2025-01-17 11:43:04
root@RUT906:~# /sbin/api POST /dlms/cosem_group/actions/test '{
"data": { "object": [ { "cosem_id": "1", "name": "meterserialno", "enabled": "1", "obis": "0.0.96.1.0.255", "id": "4", "devices": ["1"], "attributes": ["2"] }, { "cosem_id": "3", "name": "meterreading", "enabled": "1", "obis": "1.0.1.8.0.255", "id": "5", "devices": ["1"], "attributes": ["2"] } ], "devices": [ { "connection": "2", "log_server_addr": "0", "id": "1", "client_addr": "32", "password": "ABCD0001", "server_addr_type": "0", "name": "Meter_17", "server_addr": "1", "transport_security": "0", "interface": "0", "use_ln_ref": "1", "access_security": "1" } ], "connections": [ { "flowcontrol": "none", "device": "/dev/rs232", "connection_type": "1", "stopbits": "1", "baudrate": "9600", "databits": "8", "id": "2", "parity": "none" } ], "pretty": "1" } }'}
{“http_body”:{“success”:true,“data”:{“error”:0,“result”:{“meterreading”:{“Meter_17”:{“1”:“1.0.1.8.0.255”,“3”:{“Unit”:“None”,“Scaler”:“10”},“2”:“89608”}},“meterserialno”:{“Meter_17”:{“1”:“0.0.96.1.0.255”,“2”:“58 32 32 34 37 35 38 30”}}}}},“http_code”:200}
root@RUT906:~#
Hello,
If you have already created a ticket on HelpDesk regarding this issue, you should receive assistance from an engineer there.
Additionally, when testing DLMS through WebUI on your other RUT906 / TRB245 devices, please try inspecting the request payload to ensure that attributes like names, ids, attributes, etc. are provided correctly.
Could you also confirm:
- If DLMS connection is enabled on your TRB245 and you can test it with the correct values received?
- If the serial communication interface RS232 is used instead of RS485?
Moreover, I recommend updating the RutOS firmware on your TRB245 to the latest version (7.12.3) or matching with the firmware version that is working correctly on your RUT906.
Best regards,
in WebUI - TRB245/ RUT906 i could not find the inspect option to check the payload. Yes DLMS connection is enabled and we are checking the same OBIS code data in all devices (no change) with RS232 connectivity. i think you got it right - RUTOS firmware updation - just see this i tried dlms command in 3 devices - RUT906 2 devices having same firmware version 7.12 and kernel version 5.15.171 - it gave correct output values - but when tested in TRB245 CLI - having same firmware version 7.12 but different kernel version - 5.4.285 (by default) - it returns error 422 as shown earlier. so difference is the kernel version - BusyBox v1.34.1 (2025-01-17 11:09:12 UTC) built-in shell (ash)
| _ \ _ | | / / __|
| |) | | | | **| | | ** \
| <| || | || || |___) |
|| _\__,|_|___/|___/
Teltonika RUT9M series 2025
Device: RUT906
Kernel: 5.15.171
Firmware: RUT9M_R_00.07.12
Build: 51b3ff0af29
Build date: 2025-01-17 11:43:04
root@RUT906:~# /sbin/api POST /dlms/cosem_group/ac
tions/test '{
“data”: {
“object”: [
{
“cosem_id”: “1”,
“name”: “meterserialno”,
“enabled”: “1”,
“obis”: “0.0.96.1.0.255”,
“id”: “4”,
“devices”: [
“1”
],
“attributes”: [
“2”
]
},
{
“cosem_id”: “3”,
“name”: “meterreading”,
“enabled”: “1”,
“obis”: “1.0.1.8.0.255”,
“id”: “5”,
“devices”: [
“1”
],
“attributes”: [
“2”
]
}
],
“devices”: [
{
“connection”: “2”,
“log_server_addr”: “0”,
“id”: “1”,
“client_addr”: “32”,
“password”: “ABCD0001”,
“server_addr_type”: “0”,
“name”: “Meter_19”,
“server_addr”: “1”,
“transport_security”: “0”,
“interface”: “0”,
“use_ln_ref”: “1”,
“access_security”: “1”
}
],
“connections”: [
{
“flowcontrol”: “none”,
“device”: “/dev/rs232”,
“connection_type”: “1”,
“stopbits”: “1”,
“baudrate”: “9600”,
“databits”: “8”,
“id”: “2”,
“parity”: “none”
}
],
“pretty”: “1”
}
}'}
{“http_body”:{“success”:true,“data”:{“error”:0,“result”:{“meterreading”:{“Meter_19”:{“1”:“1.0.1.8.0.255”,“3”:{“Unit”:“None”,“Scaler”:“10”},“2”:“113833”}},“meterserialno”:{“Meter_19”:{“1”:“0.0.96.1.0.255”,“2”:“58 32 32 34 37 35 38 32”}}}}},“http_code”:200}
BusyBox v1.34.1 (2025-01-17 11:09:12 UTC) built-in shell (ash)
| _ \ _ | | / / __|
| |) | | | | **| | | ** \
| <| || | || || |___) |
|| _\__,|_|___/|___/
Teltonika TRB2 series 2025
Device: TRB245
Kernel: 5.4.285
Firmware: TRB2_R_00.07.12
Build: 51b3ff0af29
Build date: 2025-01-17 12:35:00
root@TRB245:~# /sbin/api POST /dlms/cosem_group/actions/test '{
“data”: {
“object”: [
{
“cosem_id”: “1”,
“name”: “meterserialno”,
“enabled”: “1”,
“obis”: “0.0.96.1.0.255”,
“id”: “4”,
“devices”: [
“1”
],
“attributes”: [
“2”
]
},
{
“cosem_id”: “3”,
“name”: “meterreading”,
“enabled”: “1”,
“obis”: “1.0.1.8.0.255”,
“id”: “5”,
“devices”: [
“1”
],
“attributes”: [
“2”
]
}
],
“devices”: [
{
“connection”: “2”,
“log_server_addr”: “0”,
“id”: “1”,
“client_addr”: “32”,
“password”: “ABCD0001”,
“server_addr_type”: “0”,
“name”: “Meter_15”,
“server_addr”: “1”,
“transport_security”: “0”,
“interface”: “0”,
“use_ln_ref”: “1”,
“access_security”: “1”
}
],
“connections”: [
{
“flowcontrol”: “none”,
“device”: “/dev/rs232”,
“connection_type”: “1”,
“stopbits”: “1”,
“baudrate”: “9600”,
“databits”: “8”,
“id”: “2”,
“parity”: “none”
}
],
“pretty”: “1”
}
}'}
{“http_body”:{“success”:false,“errors”:[{“source”:“Cosem group”,“code”:16,“error”:“No DLMS connections enabled.”,“section”:“test”}]},“http_code”:422}
Finally done. DLMS command for TRB245 is working and giving real-time output by polling data from dlms client. There is slight change in syntax in dlms command between TRB245 and RUT906 which can be found by clicking inspect in dlms client-group (right click-inspect) - test. This is working /sbin/api POST /dlms/cosem_group/actions/test ‘{
“data”: {
“object”: [
{
“cosem_id”: “1”,
“name”: “meterserialno”,
“enabled”: “1”,
“obis”: “0.0.96.1.0.255”,
“id”: “4”,
“devices”: [
“2”
],
“attributes”: [
“2”
]
},
{
“cosem_id”: “3”,
“name”: “meterreading”,
“enabled”: “1”,
“obis”: “1.0.1.8.0.255”,
“id”: “5”,
“devices”: [
“2”
],
“attributes”: [
“2”
]
}
],
“devices”: [
{
“connection”: “1”,
“log_server_addr”: “0”,
“id”: “2”,
“client_addr”: “32”,
“password”: “ABCD0001”,
“server_addr_type”: “0”,
“name”: “Meter_5”,
“server_addr”: “1”,
“transport_security”: “0”,
“interface”: “0”,
“use_ln_ref”: “1”,
“access_security”: “1”
}
],
“connections”: [
{
“flowcontrol”: “none”,
“device”: “/dev/rs232”,
“connection_type”: “1”,
“stopbits”: “1”,
“baudrate”: “9600”,
“databits”: “8”,
“id”: “1”,
“parity”: “none”
}
],
“pretty”: “1”
}
}’
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.