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

JSON decode in main loop problem


Question

Posted

When I use json decode in main loop on virtual devices it stops working after a while and when I debug I usually get this error message: Expected value but found T_END at character 1.

Right now I'm getting this problem when I use the script below to see whats currently playing on my sat box (Vu+ Solo 2 with OpenPLI).

Please login or register to see this code.

I had a similar issue when I used json decode to get temperature from Domoticz also, in that case I assigned a button to execute the code to work without problems. Anyone knows whats causing this and if I can add some code to get around this when it happens so the main loop doesn't stop?

6 answers to this question

Recommended Posts

  • 0
Posted

Have you tried the new disconnect method?

  • 0
  • Inquirer
  • Posted
    Have you tried the new disconnect method?

    No I haven't, but doesn't disconnect only work with FTcpSocket and not FHttp?

    [ Added: 2013-10-20, 14:21 ]

    I have now set the variables to zero in the beginning of the script to see if it helps, so far it seems to be working

    Please login or register to see this code.

    • 0
    Posted

    Good point...

    declaring osd and prog twice will probably increase the load and men usage

    • 0
    Posted

    I have the same problem, the main loop will error out within 24 hours. Restart of HC2 doesn't help. I found out that if I alter anything within the code (just add some bogus text into one of the debug lines for example) and save the virtual device again will make it come to life again, until a few hours later...

    • 0
  • Inquirer
  • Posted
    I have the same problem, the main loop will error out within 24 hours. Restart of HC2 doesn't help. I found out that if I alter anything within the code (just add some bogus text into one of the debug lines for example) and save the virtual device again will make it come to life again, until a few hours later...

    My attempt to zero out the variables didn't help, the main loop still errors out just like you described and the error message is the same: "Expected value but found T_END at character 1"

    Please login or register to see this image.

    /emoticons/default_icon_sad.gif" alt=":-(" />

    • 0
    Posted

    Raul, in main loop with my own experience i can say that: not declare an TCP or HTTP object more than once

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" /> I use the following code with no problems:

    Please login or register to see this code.

    Replace Net.FTcpSocket with Net.FHttp etc...

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