<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Thank you. Found my bug!</p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 9/11/2024 1:44 AM, Michael Balzer
      via OvmsDev wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:c446177d-2684-48d2-9649-d6f10d005917@expeedo.de">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      See
      <a class="moz-txt-link-freetext"
href="https://docs.openvehicles.com/en/latest/userguide/scripting.html#global-context"
        moz-do-not-send="true">https://docs.openvehicles.com/en/latest/userguide/scripting.html#global-context</a><br>
      <br>
      â€¦although that's not as clear as it should be.<br>
      <br>
      "print to the system console as an informational message" actually
      means it's sent to the system log.<br>
      <br>
      The log line has level "info" and since refactoring the Duktape
      modules, the tag is "ovms-duk-util". Example:<br>
      <pre
style="color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; overflow-wrap: break-word; white-space: pre-wrap;">2024-09-09 17:46:13.170 CEST I (511230380) ovms-duk-util: [lib/tasmotasp.js:73:processResult] TasmotaSP getPowerState: power=off
</pre>
      <br>
      See DukOvmsPrint() for the implementation.<br
        class="Apple-interchange-newline">
      <br>
      Regards,<br>
      Michael<br>
      <br>
      <br>
      <div class="moz-cite-prefix">Am 11.09.24 um 01:36 schrieb
        solterra--- via OvmsDev:<br>
      </div>
      <blockquote type="cite"
        cite="mid:6ac27210-12d2-4d59-9069-e1a3486db6dc@kezarnet.com">
        <meta http-equiv="content-type"
          content="text/html; charset=UTF-8">
        <p>I'm currently working on a script that utilizes PubSub, but
          I'm running into an issue where the background function
          doesn't seem to display any output in the shell. I'm following
          the example from the website:</p>
        <pre class="!overflow-visible"><div
class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="overflow-y-auto p-4" dir="ltr"><code
        class="!whitespace-pre hljs language-javascript"><span
        class="hljs-keyword">var</span> myTicker = <span
        class="hljs-keyword">function</span>(<span class="hljs-params">msg, data</span>) { 
    <span class="hljs-title function_">print</span>(<span
        class="hljs-string">"Event: "</span> + msg + <span
        class="hljs-string">"\n"</span>); 
};

<span class="hljs-title class_">PubSub</span>.<span
        class="hljs-title function_">subscribe</span>(<span
        class="hljs-string">"ticker.10"</span>, myTicker);
</code></div></div></pre>
        <p>For some reason, I can't get the <code>myTicker</code>
          function to output anything when triggered. It seems like the
          print statements aren't being executed as expected.</p>
        <p>Has anyone encountered this before, or does anyone have
          suggestions on what might be causing this issue?</p>
        <p>Thanks in advance!</p>
      </blockquote>
      <br>
      <pre class="moz-signature" cols="72">-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26</pre>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.openvehicles.com">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a>
</pre>
    </blockquote>
  </body>
</html>