Jump to content
🌟 Shop Black Friday - up to 50% OFF 🌟 Black-Friday-Angebote - bis zu 50% Rabatt! 🌟 Offres Black Friday : jusqu’à -50%! 🌟 ×

Recommended Posts

Posted (edited)

  

sorry for duplicate post, I just found this section fits better this scripting issue.

Feel free to delete my previous post here under: Home >  Devices     > Shelly Plus (Gen2) devices    > Shelly Plus Plug S :

 

With latest firmware:

"fw_id": "20240425-141453/1.3.0-ga3fdd3d",
"ver": "1.3.0",

Diagnostic data included below.

See:

GbN3ftg.png

 

Also with such version of the code:

  • print('start');
    
    function main() {
      var i = 0;
      while (i < 12) {
        i = i + 1;
        console.log(i);
      }
    
      print('end');
    }
    
    Timer.set(2000, false, main);

output:

 

dpdheP5.png

 

Also reproducible on other devices (Shelly Plus 1PM, Shelly Pro 4PM)

 

-----

 

also the same issue was reported earlier:

 

 

 

diagnostics-shelly-plusplugs-data.txt diagnostics-shelly-plusplugs-debug-log.txt

Edited by xnd
Posted

To be honest, it is not true that it is an known issue IMHO. As I replied on Facebook, the issue is new (I upgraded last week when testing the script unfortunately), I didn't notice before. Before all prints came out. Now only the first few prints and the last few come out. There should at least be an option to flush your prints (as in wait for them, not throw them to /dev/null ), otherwise it's quite useless.

But, as stated, it is an introduced bug, and I assume it should be fixable.

  • 3 weeks later...
Posted

I have the same problem with Plus1PM und Plus2PM.

It is not possible to test anything, because it is logging absolutely nothing. A I do not know the names of the events, I can not continue without Log-Output...

Plus1PM 20240430-105751/1.3.1-gd8534ee   (here it worked for a short time, I think I made an FW-Update than...)
Plus2PM 20240522-112837/1.3.2-g34c651b

I just started programming shelly´s - but it ended very soon 😞

  • 3 months later...
  • 2 weeks later...
Posted (edited)
    let PrintLog = "";
    for (let i = 0; i <= 20; i++) {
      PrintLog = PrintLog + i + "; ";
    }
    print(PrintLog);
    PrintLog = "";

Something like this works.

Make ; separated line (\n (<- linefeed) might work too) and print that out.

Reason for Limiting Print Rows

  • The limitation on print statements is in place to manage memory and processing resources efficiently. 
  • Excessive logging can slow down the device and consume more memory, which can affect performance and stability.

 

Edited by ViX
Missing ;
Posted

Thank you for your answer @ViX

I understand the limitations there.

In this case, users / developers writing scripts for Shelly devices needs to be aware of this limitation. Please provide this information in the documentation https://shelly-api-docs.shelly.cloud/gen2/Scripts/ShellyScriptLanguageFeatures

  • also it would be great to have some real examples how to overcome such limitation

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...