I am trying to decode some data from a FM1100 teltonika record such as this :
080400000113fc208dff000f14f650209cca80006f00d60400040004030101150316030001460000015d0000000113fc17610b000f14ffe0209cc580006e00c00500010004030101150316010001460000015e0000000113fc284945000f150f00209cd200009501080400000004030101150016030001460000015d0000000113fc267c5b000f150a50209cccc0009300680400000004030101150016030001460000015b0004
In the above example I actually just want to extract the timestamp of the log. This timestamp is the string "00000113fc208dff".
How can I transform this string to a timestamp?
According to the protocol documentation I've found here this record actually contains multiple log entries (pg. 5) each of which has its own timestamp.
Assuming you just need the timestamp of the first log entry you can extract it like this (fiddle here):
$input = '080400000113fc208dff000f14f650209cca80006f00d60400040004030101150316030001460000015d0000000113fc17610b000f14ffe0209cc580006e00c00500010004030101150316010001460000015e0000000113fc284945000f150f00209cd200009501080400000004030101150016030001460000015d0000000113fc267c5b000f150a50209cccc0009300680400000004030101150016030001460000015b0004';
$data = unpack('A2/A2/A16timestamp', $input);
$timestamp = hexdec($data['timestamp']);
echo $timestamp . PHP_EOL;
If you need to read the timestamps of each log record you will need parse the IO element data for each one because it is variable in length.