[Ovmsdev] Doubs in implementation with nodejs.
Mark Webb-Johnson
mark at webb-johnson.net
Thu Aug 4 11:06:18 HKT 2022
Gregg,
We really need to know exactly what he is doing, and with what protocols.
From the way you seem to describe it, you:
Have a custom app, in react native
You have a custom server, in NodeJS
You presumably have some custom protocol/api between your app and server
Your NodeJS server is talking to the OVMS server using your own implementation of v2 protocol
Is that correct? If so, then #4 is the only issue. The V2 protocol is fairly well documented, here:
https://docs.openvehicles.com/en/latest/protocol_v2/index.html
It is proprietary and the initial negotiation is complicated, but if you have established the crypto connection and received the data, then you have done the hard part. Issuing commands should be easy.
In v2 protocol, locking/unlocking is performed via the “C” command.
Probably easiest to look at the sample code in the iOS or Android Apps to see how that is done. For iOS, see:
https://github.com/openvehicles/Open-Vehicle-iOS/blob/master/OpenVehicleApp/ovms/ovmsAppDelegate.m
(The commandIssue method, and how it is called)
Regards, Mark.
> On 3 Aug 2022, at 11:03 PM, gregg hansen <gregg at rabbitev.com> wrote:
>
> Pablo has not been able to access the list. He is getting authentication errors, so while he works through that I thought I would answer for him...
>
> "The MP commands are the raw data I am trying to send to the car to open and close the car."
>
> The devices are using the V2 server, so I think fixed MP commands make the most sense. Pablo is trying to figure out how to make that work, and so far has not been successful.
>
>
>
> On Sun, Jul 31, 2022 at 2:26 AM Michael Balzer <dexter at expeedo.de <mailto:dexter at expeedo.de>> wrote:
> Pablo,
>
> a bit more information on how you connect to the car would be helpful here.
>
> Arbitrary remote shell command execution is supported by the module's HTTP API (/api/execute), the module's SSH server, the "V2 protocol" server via MP command 7 and any "V3" (MQTT) server via the /client/command topic scheme. Plus there's a secondary (non-standard) HTTP command API available on my server ovms.dexters-web.de <http://ovms.dexters-web.de/> (public API of my custom web shell).
>
> Lock & unlock are also available as fixed MP commands (20,22) on a V2 server, along with a set of other standard App calls. These do not run via the shell but translate to direct internal execution.
>
> Command execution has not yet been implemented for the "V2" server's HTTP API. But you can of course implement that if you use that API.
>
> Docs:
> https://docs.openvehicles.com/en/latest/components/ovms_webserver/docs/index.html#authorization <https://docs.openvehicles.com/en/latest/components/ovms_webserver/docs/index.html#authorization>
> https://docs.openvehicles.com/en/latest/userguide/console.html#ssh-console <https://docs.openvehicles.com/en/latest/userguide/console.html#ssh-console>
> https://docs.openvehicles.com/en/latest/protocol_v2/commands.html#execute-sms-command <https://docs.openvehicles.com/en/latest/protocol_v2/commands.html#execute-sms-command>
> https://docs.openvehicles.com/en/latest/protocol_v2/commands.html#lock-car <https://docs.openvehicles.com/en/latest/protocol_v2/commands.html#lock-car>
> https://docs.openvehicles.com/en/latest/protocol_v2/commands.html#unlock-car <https://docs.openvehicles.com/en/latest/protocol_v2/commands.html#unlock-car>
> http://lists.openvehicles.com/pipermail/ovmsdev/2018-July/012641.html <http://lists.openvehicles.com/pipermail/ovmsdev/2018-July/012641.html>
> http://lists.openvehicles.com/pipermail/ovmsdev/2018-July/012696.html <http://lists.openvehicles.com/pipermail/ovmsdev/2018-July/012696.html>
> https://docs.openvehicles.com/en/latest/protocol_httpapi/requests.html#not-yet-implemented <https://docs.openvehicles.com/en/latest/protocol_httpapi/requests.html#not-yet-implemented>
> Which one are you referring to?
>
> Regards,
> Michael
>
>
> Am 29.07.22 um 19:28 schrieb Pablo Cabrera:
>> Hello OVMS team, we are currently working with an implementation with OVMS in a react native app with a NodeJS back-end.
>> Currently we can connect with the cars and rescue some data like the status of the battery or GPS location, but now we need to send commands to lock and unlock the cars from the same app, when we send a command I get a response that the command is received in the car, but the command is not executed in the bash.
>>
>> I don't know if you can send me more info about how to make the car receive bash commands from remote connections, or how can I send it from the NodeJs server into the bash of the car.
>>
>> Thanks for your time and help.
>>
>>
>> _______________________________________________
>> OvmsDev mailing list
>> OvmsDev at lists.openvehicles.com <mailto:OvmsDev at lists.openvehicles.com>
>> http://lists.openvehicles.com/mailman/listinfo/ovmsdev <http://lists.openvehicles.com/mailman/listinfo/ovmsdev>
>
> --
> Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
> Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.openvehicles.com <mailto:OvmsDev at lists.openvehicles.com>
> http://lists.openvehicles.com/mailman/listinfo/ovmsdev <http://lists.openvehicles.com/mailman/listinfo/ovmsdev>
>
>
> --
>
> RabbitEV
> Driving Electric Cars
> RabbitEV.com
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.openvehicles.com
> http://lists.openvehicles.com/mailman/listinfo/ovmsdev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20220804/38994279/attachment.htm>
More information about the OvmsDev
mailing list