Troubleshooting Weidmuller UC20 RS-485 Node-RED Setup

Daniel Price9 min read
Other ManufacturerSerial CommunicationTroubleshooting
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

After controller-side registry access is restored and the serial binding is matched to the controller runtime, the Node-RED installation can complete and the RS-485 path can be commissioned separately. Follow the request from the browser to the controller, through npm, into the native serial binding, and only then to the UR20 communication module and sensor.

Where does the installation request actually travel?

The engineering PC displays the Node-RED editor, but it does not install the palette package. The device running Node-RED executes npm, resolves the registry host, downloads or retrieves dependencies, and runs their installation scripts. In this setup, the browser was connected to 192.168.10.202; verify whether that address belongs to the UC20-WL2000-IoT before using it as the controller test point.

Path element Address or endpoint Reading to take Decision
Engineering PC Browser session Confirm which address hosts the Node-RED editor A working editor proves PC-to-controller access only.
Node-RED host 192.168.10.202, if assigned to the controller Identify the operating system that executes the palette installation Run network and runtime checks on this device.
Package registry registry.npmjs.org Test name resolution and response from the Node-RED host Failure here is a controller routing, DNS, or network-policy problem.
Native build /var/lib/node-red/node_modules Read the first compiler or binding error A compiler error means the request passed the network stage or used cached packages.
Serial interface Controller-visible interface for the UR20 module Check how the operating system or PLC runtime exposes the channel A generic serial node works only if it can open that interface.

Opening the registry from a browser on the PC tests the PC network path. Connecting the PC to another wired or wireless network also says nothing about the controller route unless the controller uses that connection as its gateway. Follow the packet from the Node-RED host.

Can the controller reach the package registry?

Log in to the device that runs Node-RED and execute the two recorded tests:

ping registry.npmjs.org
wget https://registry.npmjs.org/node-red-node-serialport

The first test checks host-name resolution and basic reachability. The second exercises retrieval of the package metadata over the same registry path needed by the installation. Interpret the results in sequence:

  1. If the host name cannot be resolved, correct the controller DNS configuration.
  2. If the name resolves but no path is available, inspect the controller address, subnet, default gateway, routing, and upstream policy.
  3. If ping fails but wget succeeds, continue; some networks suppress diagnostic echo traffic without blocking registry access.
  4. If wget fails, capture its text output from the controller. It distinguishes name resolution, routing, connection, certificate, and server-response failures.
  5. If wget succeeds, repeat the palette installation and diagnose the first installation error rather than changing more network settings.

The controller was later connected to the internet and produced a different installation log. That change places the next fault after network access. Do not keep treating every palette failure as an internet problem once the log reaches a native compilation step.

Where does the recorded installation stop?

The installation of node-red-contrib-modbus 5.26.0 reached @serialport/bindings-cpp. Two native-binding installations invoked node-gyp-build, entered their build directories, and stopped when make attempted to run the C++ compiler.

Observed message Layer Meaning Next check
make: g++: Command not found Native compilation The build requested g++, but the executable was unavailable to the build process. Determine whether the supported controller image provides a compiler or a compatible prebuilt binding.
bindings.target.mk:102 Generated build rule The failure occurred while compiling serialport.o, not while opening an RS-485 port. Resolve the native module build before testing serial traffic.
Error 127 Command execution The requested compiler command was not found. Check the firmware toolchain policy and executable path.
make failed with exit code: 2 Build orchestration node-gyp propagated the compiler failure. Do not diagnose this as a Modbus register or wiring fault.
ELIFECYCLE, errno 1 npm lifecycle The native dependency installation script failed, so the package installation terminated. Correct the underlying binding build or compatibility problem.

The 10.7.0 binding failure was reported as an optional dependency, while the 10.8.0 binding failure was fatal. The same missing compiler caused both. Installing another node that depends on the same serial binding reproduces the failure because changing the top-level palette package does not change the failed native layer.

Timestamp Derived elapsed time from install request Event
2023-05-05T13:05:10.985Z Installation requested
2023-05-05T13:06:21.512Z About First missing-compiler error
2023-05-05T13:06:51.394Z About Second missing-compiler error
2023-05-05T13:06:58.598Z About Fatal lifecycle error

Does the Node.js runtime match the serial package?

The diagnostic log identifies Linux 4.9.155-yocto-standard-weidmueller.1, Node.js v10.15.3, and node-gyp v3.8.0. The immediate failure is the missing g++ command, but Node.js v10.15.3 was also obsolete. The recorded upgrade guidance identified v16 or v18 as targets.

Treat these as two separate gates. Adding a compiler does not make an obsolete runtime compatible with a current package. Updating the runtime does not automatically add a compiler or provide a native binding for the controller processor and Node application-binary interface.

This controller image ties Node-RED maintenance to the controller update path rather than allowing Node-RED to be updated independently. Use a Weidmuller-supported controller firmware combination and select palette-node versions compatible with the Node.js version supplied by that image. If the appliance image does not include an on-device toolchain, use a package release that supplies a compatible prebuilt native binding or a manufacturer-supported deployment method. A Debian command such as sudo apt-get install build-essential was cited only as a Debian example; the logged system is Yocto-based, so that package-management instruction is not a valid assumption for this controller.

Does Node-RED have a usable path to the UR20 module?

Layer one first. The UC20-WL2000-IoT and UR20-1COM-232-485-422 must be configured so the selected channel operates in the electrical mode used by the peripheral. Determine from the peripheral documentation whether the bus uses a two-wire or four-wire arrangement, then verify conductor polarity, common reference, shield treatment, end termination, and biasing against the device documentation. A swapped pair, missing reference, incorrect mode, or improperly terminated trunk can produce silence or corrupted frames even when the software opens the port.

