Jump to content
New translation feature for the Shelly Forum ×

Scripting on PM Mini 3G


Recommended Posts

Hi,

I'm trying to run first scripts on a PM Mini 3G (Firmware: 1.2.2).

let i = -5;
print ("Start");
while (i < 11){
print (i);
i = i + 1;
}
print ("Stop");

Console shows:

shos_rpc_inst.c:230 script.putcode via WS_in 192.168.2.21:52392	17:05:39
5 17:05:40
6 17:05:40
7 17:05:40
8 17:05:40
9 17:05:40
10 17:05:40
Stop 17:05:40
shelly_user_script.:342 JS RAM stat: after user code: 98144 after: 97148, used: 996 17:05:40
shelly_notification:163 Status change of script:4: {"id":4,"running":true} 17:05:40
shos_rpc_inst.c:230 script.stop via WS_in 192.168.2.21:52392 17:05:48
shelly_notification:163 Status change of script:4: {"id":4,"running":false} 17:05:48

Is there anybody, who can explain me please, why "Start" isn't shown in console and why the counter-output in console only starts at +5 and not at -5? Changing <let i = 0> don't change output.

Edited by Rai
Link to comment
Share on other sites

I can confirm, same happens.

Some amount of debug log just disappears somewhere after running that?

 

Quote

shellypmminig3-ecda3bc11990 171 106298.662 1 2|shos_rpc_inst.c:230     script.putcode via WS_in 10.10.0.114:63348
shellypmminig3-ecda3bc11990 172 106298.783 1 /|5
shellypmminig3-ecda3bc11990 173 106298.784 1 /|6
shellypmminig3-ecda3bc11990 174 106298.784 1 /|7
shellypmminig3-ecda3bc11990 175 106298.785 1 /|8
shellypmminig3-ecda3bc11990 176 106298.785 1 /|9
shellypmminig3-ecda3bc11990 177 106298.785 1 /|10
shellypmminig3-ecda3bc11990 178 106298.785 1 /|Stop
shellypmminig3-ecda3bc11990 179 106298.786 1 2|shelly_user_script.:342 JS RAM stat: after user code: 152064 after: 151260, used: 804
shellypmminig3-ecda3bc11990 180 106298.798 1 2|shelly_notification:163 Status change of script:1: {"id":1,"running":true}

Same with UDP log etc...

Link to comment
Share on other sites

same issue also on new beta firmware

1.3.0-beta1

pupm-diagram-03.thumb.png.3d0f29f9e72f20033e146c377ed63d5f.png

 

higher resolution image: https://imgur.com/a/rTAS573

BZtMaes.png

 

There were 2 runs of script.

In first run, last command was enabled (line 7): console.log('end');

in second run, last command was disabled (commented): //console.log('end');

 

in both runs we got only last 7 logs.

ECO mode was disabled.

Regardless of use console.log or print command - the same behavior in both cases.

 

Edited by xnd
Link to comment
Share on other sites

  • 4 weeks later...

Vom Support kam: "Das von Ihnen gemeldete Problem ist unseren Entwicklern bekannt. Kann aber leider nicht behoben werden, da die Größe des Puffers für die Ergebnismeldungen begrenzt ist und dieser mit dieser Schleife überfüllt wird.  Eine entsprechende Information wird in Kürze auch unserer Dokumentation hinzugefügt."

Link to comment
Share on other sites

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...