HowTo: Node Red – View internet connection information in the Dashboard

The following article explains how to view information about your Internet connection. Every hour, the current Internet IP address is called up and a speed test is carried out to show you the download and upload speed.

Hints for our lovely english readers: Basically, many of the articles on Nerdiy.de are translations from the original german articles. Therefore, it may happen here and there that some illustrations are not available in english and that some translations are weird/strange/full of mistakes or generally totaly wrong. So if you find some obvious (or also not obvious) mistakes don't hesitate to leave us a hint about that in the comment section. 
Also please don't get confused, that instead of a "dot" often a "comma" is used as decimal separator. 🙂


Safety instructions

I know the following hints are always a bit annoying and seem unnecessary. But unfortunately, many people who knew it "better" from carelessness lost their eyes, fingers or other things or hurt themselves. In comparison, a loss of data is almost not worth mentioning, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Even the coolest project is worth no injury or other annoyance. https://www.nerdiy.de/en/sicherheitshinweise/

Affiliate links / advertising links

The links to online shops listed here are so-called affiliate links. If you click on such an affiliate link and shop via this link, Nerdiy.de receives a commission from the online shop or provider concerned. The price doesn't change for you. If you do your purchases via these links, you will support Nerdiy.de in being able to offer further useful projects in the future. 🙂


Requirements

Helpful Articles:
Of course NodeRed should already be installed so that you can take over this configuration.
How to prepare a RaspberryPi and then install NodeRed on it, is described in the following articles.
RaspberryPi – Setting up for Nerdiys!
RaspberryPi – The first configuration
RaspberryPi – Controlling the RaspberryPi via SSH
NodeRed – Installing NodeRed on the RaspberryPi
NodeRed – Install New Nodes
NodeRed – Import and Export Node Code
NodeRed – Create a User Interface with dashboard nodes

Required tools:
-none-

Required material:

In the following list you will find all the parts you need to implement this article.


Log in to the NodeRed configuration interface

Before you can edit your NodeRed configuration you must - if activated - first log in to the NodeRed configuration interface.

View of the login screen. Here you have to enter the login details that you entered during the configuration of the login. Information about this can be found in the article NodeRed - User Login Setup.

Install Speedtest Node

First, you have to install the node that takes over the speed test for you.
To do this, you install the node “node-red-contrib-speedtest”.
How to Install Nodes is described in this article:
NodeRed – install new nodes


Node code for Speedtest display

After you’ve inserted the node code below, all you have to do is position the dashboard elements correctly on your dashboard. You can also find information about this in the article NodeRed – Create a User Interface with dashboard nodes.

With the Inject-Node “Run Speedtest” you can execute the speedtest manually. Do not be surprised if you do not get an evaluation directly, the speed test takes a few seconds.
In the Inject node, you can also set the polling interval for the Internet data. Here I would not choose a too small interval, since too frequent queries will eventually be blocked by the test server. In addition, you would also “block” your own Internet connection with the frequent speed tests.

The Internet data could be displayed like this on your dashboard.
This is how the flow looks in the configuration menu.

The following Node code includes the configuration shown above.

