[Ovmsdev] Script engine not working?

Michael Balzer dexter at expeedo.de
Sat Aug 1 17:45:07 HKT 2020


Soko,

reading the source is always a good thing :-), but there's actually also
documentation on scripting:
https://docs.openvehicles.com/en/latest/userguide/scripting.html

Scripts are run by their name, not path. So you would simply do…

OVMS# script run vfstest
…or shorter…
OVMS# . vfstest

Oops… having tried a command (non-javascript) script from the web
console just now: apparently there is a bug in the output processing,
that currently only works on the USB console. I'll have a look at that.
But command scripts really can only execute commands, you'll be using
javascript for almost everything except most basic tasks, and those work
remotely, via web & ssh.

Regards,
Michael


Am 01.08.20 um 10:51 schrieb Soko:
> Hey guys,
>
> I've tried to use the script engine and created some files. But when I
> run the files nothing happens. No output at all. Here is my webc
> onsole trys:
>
> OVMS# vfs ls /store
> [DIR]     01-Jan-1980 00:00  ovms_config/
> [DIR]     01-Aug-2020 10:12  scripts/
> OVMS# vfs ls /store/scripts
>      35   01-Aug-2020 10:27  vfstest.bat
>      35   01-Aug-2020 10:29  vfstest.js
>      35   01-Aug-2020 10:29  vfstest
>      35   01-Aug-2020 10:31  vfstest.cm
>      35   01-Aug-2020 10:31  vfstest.cmd
>      35   01-Aug-2020 10:33  vfstest.py
> OVMS# vfs head /store/scripts/vfstest
> vfs ls /store
> vfs ls /store/scripts
> OVMS# script run /store/scripts/vfstest
>
> I would expect the output of the two first commands after running the
> script! What am I doing wrong here? I've also tried some different
> file extensions as you can see. I've also had a look into the source
> (static void script_ovms(...)) to find the special file extension that
> is needed. But apparently everything besides .js is handled as command
> script.
>
> Soko
>
> PS: I've created the files via the web editor. Do they need any
> special termination character after each line?
>
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.openvehicles.com
> http://lists.openvehicles.com/mailman/listinfo/ovmsdev

-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26





More information about the OvmsDev mailing list