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

Main Loop Security


Question

Posted

I would like to know if main loop have a security or something else??

I have a code where it does 3 request on json.

But all time beetween 25 to 29 min the code stop to run with the same error at the same line all the time.

Please login or register to see this code.

So does it have maximum request every x minutes.

Or if it is my code how can I check if json response is nil or not.

12 answers to this question

Recommended Posts

  • 0
Posted

you use tcp?

  • 0
  • Inquirer
  • Posted

    I use Net.FHttp.

    The funny thing is I remove all request except the one who got error, and I watched a tvshow for 45min without error.

    • 0
    Posted

    Shad, w/o checking will be hard to say why it crash

    can you send me that script i will check it later

    • 0
  • Inquirer
  • Posted

    Ok, I will send you.

    Thanks

    • 0
    Posted

    A.Socha, Shad, I often that with Net.FHttp, (That is why, among other things I've done the framework)

    There is the Expected value but found T_END at character 1 problem since the json library has changed if I don't talk nonsense

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" />

    br,

    • 0
    Posted

    Krikroff, can you send me short as possible code who gonna give you that?

    • 0
    Posted

    I'll try to find it, but not sure because I changed a lot of things since that time

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" />

    • 0
  • Inquirer
  • Posted

    I do some test tonight.

    But I remove a fibaro:sleep at then of my code, and again the code work for little more than 20 min.

    This afternoon, I put 4sec sleep beetween every loop and work for 50min.

    Tomorrow I do same test for two hours with a fibaro:sleep and I will see.

    A.Socha,

    I send you my code in hour. (One more short test ^^)

    • 0
    Posted

    Sorry, i can't reproduce the problem

    Please login or register to see this image.

    /emoticons/default_icon_rolleyes.gif" alt=":roll:" /> I leave some scripts run tonight to see...

    Shad, error is raised by line with a json.decode ?

    a similar post:

    Please login or register to see this link.

    ...

    • 0
  • Inquirer
  • Posted

    But the problem I must use more than one Fhttp request.

    I put a fibaro sleep of 1 sec. And is working for 30min now.

    • 0
    Guest Kuuno
    Posted

    i had exactly the same problem. do one test and see if it helps, for mee it seems to help for some reason...

    i put all code in main loop under button and then in main loop put code to press that button

    try this...

    • 0
  • Inquirer
  • Posted

    Not stupid that ^^, if the problem come again bug next time it pressed button it work again not like main loop.

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