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

net.HTTPClient() + scene issue with port


10der

Question

[31.05.2020] [08:31:02] [DEBUG] [SCENE41]: ++++++++++++++++++
[31.05.2020] [08:31:02] [DEBUG] [SCENE41]: http://192.168.1.10:8086/write?db=smarthome
[31.05.2020] [08:31:02] [DEBUG] [SCENE41]: ++++++++++++++++++
[31.05.2020] [08:31:02] [DEBUG] [SCENE41]: {"data":"\n\n404 Not Found\n\n
Not Found
\n
The requested URL was not found on this server.

\n
\n
Apache/2.4.38 (Raspbian) Server at 192.168.1.10 Port 80

Edited by 10der
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • more than!

     

    .htaccess 

     

    RewriteEngine On 
    RewriteCond %{SERVER_PORT} 80
    RewriteCond %{REQUEST_URI} ^/write 
    RewriteRule (.*) http://192.168.1.10:8086/write?db=smarthome

     

    Apache/2.4.38 (Raspbian) Server at 192.168.1.10 Port 80
    \n\n","status":302}
    [31.05.2020] [10:21:53] [DEBUG] [SCENE41]: Wrong status '302' in response!

     

    http:request(
            url,
            {
                options = {
                    headers = headers,
                    data = body,
                    method = "POST",
                    redirect = true
                },
        
     
    Agggrrhhh!

     

     

    Link to comment
    Share on other sites

    • 0

    net.HTTPClient in (HC3) scenes seems to open ports based on service type (so if you take ftp:// it will try over 21).

    The port number after : will get ignored, even if url encoded.

    Not known services will bring error:

     

    [DEBUG] [ERROR: "SERVICE NOT FOUND"]: nil

     

    The good part about service definition is, one can use not-yet defined as well, these are only names for port numbers.


    In your specific case, to get/post anything to port 8086 just try e.g:

     

    Please login or register to see this code.

    EDIT: changed code above a bit, net.HTTPClient in scenes don't like not url encoded uri.

    Edited by tinman
    • Thanks 2
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • @tinman crazy. Port://url it’s the best. 
    just share to local dev chat.

    killer feature ?

    • Like 1
    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...