Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

"Cannot query interpreter state" in Scene


Question

Posted

Hi

 

I have had a scene running for 6 month without issues. Now it gives an error "[ERROR] 06:43:01: Cannot query interpreter state". This must be due to changes from 4.140 to any of the betas (I only updated to a beta to "eventually solve locking issued with Popp thermostat). No row references of the issue in the LUA... Couldn't be to hard to track this down when I have some spare time. But in the meantime... Anyone with knowledge of where to start looking and what could have caused it?

 

 

/Peo

Recommended Posts

  • 0
Posted (edited)

I have the same error in multiple scenes. First I thought that it didn't mean the scene wouldn't work anymore but the last days i've seen several instances of scenes not executing when they should.

Example: this morning a motion sensor was triggered at 7:24:33. This should have triggered a scene to set the house to status "Awake". This scene did NOT run and at exactly 7: 24:35 the Error: Cannot query interpreter state is mentioned in the debugspace of the scene.

So it's not an harmless error: sometimes it prevents a scene from running !

Any comment from Fibaro very welcome.

Edited by wienog
  • 0
Posted (edited)

same error (sporadic), v4.144, very simple scene on empty HC2, so must be something generic:

 

Please login or register to see this code.

 

Edited by tinman
  • Like 1
  • 0
Posted

What happens if you use sleep instead of setTimeout? This is a long shot: maybe it is the combination of setTimeout and killOtherInstances. I base this on an observation of some unexpected behaviour of one of my scenes. I do not post code, because I still have to investigate... It might be a programming error (due to insufficient cafeine).

  • 0
Posted

that was my thought as well, but no, here simplified scene, and i can click as much i will, no error as it is very random / sporadic.

 

Please login or register to see this attachment.

  • 0
Posted

@tinman thanks. Maybe it is a kind of race bug, or some locking/multithread issue. Mabe it depends on what other stuff is going on. CPU memory pressure? Just thinking out loud. Tough problem! Sorry, I ran out of ideas. On a PC I would set a flag, to let the OS think it runs on one CPU only.

  • 0
Posted

Hi guys!

 

First of all, don't use killOtherInstances.

 

Use:

Please login or register to see this code.

to be exact:

Please login or register to see this code.

 

Secondly, could you post a screenshot or describe accurately where this exactly appears?

Quote

"Cannot query interpreter state"

 

  • 0
  • Inquirer
  • Posted

    I have no setTimeout and exit with abort only. for example...

     

    Please login or register to see this code.

     

    So the problem is not related to setTimeout or killOtherIntances

     

    /Peo

    • 0
    Posted
    1 minute ago, pos said:

    So the problem is not related to setTimeout or killOtherIntances

     

    Thanks... That eliminates a few possibilities. Here's an idea: does it only happen if your scene set or gets global variables?

    • 0
    Posted

    Hi @pos!

     

    It was just a side note about this:

    Please login or register to see this code.

     

    I still want to help you but I need more information about the error, a screenshot would be great ; )

    • 0
  • Inquirer
  • Posted

    "Cannot query intepreter state"  was just a text output in the debug console of the scene window. And it does not happen that often. Therefor I do not have a screenshot right now. And as it show up alone in the debug console without anything else, I doubt it can be of any help. I can supply the scene code and/or do changes to track it down.

     

    I can of course print out debug everywhere so it is easier to see where in the code it halts. But if it takes 5-6 days it will print a lot...

     

    9 minutes ago, petergebruers said:

     

    Thanks... That eliminates a few possibilities. Here's an idea: does it only happen if your scene set or gets global variables?

     

    Could be so.... I cannot say it for sure yet. I posted to maybe get some extra info before I started to debug it.

    • 0
    Posted
    44 minutes ago, I.Srodka said:

    Hi guys!

     

    First of all, don't use killOtherInstances.

     

    Use:

    Please login or register to see this code.

     

     

    OT: this is like don't use car, use boat ;)

    • 0
    Posted

    I have been getting this for a while now too.

    Please login or register to see this attachment.

    • 0
    Posted
    On 27-11-2017 at 3:05 PM, tinman said:

     

    OT: this is like don't use car, use boat ;)

    AFAIK both codes serve a different purpose.

    %% killOtherInstances will kill all PREVIOUS started instances of a scene and the NEWEST instance will go through.

    This can be used when you have a scene with a counter that you need to reset to 0 with a certain trigger.

    For example: a scene is triggered by a motion sensor and switches on a light and switches it off again after a period of no motion of, say, 5 minutes.

    With the %% killOtherInstances and the 'value' of the motion sensor in the header of the code, the same scene will every time again restart from zero when the sensor is triggered.

    (You don't need to set a trigger for the motionsensor in the main code, putting the number of the device in the header followed by 'value' is enough to trigger the scene every time the sensor is triggered, whether it is triggered or safe again)

     

    if fibaro:countScenes() > 1 then fibaro:abort(); will kill every NEW instance of the scene and keep the first instance running. In the example above this would mean that the light would switch off after 5 minutes even if the sensor has been triggered many times in these five minutes, meaning that there is still someone in the room.

    So it is almost only useful to minimize the number of instances of a scene.

    • 0
    Posted

    Same error (Cannot query interpreter state)  since 4.150 on scene working correctly for several months before.

     

     

    • 0
    Posted

    The same error in simple scene.

    From ver 4.150

     

    • 0
    Posted

    Thanks for your feedback : )

     

    We are currently testing this issue.

    • 0
    Posted

    Could you tell whether this error appears also in scenes and cases without:

    Please login or register to see this code.

     in the scene header?

    • 0
  • Inquirer
  • Posted

    I have never used that and still sees the problem

     

    • 0
    Posted (edited)

    Please login or register to see this code.

    here is the code of one of the scenes  ( Device 84 = everspring SP103 )

    Please login or register to see this code.

    Declaration Max Running Instance = 6  

    Please login or register to see this attachment.

    Edited by henri-allauch
    Add Log
    • 0
    Posted

    Hi evrybody

    Please check if used ids in scene are realy working in system ?

    I finded in my scene id, witch in fact there is not  in system.

    Join the conversation

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

    Guest
    Answer this question...

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