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

fibaro.call arg len


10der

Question

Hi!

 

why Args length can't be more than  16331

Lua can process text strings in excess of 230,000 characters

 

 

 

 

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • Please login or register to see this code.

     

    [05.09.2020] [11:42:07] [DEBUG] [SCENE87]: 33932
    [05.09.2020] [11:42:07] [ERROR] [SCENE87]: std::exception: 'I/O error'

    the same

     

    --print(string.len(picture))
    --fibaro.call(1990, "myTestMethod", picture)
     
    api.post(
        "/devices/1990/action/myTestMethod",
        {
            args = {picture},
            delay = 0
        }
    )

     

    result in QA

    05.09.2020] [11:43:57] [DEBUG] [QUICKAPP1990]: /9j//gARTGF2YzU3LjEwNy4xMDAA/9sAQwAICAgJCAkLCwsLCwsN

     

    like a charm...

     

     

    @A.Socha hire me as QA for a food. please ?

    :D 

     

    stuped developers isses. shame you Fibaro

    • Like 1
    • Thanks 1
    Link to comment
    Share on other sites

    • 0
    8 hours ago, 10der said:

    hire me as QA for a food. please 

     

    congratulation, you know that there are limits ^^

     

    Anyway, tested with fibaro.call, max i got was 16332 (with GA and latest beta to validate)

     

    With api.post not reached limit, already at 2^20, will not try more because i don't see reason for that.

     

    [05.09.2020] [19:15:58] [DEBUG] [SCENE172]: 1048576

     

    [05.09.2020] [19:16:47] [DEBUG] [QUICKAPP839]: 1048576

     

    Interessting limit, because fibaro.call is nothing else than
     

    api.get("/callAction?deviceID=" .. deviceIDs .. "&name=" .. actionName .. "&arg1=".. args)

     

    and there is same limit when calling that manually, where api.get and api.post are using same lib/call type (http = Net.FHttp("127.0.0.1", 11111)). 

    Haven't tried with net.HTTPClient, no reason for such overhead if api.post works, still interesting to know if that is "callAction" limit or Net.FHttp:GET

     

     

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • @tinman GET method always limited by RFC. 

    i thing call method shoudl do via POST

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • btw a rest API says what get method we shoudl use for getting somthing. 

    who is was who develop mapping fibaro.call to GET request.

     

    Please login or register to see this link.

    Edited by 10der
    Link to comment
    Share on other sites

    • 0
    37 minutes ago, 10der said:

    @tinman GET method always limited by RFC. 

     

    sure ...

     

    Quote

    i thing call method shoudl do via POST

     

    ... and i would say "you are right",  based on swagger i would say callAction is desribed as  POST /devices/{deviceID}/action/{actionName}

     

    When i look inside (file fibaro_sdk.lua, which is part of API doc on HC3), the fibaro.call is get,

     

    Please login or register to see this code.

     

    and if i call that i get

    Please login or register to see this code.

    and QA shows:

    [05.09.2020] [20:28:12] [DEBUG] [QUICKAPP839]: onAction: {"actionName":"myTestMethod","args":[12121],"deviceId":839}

    [05.09.2020] [20:28:12] [DEBUG] [QUICKAPP839]: 12121

     

    But this might be of course old file (in which i found it) or compatibility and not yet deprecated thing, so don't judge me on that statement.

     

    For sure the way described in swagger works, still would be nice if @A.Socha could take a look on that (or maybe just add note to documentation and manuals.fibaro.com)

     

    Btw, the 16332 is true for device is with 3 numbers, and 16331 in your case :), so yes, it is 2^14 (RFC? no idea) limit.

    Edited by tinman
    • Like 1
    • Thanks 2
    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
    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...