help Help

IoT Quick Start Guide

Step-by-step tutorials for Digital Signage IoT integration
From first event to production deployment

[ 5 Tutorials | Hands-On | ~95 Minutes Total ]

Raspberry Pi Node.js + GPIO SignService Port 8094 Event Router Display DHT11 Relay Quick Start Architecture Sensor → Pi → SignService → Display

Prerequisites

Before starting, ensure you have the following components ready:

Hardware
  • Raspberry Pi - With GPIO access
  • Windows PC - SignService installed
  • Display - Connected to Raspberry Pi
Software
  • Node.js 16+ - With npm
  • Python 3 - For GPIO control
  • SignService - Running on port 8094
Network
  • All devices on same local network
  • Pi can reach Windows PC on port 8094
  • Windows PC can reach Pi on ports 5000-5002
Access
  • SignStudio - To design scenes
  • SSH - Access to Raspberry Pi
  • SignPlayer - Running on display

Tutorial 1: Your First Event 10 minutes

Send a simple "Hello World" event from command line to SignPlayer.

1 Verify SignService is Running

On your Windows PC, check that SignService is running:

Open Services (services.msc)
Find "SignService" or "SignageWatchDog"
Status should be: Running

2 Find Your Windows PC IP

Open Command Prompt on Windows and run:

:: On Windows
ipconfig

:: Look for IPv4 Address, e.g., 192.168.68.52

3 Send Test Event via Curl

From any machine with curl (Pi, Windows, Mac, Linux):

curl 'https://192.168.68.52:8094/player/sendEvent?eventName=helloWorld&store=1' \
  -X POST \
  -H 'Content-Type: application/json' \
  --data-raw '{"message": "Hello from IoT!"}' \
  --insecure

Important: Replace 192.168.68.52 with your Windows PC IP address.

4 Verify in SignPlayer

The event was sent! To see it, you need to configure a scene in SignStudio to listen for helloWorld events.

Success!

You've sent your first IoT event to the Digital Signage system. Next: Configure SignStudio to display the event data.

Tutorial 2: Temperature Display 20 minutes

Display real-time temperature on your digital signage.

Architecture

  +----------+      +-------------+      +-------------+      +-------------+
  | DHT11 or |      | Node.js     |      | SignService |      | SignPlayer  |
  | Simulated| ---> | Script      | ---> | (Windows)   | ---> | Display     |
  +----------+      +-------------+      +-------------+      +-------------+

1 Deploy the IoT Scripts to Pi

From your development machine, sync the files to your Raspberry Pi:

# On your development machine
cd /c/msweb/pi

# Sync files to Pi
rsync -avz --no-perms --no-owner --no-group -e "ssh" /c/msweb/pi root@10.0.0.24:/root/_node-dev/

# SSH to Pi and fix line endings
ssh root@10.0.0.24 "find /root/_node-dev/pi -type f -not -path '*/node_modules/*' -exec dos2unix {} \; && chmod -R 777 /root/_node-dev/pi"

2 Configure the Temperature Script

Edit /root/_node-dev/pi/iot/iotSendTemperture.js on the Pi:

// Configuration section at top of file
const DEMO = true;                     // true = simulated, false = real sensor
const SIGNSERVICE_HOST = '192.168.68.52';  // <-- Your Windows PC IP
const SIGNSERVICE_PORT = 8094;
const EVENT_NAME = 'myCustomEvent';    // Event name for SignStudio
const POLL_INTERVAL = 4;               // Seconds between readings

3 Run the Temperature Script

SSH to your Pi and run the script:

# SSH to Pi
ssh root@10.0.0.24

# Navigate to iot directory
cd /root/_node-dev/pi/iot

# Run the script
node iotSendTemperture.js

Expected output:

IoT Temperature Sender
Mode: DEMO (simulated)
Server: https://192.168.68.52:8094/player/sendEvent...
Interval: 4 seconds

[10:30:00] Reading #1
  Sensor raw:  24.2C / 75.6F / 52.3%
  Sending to: https://192.168.68.52:8094/...
  Sent successfully!

4 Create SignStudio Scene

