# Fetching data from a url includes errors

**URL:** <https://discourse.nodered.org/t/fetching-data-from-a-url-includes-errors/40738>\
**Category:** General\
**Created:** [10 February 2021 10:52 UTC](https://discourse.nodered.org/t/fetching-data-from-a-url-includes-errors/40738 "2021-02-10T10:52:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![haskle](https://avatars.discourse-cdn.com/v4/letter/h/e19adc/32.png) [@haskle](https://discourse.nodered.org/u/haskle)\
**Post date:** [10 February 2021 10:52 UTC](https://discourse.nodered.org/t/fetching-data-from-a-url-includes-errors/40738/1 "2021-02-10T10:52:02Z")

</div>

I am able to view weather station data via my LAN using [http://192.168.2.101/v1/current\_conditions](http://192.168.2.101/v1/current_conditions) , which returns, eg  
`{"data":{"did":"001D0A712D46","ts":1612953797,"conditions":[{"lsid":352807,"data_structure_type":1,"txid":1,"temp": 32.2,"hum":83.6,"dew_point": 27.8,"wet_bulb": 30.4,"heat_index": 32.2,"wind_chill": 32.1,"thw_index": 32.1,<<<SNIP>>>`

It could be due to a timing issue (ie how often the url updates and how often my Timestamp calls), but whilst I do get what I want every now and again, I also see lots of errors as well.

 ![Screenshot 2021-02-10 at 10.47.33](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/6/26908d492d02fdd16029d310f64c318815751c75.png)

The "Error: socket hang up" comes from the `http request` node

 ![Screenshot 2021-02-10 at 10.49.29](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/5/7568509a78ac2c88adfe9c475ee16706b6a5e700.png)

Whilst the "TypeError: Cannot read property 'conditions' of undefined" comes from the `function` node

 ![Screenshot 2021-02-10 at 10.51.00](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/9/f933412dd30623955d3c724a1cddce62036dfa6c.png)

How can I sync the timings better? Or is there a different cause to what I have thought?

TIA

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [10 February 2021 11:06 UTC](https://discourse.nodered.org/t/fetching-data-from-a-url-includes-errors/40738/2 "2021-02-10T11:06:23Z")

</div>

Well you are rather hammering what is probably a small embedded device that may not be the best web server in the world. Maybe try slowing down the requests - after all how quickly does the weather change in your area ?

---

<div class="post-metadata">

**Author:** ![haskle](https://avatars.discourse-cdn.com/v4/letter/h/e19adc/32.png) [@haskle](https://discourse.nodered.org/u/haskle)\
**Post date:** [11 February 2021 09:04 UTC](https://discourse.nodered.org/t/fetching-data-from-a-url-includes-errors/40738/3 "2021-02-11T09:04:16Z")

</div>

I was "hammering" it during set up only, but will slow it down to see if it makes any difference to the errors

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [12 April 2021 09:04 UTC](https://discourse.nodered.org/t/fetching-data-from-a-url-includes-errors/40738/4 "2021-04-12T09:04:54Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
