gv50 does not block when sending command

Antonio Junior7 days ago

When sending the blocking command to the gv50 device, it does not respond to the command and does not block either. The command sent in the form that the protocol is is this.

2025-03-22 20:39:18  INFO: [U61db40e7] id: 865083038139382, command type: engineResume sent
2025-03-22 20:39:18  INFO: [U61db40e7: gl200 > 18.230.179.236] AT+GTOUT=,0,,,0,0,0,0,0,0,0,,,,,,,FFFF$

Where %s exists it is not being mapped with the command prefix (gv50, gv55, ...)

protected Object encodeCommand(Command command) {

        initDevicePassword(command, "");
      



        return switch (command.getType()) {
            case Command.TYPE_POSITION_SINGLE -> formatCommand(
                    command, "AT+GTRTO=%s,1,,,,,,FFFF$", Command.KEY_DEVICE_PASSWORD);
            case Command.TYPE_ENGINE_STOP -> formatCommand(
                    command, "AT+GTOUT=%s,1,,,0,0,0,0,0,0,0,,,,,,,FFFF$", Command.KEY_DEVICE_PASSWORD);
            case Command.TYPE_ENGINE_RESUME -> formatCommand(
                    command, "AT+GTOUT=%s,0,,,0,0,0,0,0,0,0,,,,,,,FFFF$", Command.KEY_DEVICE_PASSWORD);
            case Command.TYPE_IDENTIFICATION -> formatCommand(
                    command, "AT+GTRTO=%s,8,,,,,,FFFF$", Command.KEY_DEVICE_PASSWORD);
            case Command.TYPE_REBOOT_DEVICE -> formatCommand(
                    command, "AT+GTRTO=%s,3,,,,,,FFFF$", Command.KEY_DEVICE_PASSWORD);
            default -> null;
        };
    }

When we send this command to the gv50, for example, it blocks normally.

"egineStop":"AT+GTOUT=gv50,1,0,0,0,0,0,,,,3,,,,,,,FFFF$",
"egineResume":""AT+GTOUT=gv50,0,0,0,0,0,0,,,,3,,,,,,,FFFF$"}

Thank you all!

Anton Tananaev7 days ago

Sounds like the command format is wrong.

Antonio Junior7 days ago

That's right Anton, if you send the command like this it works

AT+GTOUT=gv50,1,0,0,0,0,0,,,,3,,,,,,,FFFF$
AT+GTOUT=gv50,0,0,0,0,0,0,,,,3,,,,,,,FFFF$

where gv50 would be %s

According to this ceiling the command is not picking up the pattern I think (gv50 or gv55 or other)

2025-03-22 20:39:18  INFO: [U61db40e7] id: 865083038139382, command type: engineResume sent
2025-03-22 20:39:18  INFO: [U61db40e7: gl200 > 18.230.179.236] AT+GTOUT=,0,,,0,0,0,0,0,0,0,,,,,,,FFFF$
Antonio Junior3 days ago

Hi Anton, could you help me with this? I tried something in this format but it didn't work. In versions where the Context class existed, I used it and it worked, now I don't know how to deal with it. Thanks!

    @Override
    protected Object encodeCommand(Command command) {

        initDevicePassword(command, "");


        boolean gv50 = AttributeUtil.lookup(
                getCacheManager(), Keys.PROTOCOL_ACK.withPrefix(getProtocolName()), command.getDeviceId());

        System.out.println("GV50: " + gv50);

        boolean gv55 = AttributeUtil.lookup(
                getCacheManager(), Keys.PROTOCOL_ACK.withPrefix(getProtocolName()), command.getDeviceId());

        System.out.println("GV55: " + gv55);

        switch (command.getType()) {
            case Command.TYPE_POSITION_SINGLE:
                return formatCommand(command, "AT+GTRTO=%s,1,,,,,,FFFF$", Command.KEY_DEVICE_PASSWORD);
            case Command.TYPE_ENGINE_STOP:
                return formatCommand(command,
                        gv50 ? "AT+GTOUT=gv50,1,,,0,,,,,,3,,,,,,,FFFF$"
                                : gv55 ? "AT+GTOUT=gv55,1,,,0,,,,,,3,,,,,,,FFFF$"
                                : "AT+GTOUT=%s,1,,,0,0,0,0,0,0,0,,,,,,,FFFF$",
                        Command.KEY_DEVICE_PASSWORD);
            case Command.TYPE_ENGINE_RESUME:
                return formatCommand(command,
                        gv50 ? "AT+GTOUT=gv50,0,,,0,,,,,,3,,,,,,,FFFF$"
                                : gv55 ? "AT+GTOUT=gv55,0,,,0,,,,,,3,,,,,,,FFFF$"
                                : "AT+GTOUT=%s,0,,,0,0,0,0,0,0,0,,,,,,,FFFF$",
                        Command.KEY_DEVICE_PASSWORD);
            case Command.TYPE_IDENTIFICATION:
                return formatCommand(command, "AT+GTRTO=%s,8,,,,,,FFFF$", Command.KEY_DEVICE_PASSWORD);
            case Command.TYPE_REBOOT_DEVICE:
                return formatCommand(command, "AT+GTRTO=%s,3,,,,,,FFFF$", Command.KEY_DEVICE_PASSWORD);
            default:
                return null;
        }
    }
Anton Tananaev3 days ago

Why are you checking Keys.PROTOCOL_ACK for a device model?

Antonio Junior3 days ago

I put it as an example but I don't know how to do it, can you help me?

Anton Tananaev2 days ago

We have some examples in the code where we check the model, so I recommend searching.