# Internet Speedtest Flow - Function Error

**URL:** <https://discourse.nodered.org/t/internet-speedtest-flow-function-error/29115>\
**Category:** General\
**Created:** [28 June 2020 14:41 UTC](https://discourse.nodered.org/t/internet-speedtest-flow-function-error/29115 "2020-06-28T14:41:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![fetsters](https://avatars.discourse-cdn.com/v4/letter/f/48db29/32.png) [@fetsters](https://discourse.nodered.org/u/fetsters)\
**Post date:** [28 June 2020 14:41 UTC](https://discourse.nodered.org/t/internet-speedtest-flow-function-error/29115/1 "2020-06-28T14:41:45Z")

</div>

Hi all,

I am trying to get the above flow working ([https://flows.nodered.org/flow/e3e8c7f4807f383ab85d61ff2dfda208](https://flows.nodered.org/flow/e3e8c7f4807f383ab85d61ff2dfda208))

I have changed the wget request to the correct url as one stated was outdated:  
wget -O speedtest-cli [https://github.com/sivel/speedtest-cli/blob/master/speedtest.py](https://github.com/sivel/speedtest-cli/blob/master/speedtest.py) chmod +x speedtest-cli

I have also installed NodeRedDashboard.

When running I am getting the following debug errors:

{"code":2,"message":"Command failed: /home/pi/speedtest-cli\n/home/pi/speedtest-cli: 7: /home/pi/speedtest-cli: Syntax error: newline unexpected\n"}

Error: ENOENT: no such file or directory, open 'speedtestData.json'

Error: ENOENT: no such file or directory, open 'speedtestDataPD.json'

TypeError: Cannot read property 'split' of undefined

Any ideas what the problem may be?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [28 June 2020 14:55 UTC](https://discourse.nodered.org/t/internet-speedtest-flow-function-error/29115/2 "2020-06-28T14:55:22Z")

</div>

Well the error is teling you that the file doesn't exist.

Add a `catch` node connected to a `debug` node (set to display the complete msg object) and you will get an indication of which node is the culprit.

Did you try change the file names to the full path to the file?

---

<div class="post-metadata">

**Author:** ![fetsters](https://avatars.discourse-cdn.com/v4/letter/f/48db29/32.png) [@fetsters](https://discourse.nodered.org/u/fetsters)\
**Post date:** [28 June 2020 18:27 UTC](https://discourse.nodered.org/t/internet-speedtest-flow-function-error/29115/3 "2020-06-28T18:27:11Z")

</div>

Hi, thanks for your assistance.

I'm a complete beginner sorry but I think I have managed to add the catch which is showing two errors:

{"topic":"","payload":"","\_msgid":"bc276840.11d028","filename":"speedtestData.json","error":{"message":"Unexpected end of JSON input","source":{"id":"63a0c3bd.82248c","type":"json","count":1}}}

2nd message:  
{"topic":"","payload":"","\_msgid":"bc276840.11d028","filename":"speedtestDataPD.json","error":{"message":"Unexpected end of JSON input","source":{"id":"330c9ca3.cd2e44","type":"json","count":1}}}

I've not changed any filename paths (will have to look up how to do that if i need to)

---

<div class="post-metadata">

**Author:** ![fetsters](https://avatars.discourse-cdn.com/v4/letter/f/48db29/32.png) [@fetsters](https://discourse.nodered.org/u/fetsters)\
**Post date:** [28 June 2020 18:29 UTC](https://discourse.nodered.org/t/internet-speedtest-flow-function-error/29115/4 "2020-06-28T18:29:12Z")

</div>

Both nodes are the JSON nodes

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [28 June 2020 18:33 UTC](https://discourse.nodered.org/t/internet-speedtest-flow-function-error/29115/5 "2020-06-28T18:33:42Z")

</div>

At a guess,

- the "restore" inject is set to operate at start up & as the first time you download this flow, the files wont exist - you will get an error.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/2/42d9951202b0d61101a9f97ba05e726c7a322c7e.png)

Add to that, I suspect this flow is quite old (it refers to old dashboard...  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/c/5c8fe21aab39dd2b56be61d70e526d1b7d85f048.png)  
... and may require some tweaking to work with new node-red and new dashboard

---

<div class="post-metadata">

**Author:** ![fetsters](https://avatars.discourse-cdn.com/v4/letter/f/48db29/32.png) [@fetsters](https://discourse.nodered.org/u/fetsters)\
**Post date:** [28 June 2020 20:35 UTC](https://discourse.nodered.org/t/internet-speedtest-flow-function-error/29115/6 "2020-06-28T20:35:11Z")

</div>

thanks for your help. I ended up giving up on it and used a different flow that is working fine.

---

<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:** [27 August 2020 20:35 UTC](https://discourse.nodered.org/t/internet-speedtest-flow-function-error/29115/7 "2020-08-27T20:35:13Z")

</div>

Closed on 27 August 2020 20:35 UTC

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