Connect Applet to Device Using signageOS CLI
Speed up your development with instant deployment of your applet directly from the command line interface (CLI) to a device in your local network using signageOS.
Prerequisites
Before you begin, ensure you have the following:
- A signageOS account.
- signageOS CLI installed.
- At least one organization set up in signageOS Box (create one here).
- Node.js version 10.15.0 or later, including NPM (download here; previous versions here).
- A terminal application (e.g., Shell, Gitbash, PowerShell, Windows Terminal, or Cmder).
- Consider using
nvm
to manage Node.js versions. - Windows Terminal and Cmder support multiple windows for efficiency.
Setup Instructions
- Navigate to your applet project directory:
cd /path/to/your/project
. - Install dependencies:
npm install
. - Build the project:
npm run build
(or use a custom command). - Upload the applet to signageOS:
sos applet upload
. - Create an applet bundle:
sos applet build
.
Device Connection
After completing the setup, connect your applet to a device in your local network:
Navigate to your applet's root directory and use:
sos device connect
You can pass these arguments after command, or the command will provide you with interactive selection
Argument | Description | Default value |
---|---|---|
--ip (required) | Local network computer IP address | Auto-detected |
--device-uid (required) | Device UID from signageOS Box | STDIN |
--applet-dir (required) | Applet project directory | Current directory ${PWD} |
It may take a few seconds for the applet to appear on your device.
To exit development mode, press CTRL + C
(or CMD + C
on Mac) in the terminal. This will end the connection and revert the display to its previous state.
Enable Hot Reload for efficient debugging
Hot reload requires the signageOS webpack plugin, which is included with applets created using the CLI command sos applet generate
. In this case, use npm run connect
in step 2 below.
If your applet was not generated using the CLI, use sos applet start --hot-reload
in step 2 below.
The applet must be uploaded to the same organization as the device you are connecting to!
- Follow the setup instructions to upload and build your applet
- In the first terminal window, within your applet project directory, run
npm run connect
orsos applet start --hot-reload
regarding to the way your applet was created (see above). - In the second terminal window, also within your applet project directory, run
sos device connect
to connect to the device.
You can find more information and arguments for the sos applet start
command at https://github.com/signageos/cli?tab=readme-ov-file#applet-start.
Connection troubleshooting
Hot reloading relies on port 8091 being open and listening for external connections.
You can check whether there are any firewall rules for that port to ensure that incoming connections are not blocked:
# UNIX-like systems
sudo iptables -L -n | grep 8091
# Windows
netsh advfirewall firewall show rule name=all | findstr "8091"
Once the connect server is started (either by running npm run connect
or sos device connect
),
you should see the port open:
# UNIX-like systems
sudo netstat -tuln | grep 8091
# output should be like
# tcp6 0 0 :::8091 :::* LISTEN
# Windows
netstat -ano | findstr :8091
Notes
The sos applet upload
step is required only once to assign a unique UID to your applet.