Using SignalK and Node-RED to Check the Active Internet Service on Ubiquiti Edge Router

One of the bigger challenges I have found living on a boat is internet access. We are lucky to have cable internet access at the dock, but when we head out we need to switch cellular, and depending on how far out you go, you might need to switch to satellite internet.

The best device that I have found to handle and automatically switch internet service is the Ubiquiti Edge Router. The device is small, low cost, and power efficient. It runs on 12 volt which is a great benefit! At some point I’ll do my own post about configuring the router for multiple connections, but for now check out the excellent WAN load balancing article provided by Ubiquiti.

In order for this to work you will need a few things. SignalK, Node-RED (installed along with SignalK), the signalk-n2k-virtual-switch plugin, and of course a Ubiquiti Edge Router.

  1. Login to SignalK and make sure you have the signalk-n2k-virtual-switch plugin installed and configured.
  2. Launch the Node-RED admin page from SignalK.
  3. The first thing we need to do is install the SNMP nodes. To do this browse to Manage Palette.
  4. Click on Install and then type in “node-red-node-snmp”. Click on the install button.
  5. Click on Install.
  6. You should now see that the state of the node is “Installed”.
  7. Repeat steps 3-5 to install “node-red-contrib-bigssh”.
  8. You are now going to import the first flow which checks the load balance status and will show us which internet service is active. Select the Import option.
  9. You will see the following dialog box open.
  10. Copy the flow from GitHub and paste the code into the dialog box.
  11. Select new flow and click Import.
  12. You should now have a flow that looks like:
  13. Now we need to set the ip address, username, and password for your router. Double-click on the “show load-balance status” node. Then click on the edit button that appears.
  14. Enter the IP Address, username, and password. Then click Add and then Done.
  15. Click on in the upper right hand screen.
  16. You should now be able to click on the button of the Inject node to execute the flow. If everything is successful you should see “done with rc 0” underneath the show load-balance status node. You should also see a Value: X underneath each of the 3 switch ports.

The internet service state will update the following paths as outlined in the table below. This is just what I happen to use, but feel free to modify the switch bank and switch number as you see fit for your usage.

interfaceSignalK Path
Router Interface to SignalK Path Mapping

At this point the internet service status will updated every minute. You can then choose to display the status on your favorite UI compatible with either SignalK or NMEA Switch Bank Status PGN 127501.

Here is an example of a page I created in Maretron N2KView.

In the future I will create another post describing how to enable or disable the ethernet ports.

1 thought on “Using SignalK and Node-RED to Check the Active Internet Service on Ubiquiti Edge Router

  1. Pingback: Using SignalK and Node-RED to enable and disable switch ports on a Ubiquiti Edge Router | Adventure NOT Vacation

Leave a Reply

Your email address will not be published. Required fields are marked *