[Ovmsdev] Javascript

Michael Balzer dexter at expeedo.de
Sun Dec 23 16:38:25 HKT 2018


Steve,

thanks for confirming, I've added an issue on this:
https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/issues/179

Regarding the bug: lucky find due to "PC" in the new backup usage string.

No need to explain, we're all human.

Regards,
Michael


Am 23.12.18 um 01:53 schrieb Stephen Casner:
> Michael,
>
> Thank you!  With the (small) font I'm using I could not easily see
> that the closing double quote was not the 7-bit ASCII one.  I had
> copy/pasted that from Mark's message, so some software must have done
> him a favor when he prepared his message.  I hate "smart" quotes.
>
> Thanks also for fixing the usage string expansion.  I don't know how
> to explain my writing of the wrong function other than perhaps I was
> copy/pasting from some other file of mine that worked differently or
> the design evolved and I didn't change the function.  The bug was not
> detected because every instance of '$' was followed by 'C' so
> find_first_of("$C") still found the right position and the text in
> usage strings was all lower case so no other 'C' was found.  There's
> only one instance of $G used (in the "power" command) and it follows a
> $C so again the wrong function still found the right position.
>
>                                                         -- Steve
>
> On Sun, 23 Dec 2018, Michael Balzer wrote:
>
>> Steve...
>>
>>> OVMS# vfs cat /store/scripts/helloworld.js
>>> OvmsPrint("Hello world!\n*"*);
>> ...is that closing quote really a typographic one? If so, try replacing that by a straight one.
>>
>> Regards,
>> Michael
>>
>>
>> Am 22.12.18 um 23:50 schrieb Stephen Casner:
>>> Well, I have tried several stages of rebuilding, but I still get an
>>> immediate crash from duktape.
>>>
>>> First I updated sources for ovms and esp-idf (the previous pull was
>>> October 29).  Still crashed.
>>>
>>> Then I changed from RELEASE to DEBUG to be like sdkconfig.default.hw31
>>> but that failed to link because I still had bluetooth configured so
>>> there was not enough space in IRAM, so I removed bluetooth and made
>>> clean.  Still crashed.
>>>
>>> Then I backed off to straight sdkconfig.default.hw31, though the make
>>> procedure then added some more defaults that should be checked in.
>>> Still crashed.
>>>
>>> The most obvious question is whether there is something wrong with my
>>> javascript file so that duktape is legitimately considering it in
>>> error, but the source looks clean:
>>>
>>> OVMS# vfs cat /store/scripts/helloworld.js
>>> OvmsPrint("Hello world!\n");
>>> OVMS#
>>>
>>> I don't have any other ideas yet.
>>>
>>>                                                         -- Steve
>>>
>>> On Sat, 22 Dec 2018, Stephen Casner wrote:
>>>
>>>> Michael,
>>>>
>>>> I used the same sequence of commands that you did.  The only
>>>> difference is that I did not capitalize World and I did include an
>>>> exclamation point after it (since I did copy/paste from Mark's
>>>> message).
>>>>
>>>> Maybe it is an insufficient free memory problem.  But I just tried
>>>> again via an ssh console with this starting condition:
>>>>
>>>> Free 8-bit 91352/230700, 32-bit 1236/3144, SPIRAM 4032872/4194252
>>>>
>>>> That should be sufficient.
>>>>
>>>> Attached is a diff of sdkconfig.default.hw31 to my sdkconfig.  The
>>>> only thing I noticed that might be an explanation is the optimization
>>>> level set to RELEASE vs DEBUG.
>>>>
>>>>                                                         -- Steve
>>>>
>>>> On Sat, 22 Dec 2018, Michael Balzer wrote:
>>>>
>>>>> Steve,
>>>>>
>>>>> I just tried this:
>>>>>
>>>>> OVMS# vfs append 'OvmsPrint("Hello World\n");' /store/scripts/helloworld.js
>>>>> OVMS# vfs cat /store/scripts/helloworld.js
>>>>> OvmsPrint("Hello World\n");
>>>>> OVMS# . helloworld.js
>>>>> Hello World
>>>>> OVMS#
>>>>>
>>>>> So no, the blank line isn't necessary.
>>>>>
>>>>> Regards,
>>>>> Michael
>>>>>
>>>>>
>>>>> Am 22.12.18 um 09:14 schrieb Stephen Casner:
>>>>>> Mark,
>>>>>>
>>>>>> There is a blank line at the end of your script that I don't have.
>>>>>> Perhaps that is required for javascript?  I'll try that soon.  On the
>>>>>> other hand, crashing when the input format isn't as desired is not the
>>>>>> best error handling approach.
>>>>>>
>>>>>> I do have some deviations from sdkconfig.default.hw31, but not in the
>>>>>> spec for the duktape library.
>>>>>>
>>>>>>                                                         -- Steve
>>>>>>
>>>>>> On Sat, 22 Dec 2018, Mark Webb-Johnson wrote:
>>>>>>
>>>>>>> Steve,
>>>>>>>
>>>>>>> I get this:
>>>>>>>
>>>>>>> OVMS# vfs cat /sd/helloworld.js
>>>>>>> OvmsPrint("Hello world\n");
>>>>>>>
>>>>>>> OVMS# . /sd/helloworld.js
>>>>>>> Hello world
>>>>>>>
>>>>>>> Maybe your SDKCONFIG different than mine? I am using the sdkconfig.default.hw31.
>>>>>>>
>>>>>>> Regards, Mark.
> _______________________________________________
> 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