Arduino Portenta H7 Controller¶
What It Is¶
The Arduino Portenta H7 is a microcontroller that GateKeeper uses to control physical outputs on the conveyor: stack lights (Green/Yellow/Red), reject diverter signal, machine stop signal, horn, and system ready signal. It connects to GateKeeper over TCP/IP and responds to JSON commands.
Which Sites Use It¶
- Cargill St. Clair
- Cargill Oil - Sidney, Gainesville, Fullerton
- Hormel Austin
- Hormel Beloit
(Hormel Barron uses Cognex camera digital I/O instead of an Arduino.)
Connection Details¶
| Detail | Value |
|---|---|
| Protocol | TCP/IP |
| Default port | 502 |
| Connection string format | IP:PORT (e.g., 192.168.100.120:502) |
| Communication | JSON commands and responses |
How to Tell If It Is Working¶
- Diagnostics panel: Arduino controller shows "Connected" with a green indicator.
- Stack light test: Use the diagnostics panel stack light buttons. If lights respond, the Arduino is working.
- Log on startup: Check for successful connection and
sendStatuscommand response. - Status command: GateKeeper sends a
sendStatuscommand on connection. If the Arduino responds, it is online.
Pin Assignments¶
Pin assignments vary by site. Here is the Cargill St. Clair configuration as an example:
| Pin | Function |
|---|---|
| 0 | Reject signal |
| 1 | Machine stop |
| 2 | Stack light Green |
| 3 | Stack light Yellow |
| 4 | Stack light Red |
| 5 | Horn |
| 6 | SystemReady |
Pin assignments are configured in appsettings.json under the Arduino's Configuration JSON. Pins set to -1 indicate hardware not present at that site.
Common Problems and Solutions¶
| Problem | Symptoms | Solution |
|---|---|---|
| Arduino not connecting | Log shows "Socket error connecting to Arduino Portenta at {IP}:{Port}" | Check network cable, ping Arduino IP, verify power |
| No status response | Log shows "TCP connection established but Arduino did not respond to 'sendStatus' command" | Arduino firmware may need updating, check Arduino serial monitor |
| Stack lights not working | Lights do not respond to diagnostics test | Check wiring from Arduino to stack light, verify pin assignments in config |
| Reject not firing | Cases not diverting on failure | Check reject pin assignment, verify wiring to diverter |
| Connection drops during operation | Log shows "TCP connection lost during monitoring" | Check network stability, cable quality, Arduino power supply |
Error Messages¶
| Error Message | What It Means |
|---|---|
Socket error connecting to Arduino Portenta at {IP}:{Port} |
Network connection failed |
TCP connection established but Arduino did not respond to 'sendStatus' command |
Connected but Arduino is not responding to commands |
Cannot control stack light - Arduino not connected |
Stack light command sent but Arduino is offline |
Cannot send reject signal - Arduino not connected |
Reject command sent but Arduino is offline |
Cannot send stop signal - Arduino not connected |
Stop command sent but Arduino is offline |
Cannot sound horn - Arduino not connected |
Horn command sent but Arduino is offline |
Cannot set system ready signal - Arduino not connected |
SystemReady command sent but Arduino is offline |
Failed to control stack light {Color} |
Command sent but no response received |
Failed to send reject signal |
Reject command sent but no response |
Failed to send stop signal |
Stop command sent but no response |
Output pin type '{Type}' not found in configuration |
The requested output is not configured in the Arduino's pin mapping |
Cannot send TCP command - not connected |
TCP connection is down |
"Not Present" Messages (Normal)¶
Some sites do not have all hardware connected. You may see debug-level messages like:
- Stack light {Color} not installed at this site (pin=-1, hardware not present)
- RejectSignal not installed at this site (pin=-1, hardware not present)
- MachineStop signal not installed at this site (pin=-1, hardware not present)
These are normal and indicate that specific hardware is intentionally not connected at this site. They are not errors.
Differences from LattePanda¶
| Aspect | Arduino Portenta H7 | LattePanda Delta 3 |
|---|---|---|
| Connection | TCP/IP (network) | Serial USB (COM port) |
| Sites | Cargill, Hormel Austin/Beloit | Teasdale Carrollton |
| Format | IP:PORT |
COMx:BAUDRATE |
Both controllers use the same JSON command protocol and support the same output functions. The difference is the physical connection type.
When to Escalate¶
- Arduino not responding to
sendStatusafter power cycle and network check - Incorrect pin behavior (wrong output activating)
- Persistent connection drops despite good network
- Arduino firmware needs updating