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


HTTP operation cancelled


Neo Andersson

Recommended Posts

Hello guys

 

I need some hepl from anyone outthere..

 

I am using a QA to send text to Raspberry and play it on Google nest speakers. This was working like a charm until yesterday, and i swear I didn't touch a single line of code.

From yesterday i am getting error i http response "Operation cancelled"

I need some experienced propgrammer to check on this, becuse it's way beyond my comprehension, how can something be working for long time, and suddenly stop working from out of the blue.

 

I am really thankfull for any suggestion.

 

 

This is the http call i am using

 

 

        requestStr = {text = message_to_sent, targetip = nest_ip, volume = nest_volume, language = nest_language} -- storign data in JSON string format
        requestTringToJSON = json.encode(requestStr)  -- making JSON string from the string
        
        local http = net.HTTPClient({timeout=6000,})
            http:request(self.raspberry_ip..request_command, {
                options={
                    headers = {['Accept'] = "application/json", ['Connection']='keep-alive',['Content-Type']='application/json' },
                    method = 'POST',
                    data = requestTringToJSON -- sending data in JSON string format
                },
            success = function(status)
            end,
            error = function(error)
                self:debug('error: ' .. json.encode(error))
            end
 
        })

 

 

 

 

Link to comment
Share on other sites

When I had something similar it was a change in password on HC so Pi was not able to log in.

or HC changed IP as addon on JGab his tip

//Sjakie

Link to comment
Share on other sites

  • Topic Author
  • I didn't change anything. Thanks anyway for help.

    Someone can explain me what can cause this?

     

    If I left out the complete  headers = {['Accept'] = "application/json", ['Connection']='keep-alive',['Content-Type']='application/json' }, line than it starts to work.

     

    If I had it in there, i am getting in Raspberry "Unexpected token o in JSON at position 1", but the JSON is the same as it was moths ago..i changed nothing, i am sending a simple text. SO without the header it works, I dont know how long, but now it works without the complete header part.

     

    and i didn't touch anyithing, neither in Raspberry nor in PC..This is driving me crazy

     

     

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