• Popular
  • Users
  • Login
Flic Home

Community

  • Login
  • Search
  • Popular
  • Users

Hub not sending Internet http Request after reboot

Flic Hub
hub http statuscode undefined error
2
8
2.0k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • alces
    alces last edited by 17 Oct 2022, 15:31

    I've programmed buttons on a Hub LR with an Internet Request posting a JSON message to one of our servers. It worked as intended.
    Came back a few weeks later, didn't work anymore (no changes). Added a second button with similar programming, also not working.

    I reset the hub, programmed one, working again. Programmed 29 more in a similar fashion, moved the hub out to production within 10 minutes (so with a power cycled), and none of them worked anymore.

    Thinking the hub is bad, I tried the same with another hub, and first it's working, programmed 10 buttons, after power cycle again not working. Tried "jump starting" it with various methods, like adding more buttons, removing, changing settings, no luck, The hub itself seems to register the button push as the LED flashes and the button icon in the app wobbles.

    When using the SDK to submit a similar request on a "working" hub (essentially the example from the SDK tutorial at https://hubsdk.flic.io/static/tutorial/), it also works fine and I get status code 200 back, as expected.

    When I run the same code in the SDK on a "malfunctioning" hub I get this error as a result:

    TypeError: cannot read property 'statusCode' of undefined
        at [anon] (duktape.c:56634) internal
        at [anon] (root/test1/main.js:37)
        at handleResponse (http.js:62)
        at handlePacket (pipe_communication.js:56)
        at readCallback (pipe_communication.js:93) preventsyield
    

    Anybody experienced something similar to this?

    We have a bunch of other flic hubs in use that do not seem to have that problem. I'm not sure if it's something I am doing, but the only action between it working and not working is a power cycle. Quite annoying and ready send 16 packs of buttons back to them.

    Emil 1 Reply Last reply 18 Oct 2022, 07:30 Reply Quote 0
    • Emil
      Emil FlicTeam @alces last edited by 27 Oct 2022, 10:39

      @alces as you can see on https://superuser.com/questions/1581627/where-is-my-lan-hostname-stored, hostnames on the LAN is not really a "basic feature of networking" since there are like four different "standards" for that. Currently, the only thing you should rely on is that you use a FQDN that the DNS resolver the DHCP server gives the hub will resolve.

      1 Reply Last reply Reply Quote 0
      • alces
        alces @Emil last edited by 24 Oct 2022, 12:36

        @Emil Yes, computer name on the network. Does that mean you essentially have not implemented one of the basic features of networking? Although it seems to work in the beginning for some time?

        Is that then trye for using the FQDN, as well, and I can expect this stop at any random time?

        Emil 1 Reply Last reply 27 Oct 2022, 10:39 Reply Quote 0
        • Emil
          Emil FlicTeam @alces last edited by 21 Oct 2022, 22:01

          @alces with hostname, do you mean the computer name on the local network? In that case, it's not something we support currently so don't expect it to work.

          alces 1 Reply Last reply 24 Oct 2022, 12:36 Reply Quote 0
          • alces
            alces @alces last edited by alces 21 Oct 2022, 15:05 21 Oct 2022, 15:05

            @Emil Another update. Working with our networking team to see if requests to the name server may get blocked at some point (they don't), they suggested to try the FQDN, and that also worked on the "broken hub". So it seems after some time hostname only does not work anymore, something about how the received DHCP options are handled maybe? Would explain that it stops working after a power cycling.

            Emil 1 Reply Last reply 21 Oct 2022, 22:01 Reply Quote 0
            • alces
              alces @Emil last edited by 21 Oct 2022, 14:29

              @Emil ok, with the changes in the code I get a more descriptive error:

              request status:
              Unknown hostname: ourserver: Temporary failure in name resolution
              undefined

              When i put the IP address in the request, it works.

              While this is a name resolution issue now, I still think it is somehow hub related. Having another (still working) hub on the same switch, that still works using the host name, while the "broken hub" has the name resolution problem (and none of our few hundred other pieces of equipment have a name resolution issue either).

              I can work around this for now using the IP, but it sounds like there might be some issue with the hub (firmware).

              alces 1 Reply Last reply 21 Oct 2022, 15:05 Reply Quote 0
              • Emil
                Emil FlicTeam last edited by 21 Oct 2022, 13:28

                We have updated the example code so this error being thrown should not happen anymore.

                alces 1 Reply Last reply 21 Oct 2022, 14:29 Reply Quote 0
                • Emil
                  Emil FlicTeam @alces last edited by Emil 18 Oct 2022, 07:30 18 Oct 2022, 07:30

                  @alces the example is a bit simplified as it does not handle the error case. If the request couldn't be made, res will be undefined and err will contain the error. Could you possibly tell what the err parameter contains?

                  1 Reply Last reply Reply Quote 0
                  6 out of 8
                  • First post
                    6/8
                    Last post