In SignStudio, create a new scene with a Label component:

  1. Add a Label block to the canvas
  2. Set the label text to "Temperature"
  3. Configure Data Binding:
    • Event Name: myCustomEvent
    • Field: name

The label will now update every 4 seconds with the temperature reading!

Tutorial 3: Touch-Activated Relay 30 minutes

Control a physical relay from touchscreen interactions.

Architecture

  +-------------+      +-------------+      +-------------+      +----------+
  | SignPlayer  |      | SignService |      | Node.js     |      | Relay    |
  | Touch       | ---> | Windows     | ---> | Pi Script   | ---> | GPIO 4   |
  +-------------+      +-------------+      +-------------+      +----------+

1 Wire the Relay

CAUTION: Double-check wiring before powering on!

  Relay Module          Raspberry Pi 40-Pin Header
  +-----------+         +-----------+
  |           |         |           |
  | VCC  o----+---------+----o Pin 2 (5V)
  |           |         |           |
  | IN   o----+---------+----o Pin 7 (GPIO 4)
  |           |         |           |
  | GND  o----+---------+----o Pin 6 (GND)
  |           |         |           |
  +-----------+         +-----------+

2 Configure the Relay Script

Edit /root/_node-dev/pi/iot/iotReceiveAlertRelay.js:

// Configuration section
const RELAY_PIN = 4;                   // GPIO pin for relay
const PORT = 5001;                     // Callback server port
const SIGNSERVICE_HOST = '192.168.68.52';  // <-- Your Windows PC IP
const DEFAULT_EVENT_NAME = 'clickAlarm';

3 Run the Relay Script

SSH to your Pi and run:

# SSH to Pi
ssh root@10.0.0.24

# Navigate to iot directory
cd /root/_node-dev/pi/iot

# Run the script
node iotReceiveAlertRelay.js clickAlarm

Expected output:

IoT Alert Receiver + Relay Control
Callback URL: http://192.168.68.24:5001/callback
SignService:  https://192.168.68.52:8094
Event Name:   clickAlarm
Relay GPIO:   4 (Pin 7)

Registered for event 'clickAlarm'
Listening for events... Press Ctrl+C to exit

4 Create SignStudio Buttons

In SignStudio, create a scene with two Button components:

Button 1: Alarm ON
{
  "Button": [{
    "$": {
      "label": "ALARM ON",
      "fieldName": "alarmOn"
    }
  }],
  "EventCommands": [{
    "EventCommand": [{
      "$": {
        "from": "click",
        "command": "sendEvent"
      },
      "Params": {
        "eventName": "clickAlarm",
        "data": {
          "clickAlarm": "on"
        }
      }
    }]
  }]
}
Button 2: Alarm OFF
{
  "Button": [{
    "$": {
      "label": "ALARM OFF",
      "fieldName": "alarmOff"
    }
  }],
  "EventCommands": [{
    "EventCommand": [{
      "$": {
        "from": "click",
        "command": "sendEvent"
      },
      "Params": {
        "eventName": "clickAlarm",
        "data": {
          "clickAlarm": "off"
        }
      }
    }]
  }]
}

5 Test It!

  1. Display the scene on SignPlayer
  2. Touch "ALARM ON" button
  3. Watch the relay click ON
  4. Touch "ALARM OFF" button
  5. Watch the relay click OFF

Success!

You can now control physical devices from your digital signage!

Tutorial 4: Web Portal Testing 15 minutes

Use the interactive web portal for debugging and testing.

1 Run the Web Portal

On Pi or any machine with Node.js:

# On Pi or any machine with Node.js
cd /root/_node-dev/pi/iot
node iotWebPortal.js

This opens a browser to http://localhost:5000

2 Configure SignService

  1. In the web interface, find "SignService IP"
  2. Enter your Windows PC IP (e.g., 192.168.68.52)
  3. Click "Set"

3 Add an Event Listener

  1. Click "+ Add Listener"
  2. Enter event name: clickAlarm
  3. Click "Register"

The portal will now receive events when SignPlayer fires clickAlarm.

4 Send a Test Event

  1. Enter Event Name: myCustomEvent
  2. Enter JSON Data:
    {
      "name": "Hello from Portal!"
    }
  3. Click "Send JSON to Player"

