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


Recommended Posts

  • Topic Author
  • Posted

    Did you first install openssl with brew?

    The openssl dir will then typically be in /opt/homebrew/opt/openssl

     

    Posted

    I've tried to install openssl after installing luarocks and before hc3emu. And later, also try to reinstall after hc3emu. No difference: as I see from log - hc3emu try to install open ssl with the same result as standalone installation: missing dependencies for lua-websockets-bit32 2.0.1-8.

  • Topic Author
  • Posted

    You have done 

    Please login or register to see this code.

    and it worked?


    You have then used 

    Please login or register to see this code.

     

    and you still get complaints it can't find the header file for openssl ?

    Posted (edited)

    No - previously I did:

    brew install luasec - as the log prompts. It failed and installing hc3emu too.

     

    But now I did:

    brew install openssl (patience, very long process)

    sudo luarocks install luasec

    sudo luarocks install hc3emu

    Then take .json files from your repository to my_project/.vscode

    And on my Fusion OSX 12.6 VM it works after all. 

     

    Because of performance and other reasons I cannot work on the VM. Unfortunately, all above can't be repeated with success on my physical mac.

    There are many errors that investigating over the forum seems to me useless. It's probably a real mess in there.

    Edited by Łukasz997
    Posted

    Maybe close to the success. After total removing, reinstalling I've come to this debug console message:

    Please login or register to see this code.

    I have in ./.vscode: launch, settings, tasks copied unchanged from your repo. In '.' project directory I have .hc3emu with credentials, and hc3emu.lua unchanged from repo (is it necessary?)

    Could you tell me where and what exactly I have to set?

  • Topic Author
  • Posted

    Yes, it looks like you managed to install 👍

     

    You need to generate a config file.

    There are 2 ways to generate it.

    First, you need to set the emulator in offline mode, otherwise it will complain that hc3emu.URL is not set 

    Do the by adding the directive 

    Please login or register to see this code.

    your New_QA.lua in this case.

     

    First approach is to install the vscode extension "Live Server" by Ritwick.

    ...and also add the directive 

    Please login or register to see this code.

    to your New_QA.lua.

    This directive tells the emulator to start generating webUIs for the emulator and QAs - a little like fibemu.

     

    Then you have a directory generated in your workspace folder named 'emu'

    There you have _setup.html

    If you open that page with live server extension (right click on file and "Open with Live Server")

    you have a menu to generate and edit the settings files. 

    Please login or register to see this attachment.

    There are 2 files, one project file in your workspace, and one "global" in your home directory". The workspace overrides the global. 
    I recommend that you set the HC3 IP, user, pwd in the global and leave them out from the project (or don't generate a project config at all).

    The edit settings is a simple web form to edit the values (there is a save button at the bottom)

     

     

    The second approach is that you run 

    Please login or register to see this code.

    in your New_QA.lua

    It will generate a project and global file

    Please login or register to see this code.

    and

    Please login or register to see this code.

    and then you need to edit the json with an editor. I recommend to only set the credentials in the global/homedir config file.

     

  • Topic Author
  • Posted

    To be more specific. "Live Server" opens an external web browser page. And it is easiest, but have some issues.

    I use instead the vscode extension "Live Preview" by Microsoft.

    It works better but have the drawback that the html file needs to be open in vscode for to preview to update.

    Posted

    The live server does not work - it means it repeatedly refresh the page (not main, but the web form; safari, firefox).

    Microsoft preview works. But...

    Edit global lead me to the web form. I can write data and install global config. However after reopen the web form - the IP number remains as at the first open, my IP was not saved. Interesting but login and password was saved.

    I have to leave it for a day.

    Today I can't open the config for edit. To be honest, I have no idea what I did that situation changes. 192.168.2.101 is proper IP number of my mac.

    File named .hc3emu.json is present in my homedir (//Users/lukasz). I edit it and correct ip for HC3. The error below - remains.

    When I remove directive 

    --%%offline=true

    I have still missing URL at debug console

     

    Please login or register to see this image.

    /monthly_2025_04/image.png.26214dc55e4f613871b128dcd4da1110.png" />

     

     

  • Topic Author
  • Posted

    The emulator needs to be running for the web forms to work (they make calls back to the running emulator).

    So you need to have a QA running. The fetch error you get is because there is no answer to the request the form is making.

    Posted (edited)

    Thank you very much for help. Now, all data is saved.

    However the message:

    [29.04.2025][20:00:00][SYSERR]  Missing hc3emu.URL - Please set url to HC3 in config file

    still persists when I try to run the task to download the qa from HC3. Or does not have --offline=true in my LUA file.

    Edited by Łukasz997
    Posted

    I left IP with '<' and '>' and probably this caused "missing url" .

    No more this error. But - running simplest QA code (function onInit printing something)I have the following message now:

    Please login or register to see this code.

    Could you advice me please how can I mend it?

  • Topic Author
  • Posted
    6 hours ago, Łukasz997 said:

    I left IP with '<' and '>' and probably this caused "missing url" .

    No more this error. But - running simplest QA code (function onInit printing something)I have the following message now:

    Please login or register to see this code.

    Could you advice me please how can I mend it?

    Downgrade to v1.0.80

    Please login or register to see this code.


    there is some issues in the latest build

    • Thanks 1
  • Topic Author
  • Posted

    There will be a new version tomorrow. 

    I remade a large part of the API architecture in v1.0.81, and I'm slowly recovering from all bugs that I introduced :-)


     

    • Like 1
  • Topic Author
  • Posted

    There is a pre-release v1.0.87 out now. It should run. 
    Still some minor improvements coming up for v1.0.90...

    • Like 1
    Posted
    3 godziny temu, jgab napisał:

    Downgrade to v1.0.80

    Please login or register to see this code.


    there is some issues in the latest build

    Thank you - now it's working.

  • Topic Author
  • Posted

     

    Pushed v1.0.90-1

    Please login or register to see this code.

    • Major reimplementation of the API code. Hopefully better performance and easier to maintain...
    • New installation bootstrap

    Please login or register to see this code.

    Ex.

     

    Please login or register to see this code.

    Will install .hc3emu.json in home directory with the user/password/url setup.

     

    The new API approach uses a method that if offline=false, a small helper QA is installed on the HC3 (invisible) to help out with some API REST calls that are tricky to do remotely. Its name is 'hc3emuHelper'. When the emulator is run it will check if helper is installed, and if not install it. (It will also check version, and upgrade if a new is available, but I believe that the helper will not be upgraded a lot...). This should be totally invisible and nothing to care about.

    In the past this "service" was done by the proxy QA that was installed, but now the proxy and helper are separate, allowing all REST API calls even if we don't run with a proxy.

    • Like 1
    Posted

    After upgrade 1.0.91 it gives the following error:

    Please login or register to see this code.

    I'm not pretty sure if I can give --%%install once or always, but whatever I did the result is as above.

  • Topic Author
  • Posted
    3 hours ago, Łukasz997 said:

    After upgrade 1.0.91 it gives the following error:

    Please login or register to see this code.

    I'm not pretty sure if I can give --%%install once or always, but whatever I did the result is as above.

    Sorry, bug I thought was fixed..., try v1.0.92 that I just uploaded

    Posted (edited)

    After upgrading to .93 proxy shows only few messages and no more, but buttons are functional.

    I thought that maybe proxy should be installed again by .93 and delete the proxy.

    And now I have:

    Please login or register to see this code.

     

    This is messages after deleting the proxy. New proxy, despite the errors, is installed. After I restarted it again, only the difference is: Proxy found. In .80 this QA is working OK.

    ***

    I'm wondering If you're feeling pressured to quickly fix this complicated and large application... If so, please don't. I’m happy to downgrade to stable version .80 and wait patiently for the updated release. Thank you for all.

    ***

    EDIT: the probably cause is that local Variable of QA was not set. In such case getVariable does not return nil or empty string but something other like NOTHING. And json.decode fails with it. Maybe it will help. Please see the value of set.getVariable("non_existing_var"):

    Please login or register to see this image.

    /monthly_2025_05/image.png.8ef18b01d950d32351fad856f76ee2af.png" />

     

    Edited by Łukasz997
  • Topic Author
  • Posted

    Yes, it dies because you call json.decode with a bad value

    Please login or register to see this code.

    That error you will get on the HC3 too.

    self:getVariable( returns the empty string for non-existent variables (Fibaro's decision).

    In the vscode watch panel it looks like jsonVal = 

    because it's an empty string as value - not so clear maybe... but they decided not to quote strings...

     

    Trying to decode an empty string gives the error message "json.decode error: value expected at position 1"
     

    So, I would file this as "expected emulator/HC3 behavior"

     

    I do have other errors though, so please report your issues... :-) 

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