I have a RaspberryPi that runs a small web-application on it. It is auto-loaded on boot in midori (kiosk mode) and a small timer runs on it (updated every second). This works all right.

Now, the timer triggers at a certain amount of time a http post request to the node server. From the logs, I can see, that the post request is executed at the right time. But it takes 10 Seconds for the request to return an answer. On the Node Server (im using express) I can see, that the request comes in exactly after 10 seconds and is then processed in a really short amount of time.

The url for the request that I use is http://localhost:8001/myUrl. AngularJS is used for the frontend. See my code below:

    console.log(Date.now()+ ' Autosend: Start Request');
    $http.post("myUrl").success(function () {
      console.log(Date.now()+' Autosend: Post success'});

The problem with that is, that I have running this web application on a Pi here at home, and one some pis that are placed somewhere else (I cannot really access them right now, because they are not connected to the internet and are at customer places), but I cannot reproduce the delay of 10 seconds on my Pi, but the customer experiences this delay on 3 Pis.

The same request on this node server is as well triggered from an external api (other computer) where it access the post request with its direct IP address (e.g. a post request to where the delay is not present.

So it seems to be some kind of issue between

Midori -> My javascript -> Angular -> HTTP Post -> URL Resolving ->  NodeJS (express) Server.
                        +--------------10 sec delay----------------+

They have all the same Rasbian disk dump where they run on, the only thing that I reconfigured and changed are the hostnames and the known hosts in /etc/hostname and /etc/hosts.

Does anyone have an idea how I could try to figure out where this comes from and to reproduce the error, without accessing the devices with the delay included?

To provide a little bit more of information, the /etc/host file looks like that:


If I run a tcpdump I can clearly see the package arriving 10 seconds later ( check the red marked packages), it should actually arrived directly after the first packages in this dump, I can see on the other logs, that the request is triggered as well in that situation early enough!.TCPDump shows the packages arriving later on localhost

The detailed content of the "same" (its not the same package, but I just did it another time) looks like this: Detailed Package overview

So Can anyone help me with getting this fixed or reproducible? Somewhere between angulars $http post call, Midori and my host resolving the TCP packages get delayed for 10 seconds..

Any help or further ideas are appreciated!

  • So if I get it correctly, the delay is somewhere between generating the post, sending it over the internet, and then receiving it on the NodeJS server? In other words - there is a clear-cut chance that something in the network connection (i.e. an ISP throttling requests to non-standard ports) is delaying these packets? Have you tried running the Pi's with the issues in a local network setup and does the issue reproduce itself? – Phil B. Jun 25 '15 at 12:48
  • @PhilB. The node server is on the same pi -- notice it's a localhost request. There shouldn't be any delay with that. – goldilocks Jun 25 '15 at 13:21
  • I see that now - ignore my comment if this is going via localhost. I got thrown off because of the comment that some of his customers were reporting 10 second delays where others weren't. – Phil B. Jun 25 '15 at 13:38
  • SebasZil, explain in detail what you did to /etc/hosts (like, paste an example in) and what hostname is actually used. – goldilocks Jun 25 '15 at 14:46
  • Right now, I don't have any access to that Pi (which makes it hard to help, I know...) I will provide you the /etc/hosts file as soon as I get it. Thanks in advances... – SebasZil Jun 26 '15 at 11:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.