System designHow-to

Camera connection after a power cycle: re-init in the robot program

Why the camera connection dies after a robot controller power cycle, why the plugin still shows green, and the program-start re-init that fixes it.

LumaSpec Vision9 min read Share on LinkedIn

On this page 10 sections
  1. 01What the refused connection is telling you
  2. 02Why a power cycle breaks it
  3. 03What you need
  4. 04The fix: re-open the camera at program start
  5. 05Worked example: first cycle after a weekend power-down
  6. 06How to verify the fix
  7. 07When it is not the cold start
  8. 08Make every start a known-good start
  9. 09Checklist before you sign it off
  10. 10Questions

A robot cell that runs cleanly all week loses its camera on the first cycle after every power-down. The pose request fails, an operator switches to manual mode, opens the installation panel, refreshes the vision plugin, and the same program runs without issue until the next outage. The error behind it names 127.0.0.1 and a port, not the camera. This guide is for whoever owns that cell: what the error means, why a power cycle causes it, and the program-start change that makes the first cycle after any restart recover on its own.

What the refused connection is telling you

The camera-pose program node does not talk to the camera. It posts an XML-RPC request to a small service the vision plugin runs on the robot controller itself, at loopback address 127.0.0.1, TCP port 33004. The full signature reads:

Failed to connect to 127.0.0.1 port 33004 Connection refused

"Connection refused" has one meaning on any TCP stack: nothing was listening on that port at that moment. The camera, its lens, its cable and its calibration can all be healthy. The plugin's local service simply is not up yet.

That also explains the green indicator. The connection status in the installation panel shows the result of the last successful handshake, and it re-evaluates only when you open the panel or press refresh. It is a stored state, not a live probe of port 33004. The refresh button works because pressing it re-opens the local service and re-binds the port, which is exactly the action the program should perform for itself.

The error text also names the node and the line where the request was issued; in one field case, the camera-pose node at line 99. That location is where the call failed, not where the fault lives.

If your link drops while the program is running instead, that is a different failure with a different fix: see fixing intermittent XML-RPC vision server drops.

Why a power cycle breaks it

A controller boot is a sequence, and the program can start before it finishes:

  1. Controller operating system.
  2. Robot runtime.
  3. Plugins, including the vision plugin.
  4. The plugin's local service binding 127.0.0.1:33004.
  5. The camera link, when the camera draws power from the controller.

An auto-started or operator-started program can reach the camera-pose node while step 4 has not happened yet. The request hits a port with no listener and comes back refused. Anything that restarts the plugin without a full boot, such as a plugin update, a controller restart or a service crash, reproduces the same signature.

Cameras powered from the controller widen that window, because the camera itself has to re-link after power returns. Controllers with PoE camera ports, such as the MV-VC5525-256G70-NN, switch camera power with their own power state, so the camera re-links only once the controller is up.

Vision controllersHikrobot MV-VC5525-256G70-NN VC5000 Vision Controller, 12th-I5, 32GB+256G SSD, Supported PCIEMV-VC5525-256G70-NN
LAN ports
5+ LAN ports
USB 3 ports
3-4 USB 3 ports
PoE
PoE camera ports
Light outputs
8 built-in channels
$4,479.00 · quotedView and quoteBuild a system with it

What you need

  • Edit access to the robot program, on the pendant or offline.
  • The vision plugin's initialize or open-connection program node: the program-level equivalent of the installation panel's refresh action. Every vision plugin exposes some form of it; the node name varies by plugin.
  • A fault routine that stops the cell cleanly with a message.
  • Your logged error signature: host 127.0.0.1, port 33004, the node name and the line number.

If the camera is a smart camera that runs its inspection on the device and serves results over Fast Ethernet, such as the MV-SC3050XC-16M-ATN-H, the same cold-start behavior applies to the camera's own address after it regains power.

Smart cameras & vision sensorsHikrobot MV-SC3050XC-16M-ATN-H 5 MP color vision sensorMV-SC3050XC-16M-ATN-H
Interface
Fast Ethernet
Resolution
5 MP
Sensor format
1/1.45"
Shutter
Global
$1,809.00View part

The fix: re-open the camera at program start

  1. Open the main program, the one the cell runs after every power-up, not a subroutine.
  2. Insert the initialize node at the very top, before the first node that requests a result and before any motion that depends on a pose.
  3. Wrap it in a retry: attempt the initialize, wait a fixed interval on failure, and repeat up to a fixed attempt count.
  4. On success, fall through. The pose request that follows now finds a listener on the port.
  5. On final failure, jump to the fault routine: stop, write the error to the log, and request no pose from a dead service.
  6. Leave the manual refresh in the installation panel for commissioning and troubleshooting only.
  7. Record the node and its line in the cell documentation, so maintenance finds it without reading the whole program.
worst-case first-cycle delay = retry attempts × retry interval

The retry costs nothing when the link is already up: a single loopback call succeeds on the first attempt.

Worked example: first cycle after a weekend power-down

Inputs, all from the cell:

  • Retry attempts: 5.
  • Retry interval: 2 s.
  • The camera-pose node sits at line 99, the point that threw the refused connection.

