如何通过GPRS向Teltonika设备fmbXXX发送短信命令

huangapple go评论81阅读模式
英文:

How send SMS command over GPRS to teltonika devices fmbXXX

问题

我想通过GPRS向Teltonika设备fmbXXX发送SMS命令,当我发送getio命令时,我收到了响应,但其他命令没有起作用。

以下是仅供测试的脚本:

const net = require("net");
const Parser = require("teltonika-parser");
const server = net.createServer((socket) => {
  console.log("Client connected:", socket.remoteAddress, socket.remotePort);
  socket.on("data", async (data) => {
    let parser = new Parser(data);
    if (parser.isImei) {
      //  socket.write(Buffer.from('000000000000000D0C010500000005676574696F01000000CB', 'hex'));  //getio  it work
      socket.write(Buffer.from("000000000000000f0C010500000007676574696e666f0100004312", "hex")); //getinfo no response
    } else {
      console.log(parser);
      console.log("" + parser._codecReader.ByteBuffer + "");
    }
  });
  socket.on("close", () => {
    console.log("Client disconnected");
  });
  socket.on("error", (error) => {   
     console.error("Socket error:", error);
  });
});
server.listen(4043, "192.168.1.21", () => {
  console.log("TCP server listening ");
});

上述代码在getio命令中工作,但其他命令如getinfo或其他命令不起作用。

英文:

I want to send SMS command over GPRS to teltonika devices fmbXXX , I got response when I send the command getio but other commands didn't work

Here is the script just for test

const net = require("net");
const Parser = require("teltonika-parser");
const server = net.createServer((socket) => {
  console.log("Client connected:", socket.remoteAddress, socket.remotePort);
  socket.on("data", async (data) => {
    let parser = new Parser(data);
    if (parser.isImei) {
//  socket.write(Buffer.from('000000000000000D0C010500000005676574696F01000000CB', 'hex'));  //getio  it work
    socket.write( Buffer.from(  "000000000000000f0C010500000007676574696e666f0100004312","hex")); //getinfo no response
    } else {
      console.log(parser);
      console.log("" + parser._codecReader.ByteBuffer + "");
    }
  });
  socket.on("close", () => {
    console.log("Client disconnected");
  });
  socket.on("error", (error) => {   
     console.error("Socket error:", error);
  });
});
server.listen(4043, "192.168.1.21", () => {
  console.log("TCP server listening ");
});

The code above works in getio command but the other command as getinfo or others not working
part of the compilation unit:

答案1

得分: 1

Teltonika Codec12中未包含所有SMS命令。不同系列的Teltonika设备(36,FM64*,FMB***)的命令也不完全相同。

请查看此链接:https://wiki.teltonika-gps.com/view/Codec#Codec_12

英文:

not all SMS commands are included in Teltonika' Codec12. Also not all commands are the same over different families of Teltonika devices (36, FM64*, FMB***).

Check this: https://wiki.teltonika-gps.com/view/Codec#Codec_12

huangapple
  • 本文由 发表于 2023年7月4日 21:08:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/76612990.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定