« Close

Datasheets and User Guides

App Notes

Software & Driver

 

LabJack via Internet (App Note)

Subsections

LabJack Via Internet Overview

 

We are often asked, "Hey, how can I get this data on my cell phone?", or "What's the easiest way to control my LabJack on the net?", or "What are my options for cloud data?" or "I want to see LabJack data in my internet browser" - well, this app-note attempts to answer those questions.

 

Options

Figure 1. LabJack via internet available options

The figure above demonstrates most of the possible paths for measurement and automation through the internet. The recommended path does not require using an Internet of Things (IoT) service, is highly flexible/extensible, provides access to any/all of our devices, and is fully compatible with any off-site platform that has a web browser. The recommended path is the darkened line above, and is also demonstrated more literally in figure 2 of Appendix A.

 

Device, and On-Site Software

T7 - The T7 is a USB, Ethernet, and WiFi device which is Modbus compatible, so to perform measurement and automation through the internet, we recommend that users create custom software that utilizes the LJM library, and also creates a web interface for external connections. 

Compared to older devices, the T7 has a few alternate connection paths, which are made possible by scripting and a more advanced processor. Although limited by code space, it's possible to write a Lua script to connect directly to an IoT service to post data, and receive commands. It's also possible for the T7 to act as a web server itself, but the complexity of operation is limited to a few basic reads and writes. We plan to use the web server functionality to create a simple web-based test panel, but other equally simple implementations are theoretically possible.

U3, U6 - The U3 and U6 are USB devices which are UD compatible, so to perform measurement and automation through the internet, we recommend that users create custom software that utilizes the UD library, and also creates a web interface for external connections. 

UE9 - The UE9 is a USB and Ethernet device, but it does not have any advanced connection options like the T7, so to perform measurement and automation through the internet, we recommend that users create custom software that utilizes the UD library, and also creates a web interface for external connections.

U12 - The U12 is a USB device with a unique interface, so to perform measurement and automation through the internet, we recommend that users create custom software that utilizes the UW library, and also creates a web interface for external connections.  There is a basic web interface for simple monitoring included in the LJlogger application.

 

Local Network

How the local network is configured is going to depend on how the off-site platform plans to monitor and control the LabJack device. To monitor and control directly (not using an IoT service), then the on-site software will need to be setup as a web server, and port forwarding should be implemented. When using an IoT service

Port Forwarding (Servers) - When the on-site desktop software is acting as a web server, the web server must be visible to the web, which means that port forwarding is necessary. Simply change the router (Gateway) settings to include the IP address of the on-site desktop (associated with a port number, or port number range), so that any internet device can communicate directly with the on-site desktop. This is commonly referred to as opening a hole in the firewall, because internet traffic is allowed through to a specific computer residing on the local network. For more details, see these port forwarding setup instructions on wikiHow.

Direct Connect (Clients) - When the on-site desktop software is acting as a web client, there is no need to setup port forwarding, because no internet devices are attempting to connect to the on-site desktop. In this circumstance, measurement and automation is only possible through the use of an intermediate IoT service provider, which acts as the web server for both the on-site software, and off-site platform.

 

Internet

IoT Service - Internet of Things services range in complexity and versatility, but for the most part they are simply a web server that stores data, and distributes commands to any awaiting web clients.  Note that most IoT services do not command web clients directly. The web client must initiate a connection to the IoT service, and ask if the IoT service has any new commands or requests.  Due to the passive nature of the common IoT Service, their interface is called a "REST" interface, or API.

Domain Name, Public IP Address - Once port forwarding is setup, one can simply type the IP address and port directly into a browser address field to connect to the on-site web server. e.g. "http://12.157.2.99:2104"  Unfortunately, these numbers are difficult to remember and sometimes dynamic IP addresses are required on the local network, so we recommend using DynDNS or a similar service to map the public IP address to a domain name.

You can register for a domain name with several different companies (e.g. DynDNS, or GoDaddy).  With a domain name, the off-site computer can connect to the on-site web server with "http://dyndns.JohnsLabJackT7.com" or something similar.

Remote Desktop - Remote desktop is the most basic approach to measurement and automation through the internet, and it's highly effective. No extra code is required, and it has fewer moving parts than other options. Unfortunately, the off-site platform has to be running remote desktop software, and connections only exist on a 1-to-1 basis. We recommend remote desktop to single-users who want a quick and effective method to remotely monitor and control their LabJack device, when there are no other people involved etc.

 

Off-Site Software, Platform

Off-site software is one of two things, an internet browser (Chrome, IE, Firefox, Safari), or a unique software application. Both browsers and apps can connect to IoT services or simple domains, but the browser is more generic and universally compatible.  It's possible to write an app that communicates directly with a port forwarded Ethernet/WiFi T7, thereby removing the complexity of creating a web server or a learning an IoT service's API.  In fact, this premade app that does just that!

The off-site platform can be an Android cell phone, iPhone, tablet, laptop, PC, Raspberry Pi, Linux box, etc.  Essentially anything with internet access can connect to the LabJack device, if it follows one of the paths shown in figure 1.