Rule: the service either binds inside the retry window or it does not.

Arithmetic: 5 × 2 s = 10 s of worst-case delay added to the first cycle. If the service binds during attempt three, the delay is 4 s. If the controller was never powered down, the delay is one successful local call and the cycle time does not move.

Decision: with a 10 s budget, the first part after any power event runs unattended, and a service that has not bound within 10 s is a fault, not a slow boot. Compare that with the manual path, where an operator leaves automatic mode, opens the installation panel, refreshes and restarts, once per power event. The program node is worth adding the first time an operator has to walk over.

How to verify the fix

Three tests, in order:

  1. Warm start. Start the program on a live cell. The first initialize succeeds and the cycle time is unchanged.
  2. Cold start. Power the controller down, power it up, and start the program in automatic the way production does. The first part runs and the log shows one recovery.
  3. Dead camera. Switch the camera off, then start the program. The retries exhaust in 10 s, the cell stops on the fault routine, and no motion runs on a missing pose.

Write the initialize result to the controller log in every test, so a recovery months later shows up as data instead of a mystery. For a camera that dies while the program is running rather than at start, add camera disconnect detection without stopping the program.

When it is not the cold start

  • Refresh does not fix it, or the failure also happens in manual mode. The plugin's local service is crashing or the plugin build is broken. Startup bugs of exactly this class have shipped in camera plugins and were fixed in the following release, so after any plugin update, re-run the cold-start test before trusting it. Plugin upgrades have also arrived with program formats the previous plugin could not load; plan the rebuild in the new node structure before upgrading, not after.
  • The request times out instead of being refused. Something answered, but the far side never returned. Check the camera's address and subnet first; a camera that fell back to a link-local address produces this pattern. See opening a GigE camera on a link-local address.
  • A USB camera that has power but is not detected is a different link layer with its own checks: USB link checks after a cable swap.
  • The initialize node itself fails on every start, warm or cold. That is a start-sequence problem in the vision system, not a power-cycle problem: fixing a camera failed-to-initialize error.

Make every start a known-good start

Program-start re-init covers the controller reboot, because program start always follows boot. Three habits complete it:

Power events clear state well beyond the vision link. On the PLC side, program changes lost after a power cycle is the same class of failure. Robot controllers also differ in whether a restarted cycle re-enters the main program at all; returning to the main program on cycle start covers that setting.

If you are building the cell rather than patching it, one host simplifies all of this. A compact vision controller such as the MV-VC3301H-128G66 drives its lights from 4 built-in channels, so cameras, lights and processing share the same power state and boot order, and the retry rule has a single target.

Vision controllersHikrobot MV-VC3301H-128G66 I3-8100, 8GB+128G SSD, No PoE, PCIe expansion supported, Incl. VM6200Pro licenseMV-VC3301H-128G66
LAN ports
5+ LAN ports
USB 3 ports
3-4 USB 3 ports
Light outputs
4 built-in channels
Memory
8 GB
$2,419.00View partBuild a system with it

Checklist before you sign it off

  • Initialize node at the top of the main program, ahead of the first result request.
  • Retry wrapper in place: fixed attempts, fixed interval, fault routine on final failure.
  • Cold-start test passed in automatic mode, with the recovery visible in the log.
  • Dead-camera test faults cleanly, with no motion on a missing pose.
  • Plugin version and the node's line number recorded in the cell documentation.

When the camera side needs more than a program fix, the smart cameras and vision controllers ranges cover the hardware, and the contact page reaches our applications team for the integration question.

Questions

Why does the plugin show green when the request is refused?

The panel indicator reports the last handshake the plugin recorded, and it only re-evaluates when the panel is opened or refreshed. It is not a live probe of the local service, so it can lag in either direction after a restart. Treat the program-level initialize result as the truth and write it to the controller log.

How many retries and what interval should we use?

Five attempts 2 s apart is a sound default: a 10 s worst case that covers a service binding after boot without hurting the first cycle. Drop the interval to 1 s on cells where first-cycle time matters and the service binds fast. Keep the attempt count generous, so a normal cold start never reaches the fault routine.

Does this also fix a camera that drops while the program runs?

No. This re-init covers the cold start, when the local service was never up. A camera that disconnects mid-run needs detection inside the running loop and a fresh handshake at the next cycle start, with the pose re-requested before any motion depends on it. Cold start and mid-run loss are two mechanisms; cover both.

Do we need to recalibrate after a power cycle?

No. The hand-eye calibration is stored in the camera installation and survives power-down; the connection does not. Re-initialize the link and request a fresh pose. If positions drift with a healthy link, check what changed around the calibration: a tool frame edited after calibration is the usual suspect, and it produces exactly the off-target picks you would blame on the camera.

Can the pendant's refresh action be automated instead?

The installation-panel refresh is a manual commissioning action, not a program command. The initialize node is its program-level equivalent, and it runs where it matters: at the top of the main program, on every start, without an operator leaving automatic mode. Keep the panel refresh for bring-up and troubleshooting.