Gateway Bridge
The Gateway Bridge page configures the Semtech UDP endpoint used to exchange traffic with external packet-forwarder software, including ChirpStack Gateway Bridge. Virtual gateways can use this endpoint to expose simulated radio traffic outside the application. A gateway with type Real is configured separately with its own IPv4 address and port in the gateway form.
The integration uses the Semtech UDP packet-forwarder protocol. A ChirpStack Gateway Bridge can therefore be used as the external transport between a simulated gateway and an external network-side service. The simulator remains responsible for the configured device sessions, radio decisions, packet processing, and runtime status; the Gateway Bridge only carries packets between the two sides.
The Gateway Bridge is a transport connection, not a second simulation network. It does not replace a real gateway record and it does not make gateways communicate directly with each other.
Configuration fields
| Field | Meaning | Value |
|---|---|---|
| Gateway Bridge | Enables or disables the external UDP transport for the next simulation run. | Checkbox. |
| Gateway Bridge’s address | Destination address of the external bridge service. | IPv4 address or URL accepted by the form. |
| Gateway Bridge’s Port | Destination UDP port on the external bridge service. | Numeric port, normally 1700. |
The address and port are disabled while the bridge checkbox is off. Click Save settings to store the configuration locally. The page shows the effective endpoint, protocol, and whether the settings have been saved.
The address and port identify the bridge endpoint used by the simulator’s UDP transport. They are not the address and port of an individual real gateway. Configure those gateway-specific values on the gateway’s Real hardware record.
When the bridge is enabled, use a reachable address. The default
0.0.0.0:1700 is a disabled-state default and is not a usable remote bridge
endpoint by itself.
Use Reset to default to restore the default address, port, and disabled state.
Connect external gateway software
Start the external bridge
Configure ChirpStack Gateway Bridge to listen for Semtech UDP packets on its own address and port, usually 1700. Register the virtual gateway’s EUI and the devices in the external network server when using LoRaWAN.
Set the destination in the simulator
Open Hardware → Gateway Bridge, enable the bridge and enter the address and port of that external service. Click Save settings.
Start the virtual gateway
Create an active Virtual gateway and start the simulation. The simulator sends the gateway’s uplinks to the external bridge and receives its replies over that connection. Monitor Connectivity, Engine activity and Logs.
When the virtual gateway is active, it reports statistics to ChirpStack on startup and at the Keep Alive interval, even without device traffic. These reports update Last seen in ChirpStack.
Virtual gateways use the simulator host’s clock to provide GPS timestamps on uplinks and to schedule GPS-timed downlinks. Keep the simulator host and the external network server synchronized when they run on different machines.
The gateway should move from connecting/reconnecting to connected after its heartbeat is received. The runtime panel reports incoming and outgoing packet counts. The event stream reports connection changes, heartbeats, UDP ingress, UDP egress, and network errors.
For a direct external gateway connection, configure a gateway with type Real in Hardware → Gateways. Set its Gateway EUI, reachable IPv4 address, and UDP port there; the Gateway Bridge page is not a replacement for those gateway-specific settings.
The Gateway EUI configured for the real gateway must match the EUI announced by the packet forwarder. This is how packets are associated with the correct gateway when several real gateways share the simulator’s UDP listener.
During a simulation
Use the dashboard to verify the connection:
- Connectivity shows the gateway state and
in / outpacket counters. - Engine activity reports heartbeats, packet ingress and egress, timeouts, reconnects, and validation errors.
- Propagation map draws a device-to-gateway link only when the device is inside its configured antenna range and the communication event is current.
- Logs keeps the events after the run has stopped, including events linked to a specific device or gateway.
Uplinks received from an external gateway update the matching device session. A valid confirmed uplink can produce an acknowledgement through the gateway. Downlinks queued from the dashboard are sent back through the gateway when the device has an appropriate receive opportunity. If the gateway temporarily disconnects, pending traffic is retained for the next available connection when possible.
Supported traffic
The bridge supports the normal Semtech UDP packet-forwarder flow used by real gateways:
- gateway heartbeats and connection acknowledgements;
- uplink packets received from a gateway;
- downlinks and timed transmissions sent back to a gateway;
- acknowledgements and reconnect handling;
- gateway timeout and network-error reporting.
The bridge does not make gateways communicate directly with one another. Each gateway communicates with the network side independently. Coverage and packet delivery still depend on the device-to-gateway radio relationship.
The simulator does not require a physical gateway for local testing. You can run a local packet-forwarder script against the simulator’s UDP listener, or run an external ChirpStack Gateway Bridge and configure its address as the simulator’s bridge destination. Both flows are described below.
The simulator currently integrates with ChirpStack at the Gateway Bridge transport boundary. ChirpStack application/device provisioning and network server administration remain outside this page; configure those in your ChirpStack installation when your test requires them.
Raw LoRa traffic
The UDP transport also carries Raw LoRa bytes. Set the device’s Radio Protocol to Raw LoRa, configure Radio Receive Mode as Raw LoRa or Auto when receiving raw traffic, and configure the bridge or the Real gateway endpoint as usual. Raw traffic does not acquire LoRaWAN headers, encryption, or a join exchange by passing through a gateway.
Use Engine activity and Logs to inspect the Raw LoRa · HEX payload and the associated gateway. Multiple gateways can be connected at the same time; each must have its own Gateway EUI matching the packet forwarder.
Raw payloads received over UDP may contain no device address. These frames are recorded against the receiving gateway; the simulator cannot infer a particular device or a device-to-gateway map link from arbitrary bytes. An external raw downlink without a target address is observable as a frame, but is not automatically delivered to a selected device. Raw frames are not broadcast to every registered device.
Auto recognition uses the frame structure. A recognized LoRaWAN frame still undergoes the normal session and MIC checks; choosing Auto does not bypass them. A bridge transports raw bytes, but this alone does not make ChirpStack interpret them as LoRaWAN application traffic. Check the external service’s raw-frame support separately.
Troubleshooting
The gateway remains disconnected
For a Virtual gateway, check that the bridge is enabled, that the external bridge service is listening at the saved destination, and that its EUI is registered on the external network server. The destination port belongs to that external service; it is not a port the simulator must reserve locally.
For a Real gateway, check that the external packet forwarder sends to the
backend’s UDP listener (normally port 1700). Check the configured EUI and
packet-forwarder IPv4/port in the gateway record. The bridge checkbox does not
enable or configure this inbound listener.
The gateway is connected but no uplinks arrive
For inbound traffic, confirm that the packet forwarder sends PUSH_DATA to
the backend’s listener and announces the configured Gateway EUI. LoRaWAN
frames must be valid for the configured device session. Raw LoRa frames are
shown as raw events. For outbound traffic, check that the external bridge
receives the Virtual gateway’s uplinks. Inspect ingress, egress and validation
errors in the event stream.
No downlink is visible at the gateway
Make sure the device is in range and that the downlink is valid for its
regional plan. A Real gateway’s packet forwarder must send PULL_DATA to the
simulator and handle transmission requests. When using a Virtual gateway and
external bridge, check that the external service sends downlinks back over
the established UDP connection. Class A devices normally need a receive
window after an uplink.
A UDP connection cannot start
For outbound traffic, check that the external destination is reachable. For inbound traffic, check that the backend can bind its local UDP listener and that the firewall allows incoming packets. Another process using the same local listening port prevents binding. Save bridge settings before starting a new simulation; changes apply to the next run.
Send frames from a Python script
There are two different directions:
- Virtual gateway → external bridge: the address and port on Hardware → Gateway Bridge identify the external service receiving the simulator’s traffic.
- External script → simulator: the script sends Semtech UDP packets to the backend’s listener, normally UDP
1700. SetLWN_GATEWAY_UDP_LISTEN_ADDRbefore starting the backend to use another listening address or port. This listener is separate from the bridge destination and from the HTTP port8080.
For a test on one computer:
- In Hardware → Gateways, create an active Real gateway with EUI
A840410001000101, IPv4127.0.0.1and port1701. Complete the other required fields. Here the external station is the Python script; physical gateway hardware is optional. - Keep the bridge disabled for this example.
- Save the following script as
send_sensor.pyand runpython3 send_sensor.py. - Start the simulation in the same profile. Every five seconds the script sends the binary bytes
FF AA. Open Engine activity or the run in Logs and find Raw LoRa · HEX FF AA associated with the gateway.
The script binds port 1701; the backend listens on 1700. For different computers, change SIMULATOR to the backend’s reachable address and set the gateway IPv4 to the script computer’s address. The EUI in the UI and script must match.
import base64
import json
import secrets
import socket
import time
SIMULATOR = ("127.0.0.1", 1700)
GATEWAY_EUI = bytes.fromhex("A840410001000101")
PAYLOAD = bytes.fromhex("FF AA")
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as sock:
sock.bind(("0.0.0.0", 1701))
sock.settimeout(1)
try:
while True:
sock.sendto(bytes([2]) + secrets.token_bytes(2) + bytes([2])
+ GATEWAY_EUI, SIMULATOR)
body = {"rxpk": [{
"tmst": (time.monotonic_ns() // 1000) & 0xFFFFFFFF,
"freq": 868.1, "chan": 0, "rfch": 0, "stat": 1,
"modu": "LORA", "datr": "SF7BW125", "codr": "4/5",
"rssi": -60, "lsnr": 7, "size": len(PAYLOAD),
"data": base64.b64encode(PAYLOAD).decode("ascii")
}]}
sock.sendto(bytes([2]) + secrets.token_bytes(2) + bytes([0])
+ GATEWAY_EUI + json.dumps(body).encode(), SIMULATOR)
print("Sent:", PAYLOAD.hex(" ").upper(), flush=True)
deadline = time.monotonic() + 5
while time.monotonic() < deadline:
try:
packet, _ = sock.recvfrom(65535)
if len(packet) >= 4:
print("UDP response type:", hex(packet[3]), flush=True)
except socket.timeout:
pass
except KeyboardInterrupt:
passStop with Ctrl+C. Responses 0x1 and 0x4 acknowledge UDP receipt; confirm the actual frame in Logs. This example sends raw bytes. For LoRaWAN, supply a complete valid frame and register the matching device and credentials in the simulator. An arbitrary text string is not a LoRaWAN frame.