5 View Received Events

When you touch buttons in SignPlayer that fire clickAlarm, the web portal will display the received data in real-time.

  Event Listeners
  +------------------------------------------------------------------------+
  | clickAlarm                                              [Remove]       |
  | Callback: http://192.168.68.24:5000/callback                           |
  | +------------------------------------------------------------------+   |
  | | {                                                                |   |
  | |   "eventName": "clickAlarm",                                     |   |
  | |   "data": {                                                      |   |
  | |     "clickAlarm": "on"                                           |   |
  | |   }                                                              |   |
  | | }                                                                |   |
  | +------------------------------------------------------------------+   |
  | Last received: 10:45:32 AM                                             |
  +------------------------------------------------------------------------+

Tutorial 5: Running as a Service 20 minutes

Make your IoT scripts start automatically on boot.

1 Create a systemd Service File

SSH to your Pi and create the service file:

# SSH to Pi
ssh root@10.0.0.24

# Create service file
cat > /etc/systemd/system/iot-relay.service << 'EOF'
[Unit]
Description=IoT Relay Controller
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/root/_node-dev/pi/iot
ExecStart=/usr/bin/node iotReceiveAlertRelay.js clickAlarm
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
EOF

2 Enable and Start the Service

# Reload systemd
systemctl daemon-reload

# Enable on boot
systemctl enable iot-relay

# Start now
systemctl start iot-relay

# Check status
systemctl status iot-relay

3 View Logs

# View recent logs
journalctl -u iot-relay -n 50

# Follow logs in real-time
journalctl -u iot-relay -f

4 Create Temperature Service (Optional)

cat > /etc/systemd/system/iot-temp.service << 'EOF'
[Unit]
Description=IoT Temperature Sender
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/root/_node-dev/pi/iot
ExecStart=/usr/bin/node iotSendTemperture.js
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable iot-temp
systemctl start iot-temp

Common Issues and Solutions

Connection Refused to SignService
Error: connect ECONNREFUSED 192.168.68.52:8094
Solutions:
  1. Verify SignService is running on Windows PC
  2. Check Windows Firewall - allow port 8094
  3. Verify IP address is correct
  4. Test with: curl https://192.168.68.52:8094 --insecure
Events Not Reaching SignPlayer

Events sent successfully but nothing happens in SignPlayer

Solutions:
  1. Verify event name matches SignStudio configuration
  2. Check SignPlayer is displaying the correct scene
  3. Ensure Data Binding is configured on the Label/component
  4. Try with store=1 parameter to persist events
Relay Not Responding

Relay script receives events but relay doesn't switch

Solutions:
  1. Check GPIO wiring (VCC, GND, Signal)
  2. Verify Python3 and lgpio are installed
  3. Test GPIO manually:
    python3 -c "import lgpio; h=lgpio.gpiochip_open(0); lgpio.gpio_claim_output(h, 4); lgpio.gpio_write(h, 4, 1)"
  4. Check event data structure matches expected format
Certificate Errors
Error: self signed certificate
Solution:

Add --insecure flag to curl, or in Node.js:

rejectUnauthorized: false

Next Steps

After completing these tutorials, you can explore more advanced IoT integrations:

Build Custom Sensors
  • Add motion sensors
  • Add light sensors
  • Add physical buttons
  • Use the temperature script as a template
Complex Interactions
  • Chain multiple events
  • Add conditional logic
  • Integrate with external APIs
  • Build automation workflows
Scale Up
  • Deploy to multiple Pis
  • Register multiple callbacks per event
  • Build monitoring dashboards
  • Centralize event management
Production Deployment
  • Add error handling and logging
  • Set up monitoring and alerts
  • Implement security measures
  • Configure redundancy

live examples, see it in action

Checkout live examples of Digital Signage presentations. The SignPlayer can run everywhere, on Android, Windows, Mac, iPad and even inside your web browser

View More

product pricing

Find out why people call us “the world’s most popular digital signage platform”

View More

customers

Can it really be free?
What’s the catch?
Want to be amazed?
Read on...

View More