[{"id":"6ba1b514.1a8ffc","type":"inject","z":"bcba3320.cf832","name":"Speedtest ausführen","topic":"","payload":"","payloadType":"date","repeat":"3600","crontab":"","once":false,"onceDelay":0.1,"x":460,"y":1880,"wires":[["d8c672a4.02c62"]]},{"id":"60085e2a.ceb88","type":"debug","z":"bcba3320.cf832","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":910,"y":1960,"wires":[]},{"id":"d8c672a4.02c62","type":"speedtest","z":"bcba3320.cf832","name":"","maxTime":5000,"x":660,"y":1880,"wires":[["60085e2a.ceb88","7166b0b4.0fb4e","559c3c96.63f474","9e7a000d.72622","7efb5657.f7c238"]]},{"id":"7efb5657.f7c238","type":"change","z":"bcba3320.cf832","name":"IP-Adresse","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.client.ip","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":1800,"wires":[["528c8196.97579"]]},{"id":"9e7a000d.72622","type":"change","z":"bcba3320.cf832","name":"Download-Geschw.","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.speeds.download","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":950,"y":1840,"wires":[["68c5b12e.30c4f"]]},{"id":"559c3c96.63f474","type":"change","z":"bcba3320.cf832","name":"Upload-Geschw.","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.speeds.upload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":1880,"wires":[["bdd0dacf.8f0bc8"]]},{"id":"7166b0b4.0fb4e","type":"change","z":"bcba3320.cf832","name":"Ping","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.server.ping","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":1920,"wires":[["c0dd272d.26b458"]]},{"id":"528c8196.97579","type":"ui_text","z":"bcba3320.cf832","group":"56d04a8f.ecd7a4","order":0,"width":0,"height":0,"name":"","label":"Internet-IP-Adresse:","format":"{{msg.payload}}","layout":"row-spread","x":1320,"y":1800,"wires":[]},{"id":"68c5b12e.30c4f","type":"ui_text","z":"bcba3320.cf832","group":"56d04a8f.ecd7a4","order":0,"width":0,"height":0,"name":"","label":"Download-Geschwindigkeit:","format":"{{msg.payload}}Mbps","layout":"row-spread","x":1340,"y":1840,"wires":[]},{"id":"bdd0dacf.8f0bc8","type":"ui_text","z":"bcba3320.cf832","group":"56d04a8f.ecd7a4","order":0,"width":0,"height":0,"name":"","label":"Upload-Geschwindigkeit:","format":"{{msg.payload}}Mbps","layout":"row-spread","x":1330,"y":1880,"wires":[]},{"id":"c0dd272d.26b458","type":"ui_text","z":"bcba3320.cf832","group":"56d04a8f.ecd7a4","order":0,"width":0,"height":0,"name":"","label":"Ping:","format":"{{msg.payload}}ms","layout":"row-spread","x":1270,"y":1920,"wires":[]},{"id":"56d04a8f.ecd7a4","type":"ui_group","z":"","name":"System","tab":"77aad24e.6a657c","disp":true,"width":"6","collapse":false},{"id":"77aad24e.6a657c","type":"ui_tab","z":"","name":"Einstellungen","icon":"dashboard"}]

Have fun with the project

I hope everything worked as described. If not or you have any other questions or suggestions, please let me know in the comments. Also, ideas for new projects are always welcome. 🙂

P.S. Many of these projects - especially the hardware projects - cost a lot of time and money. Of course I do this because I enjoy it, but if you appreciate it that I share these information with you, I would be happy about a small donation to the coffee box. 🙂

Buy Me a Coffee at ko-fi.com   

5 comments

  1. Hallo,
    der Speedtest hat lange Zeit wunderbar funktioniert.
    Seit dem 03.09.2022 kommen keine Werte mehr und der Node ‘Speedtest’ bringt folgende Meldung:
    “Error: No server found, verify your proxy/network”.

    Ist bekannt woran das Verhalten liegen kann? Ich habe alle 15 Minuten die Abfrage gesendet, war das zu kurz?

    Danke und Gruß

    Martin

    1. Hi Martin,
      ich habe es gerade mal ausprobiert. Bei mir ging es auch nicht (mehr).
      Das liegt wohl an einer alten Version. Nachdem ich die Node über den Paletten Manager geupdated (und NodeRed neu gestartet) hatte geht es wieder.
      Vorher musst du aber noch die Datenschutzregeln (Einstellung in der Speedtest Node) akzeptieren.
      Hoffe es klappt bei dir auch. 🙂
      Beste Grüße
      Fabian

  2. Hi Fabian,

    danke für die schnelle Antwort.
    Ich versuche bereits den ganzen Abend das Update durchzuführen.
    1) Update ging nicht
    2) Nun ist ’node-red-contrib-speedtest‘ ausgegraut und lässt sich auch nicht deinstallieren. Weder aus der Palettenverwaltung noch per Konsole ’npm uninstall node-red-contrib-speedtest‘.

    Node-Red läuft bei mir auf einem Raspberry unter Debian.

    Gruß

    Martin

  3. Hi Fabian,

    gelöst: Ich habe den Bereich Speedtest betreffend in der Datei ‚.node-red/.config.nodes.json‘ entfernt, Node-Red gestoppt und neu gestartet, Speedtest über die Palettenverwaltung installiert, nun funktioniert es.

    Danke für deine Unterstützung.

    Grüße
    Martin

Leave a Reply

Your email address will not be published.