Next identify how the controller exposes the UR20 channel. A generic Node-RED serial package normally opens an operating-system serial character device. A PLC communication module may instead be owned by the controller runtime and presented through a process interface or manufacturer API.

Interface reading Meaning Next branch
A serial device is visible and the Node-RED process can open it The generic serial-node path is viable. Configure framing and test raw receive data.
The channel is visible but access is denied or already in use Ownership or permissions block Node-RED. Correct access through the supported controller configuration; do not run two owners on one port.
The channel exists only inside the PLC runtime A generic serial node cannot address it directly. Use the controller-supported interface between the PLC runtime and Node-RED.
No channel is exposed The module configuration, driver, backplane mapping, or firmware support is incomplete. Resolve module recognition before installing more protocol nodes.

Does the peripheral use Modbus or another RS-485 protocol?

RS-485 defines the electrical signaling layer, not the message format. Installing node-red-contrib-modbus is appropriate only when the peripheral implements Modbus on the serial link. Obtain the peripheral protocol manual and record the baud rate, data bits, parity, stop bits, device address, request/response framing, function or command definitions, data locations, byte order, word order, signedness, and scaling.

Setting Controller and peripheral must agree? Mismatch symptom
Electrical mode and wiring Yes No frames or persistent corruption
Baud rate Yes Unreadable or absent data
Data bits, parity, and stop bits Yes Framing errors or discarded frames
Device address For addressed protocols No response or response from the wrong unit
Protocol and command format Yes Valid electrical traffic with no meaningful reply
Byte order, type, and scale Yes Plausible traffic but impossible engineering values
Response timing Yes, within configured limits Timeouts, retries, or overlapping requests

Do not configure polling intervals or timeouts by guesswork. Read the peripheral response-time requirements and the Node-RED node timing fields, then leave enough separation that a request completes before the next request is issued. On a shared half-duplex bus, only one transmitter may drive the pair at a time.

How should raw sensor data become pressure and temperature?

First capture the unmodified response and identify what it represents: voltage, converter counts, a scaled integer, or an encoded floating-point value. The phrase “voltage signals to bar” does not identify the voltage range, pressure range, transfer curve, or payload representation. Read those values from the sensor and peripheral documentation or obtain them through calibration.

For a linear pressure sensor, apply this calculation after decoding the raw value:

bar = barLow + (input - inputLow) * (barHigh - barLow) / (inputHigh - inputLow)

Use voltage endpoints when the received value is voltage, or raw-count endpoints when it is converter counts. Treat inputLow, inputHigh, barLow, and barHigh as installation calibration data, not default constants. Apply the temperature transfer function independently; it may use different encoding and scaling.

Preserve the raw value beside the converted result during commissioning. Reject malformed frames before scaling, flag inputs outside the documented range, and compare several known pressure and temperature points. A single-point match can hide an incorrect span, byte order, signed type, or unit conversion.

What procedure resolves and verifies the complete path?

  1. Identify the physical device running Node-RED. Confirm whether 192.168.10.202 is the UC20-WL2000-IoT rather than the engineering PC.
  2. From that device, run ping registry.npmjs.org and wget https://registry.npmjs.org/node-red-node-serialport. Correct controller-side DNS, route, gateway, or network policy if retrieval fails.
  3. Repeat one package installation and save the complete text log. Stop at the first causal error; later npm errors usually report the same upstream failure.
  4. If the log again reports make: g++: Command not found, select the Weidmuller-supported firmware, Node.js, and native-binding path. Do not apply Debian package commands to the Yocto image without explicit product support.
  5. Verify that the resulting runtime is compatible with the selected serial or Modbus node and that the palette installation finishes without a native lifecycle error.
  6. Confirm that the UR20-1COM-232-485-422 channel is recognized, configured for the peripheral electrical mode, visible through a supported controller interface, and available to Node-RED.
  7. Check the RS-485 conductors, polarity, common reference, termination, and biasing. Test with one peripheral before adding more bus nodes.
  8. Configure the documented baud rate, character framing, address, protocol commands, and response timing. Use a Modbus node only if the peripheral manual identifies Modbus.
  9. Capture a raw response, validate its framing, decode the documented data type and byte order, then apply the specified pressure and temperature scaling.
  10. Verify the finished path by comparing raw frames, decoded values, and independently known sensor conditions at multiple operating points.

FAQ

Can I test Node-RED internet access from my Windows browser?

No. The decisive tests must run on the UC20 or whichever device hosts Node-RED: ping registry.npmjs.org followed by wget https://registry.npmjs.org/node-red-node-serialport.

Does the g++ error mean the RS-485 wiring is wrong?

No. make: g++: Command not found occurs while compiling @serialport/bindings-cpp, before Node-RED opens the serial interface.

Can I use node-red-contrib-modbus with every RS-485 sensor?

No. Use node-red-contrib-modbus 5.26.0 only when the peripheral implements Modbus; RS-485 alone does not define addresses, registers, commands, or payload encoding.

Does upgrading Node.js fix Error 127?

Not by itself. The log used Node.js v10.15.3, but Error 127 specifically reports that g++ was unavailable; the runtime and native-build path must both be compatible.

Can I verify pressure conversion with one test value?

One point checks offset but not span. Compare the raw frame and converted pressure or temperature against independently known conditions at multiple operating points as the final verification step.

Back to blog