-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send command "how-to" #440
Comments
I think you should either use the |
What I don't understand is : how traccar knows howto send the command ? Usualy whith my own phone, I send sms command to the device. If I write the #stop#passwd# this command must go out my server; how does it do that ? Do I need a center sms server ? |
It sends commands over the internet channel, which is opened when your device connects to the traccar server. Again, your device must support this way of communication. Maybe your particular device can support SMS commands only. To figure that out you should either read documentation about your device. |
I am getting below message after sending any command to "Meitrack T1" Traccar 3.3 {"reason":"java.lang.ClassNotFoundException: org.traccar.model.Factory","success":false} |
It is not supported with traccar 3.3 for now. Use 3.2 instead воскресенье, 3 января 2016 г. пользователь khfrabbi написал:
Kind regards, Vitaly Litvak |
As per your suggestion I did, now it shows another message {"reason":"The device is not registered on the server","success":false} What can I do to register my device on the server? Meitrack T1 Device |
This means that at the moment you were trying to send command your device wasn't connected to the server. |
I don't know what mistake I did.
Please suggest what can I do now NB : Commands using SMS working fine on my Meitrack T1 Device |
@vitalidze I have the same issue like stated here earlier. |
@hanselsen I don't have any estimated date. It will be resolved when I find some free time to install version 3.3 and update instructions. |
Allright thanks for the quick reply. I will be patient then. Good luck. |
@vitalidze On https://github.com/vitalidze/traccar-web/blob/dev/src/main/java/org/traccar/web/server/model/DataServiceImpl.java#L1020 there is the error. But I see that local variable isn't used afterwards. Maybe a solution to just throw away line 1020? |
@hanselsen It is used on the next line. |
Oh stupid. I search for it using CTRL+F but there was a whitespace after it, so it wasn't found. Haha excuse me |
@vitalidze I've created, from what I think, a workaround (or solution). Would you care to take a look at my approach? |
@hanselsen so your only change is that you have removed this line Class<?> backendFactoryClass = Class.forName("org.traccar.model.Factory"); And changed this one: Method objectFromJson = backendJsonConverterClass.getDeclaredMethod("objectFromJson", Reader.class, Class.class); Right? It looks correct for version 3.3, but it won't work for version 3.2 and 3.1. I cannot do it this way because I want compatibility for all versions of traccar that support sending of commands. Anyway, thank you for the suggestion. My solution would be to surround // ...
Method objectFromJson;
try {
Class<?> backendFactoryClass = Class.forName("org.traccar.model.Factory");
objectFromJson = backendJsonConverterClass.getDeclaredMethod("objectFromJson", Reader.class, backendFactoryClass);
} catch (ClassNotFoundException e) {
objectFromJson = backendJsonConverterClass.getDeclaredMethod("objectFromJson", Reader.class, Class.class);
}
// ... |
Yes, but I also enhanced the Catch clause, so that if the Command is not supported, not a crash will display, but it's showing that it's not supported. Anyhow, for the backwards compatibility, I think you're definitely on the right track. Although I'm not very fond of try and catch for implementing behaviour, but I googled a bit and it seems you're solution is the way to go. |
Hello |
@ahmedtab to figure out the reason of what's happening please provide contents of As for the "Custom type" it may work if your command is a text command and you set it in a proper format. I would play with custom commands in your case. |
Hello,
Traccar3.2 but last traccar-web.war (12-23)
I want to send cut OFF/ON engine, I don't know where/howto parameter SMS function please ?
Thanks.
The text was updated successfully, but these errors were encountered: