Skip to main content
Skip table of contents

LabJack via Internet (App Note)

This app note was written when the T7 was the only T-series device. Most mentions of T7 can be assumed to apply to any T-series device with Ethernet.

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". This app-note attempts to answer those questions.

LabJack via Internet 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

T-Series: The LabJack T-series devices support Modbus over USB and Ethernet. Some devices also communicate via WiFi. To perform measurement and automation through the internet, we recommend that users create custom software that utilizes the LJM library and also create a web interface for external connections.

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 create a web interface for external connections.

UE9: The UE9 is an older USB and Ethernet device. 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 create 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 monitors and controls the LabJack device.

Without IoT: To monitor and control directly (not using an IoT service), then the on-site software will need to be set up as a web server, and port forwarding must be enabled on the local router to expose that web server.

With IoT: See below.

Port Forwarding (For on-site 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. Change the router (Gateway) setting of the LabJack to be 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. Check with your network administrator to make sure you comply with your security standards. For more details, see these port forwarding setup instructions on wikiHow.

Direct Connect (For on-site 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—firewalls do not typically prevent outgoing traffic. 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. IoT (cloud) services include an API for connecting to the remote server. Client software then runs on-site, calling that API. After using that API to connect to the IoT service, a web server can be set up in the cloud, which can be accessed off-site. One example of an API for connecting to a cloud service is AWS Pub/Sub.

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.

Email: Depending on your connectivity needs, email is a viable option for getting infrequent LabJack data or alerts from a program. There are many API's for sending emails from within a program, and these can be integrated with a monitoring program to provide alerts if a certain signal goes above or below a threshold. For more on using email with your LabJack, see our Sending Emails From a Program App Note.

Off-Site Software, Platform

Off-site software is one of two things, an internet browser (e.g. Firefox), 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 device, thereby removing the complexity of creating a web server or a learning an IoT service's API. This premade app is an example of 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.

Subsections

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.