Hi I am using the Mecheye Nano ultra-gl connected to a linux computer running ubuntu 20.04. I have installed your SDK v2.5.4. I am able to see the camera using the IP configure tool in ubuntu and I can choose the camera index 0 when I run the sample ConnectToCamera project on Github but I get a segfault and an error message that the camera failed to connect to the Ethernet port of the computer. I have pasted the full error message when I run the program at the end of this message. I also get a segfault when I am using the ip_configurator tool trying to change the IP address on ubuntu. I have to connect the camera to a windows computer to change the IP address for testing.
Steps so far I have done to debug this issue:
Confirmed that my machines Ip address is on the same subnet as the camera for the Ethernet port the camera is connected to. I can ping the camera via the ping tool in the terminal. Camera IP: 192.168.1.101 Subnet mask: 255.255.255.0, Ethernet IP: 192.168.1.100 Subnet mask: 255.255.255.0.
Tried another very different set of IP addresses Camera IP: 169.254.4.29 Subnet mask: 255.255.255.0, Ethernet IP: 169.254.4.44 Subnet mask: 255.255.255.0.
Tired downgrading to SDK v2.5.1 but that segfaults in a lot of the programs because I think the FW on my mecheye does not support that SDK. I have not found a way to also downgrade the FW yet so this may still be something we can try if I can get the FW to match the older SDK?
I have connected the mecheye camera to a windows computer and I am able to connect to the camera in the Mech-Eye Viewer software and take pictures.
I have confirmed that the MTU size is correct and I have not enabled large packets on the ethernet.
I have disabled all other network interfaces and disabled any VPNs on my machine. During this I am still able to ping the cameras IPaddress.
twoeste@3460db4:~/projects/mecheye_cpp_samples/area_scan_3d_camera/Basic/ConnectToCamera/build$ ./ConnectToCamera
Discovering all available cameras...
Camera index: 0
.............................
Model: Mech-Eye NANO ULTRA-GL
Device name:
Serial number: RUM35254A510EG20
IP address: 192.168.1.101
Subnet mask: 255.255.255.0
IP address assignment method: Static
Hardware version: V5.2.0
Firmware version: V2.5.4
Support status: Supported
.............................
Please enter the index of the camera that you want to connect: 0
Failed to obtain the IP address of the computer Ethernet port connected to the device. Please try disabling the Ethernet interface cards not connected to the device.
ping: option requires an argument -- 'I'
Usage
ping [options] <destination>
Options:
<destination> dns name or ip address
-a use audible ping
-A use adaptive ping
-B sticky source address
-c <count> stop after <count> replies
-D print timestamps
-d use SO_DEBUG socket option
-f flood ping
-h print help and exit
-I <interface> either interface name or address
-i <interval> seconds between sending each packet
-L suppress loopback of multicast packets
-l <preload> send <preload> number of packages while waiting replies
-m <mark> tag the packets going out
-M <pmtud opt> define mtu discovery, can be one of <do|dont|want>
-n no dns name resolution
-O report outstanding replies
-p <pattern> contents of padding byte
-q quiet output
-Q <tclass> use quality of service <tclass> bits
-s <size> use <size> as number of data bytes to be sent
-S <size> use <size> as SO_SNDBUF socket option value
-t <ttl> define time to live
-U print user-to-user latency
-v verbose output
-V print version and exit
-w <deadline> reply wait <deadline> in seconds
-W <timeout> time to wait for response
IPv4 options:
-4 use IPv4
-b allow pinging broadcast
-R record route
-T <timestamp> define timestamp, can be one of <tsonly|tsandaddr|tsprespec>
IPv6 options:
-6 use IPv6
-F <flowlabel> define flow label, default is random
-N <nodeinfo opt> use icmp6 node info query, try <help> as argument
For more details see ping(8).
Failed to obtain the IP address of the computer Ethernet port connected to the device. Please try disabling the Ethernet interface cards not connected to the device.
Connected to the camera successfully.
Disconnected from the camera successfully.
Segmentation fault (core dumped)
The ping: option requires an argument -- 'I' error and subsequent segfault confirm the SDK cannot resolve the network interface name. It is passing an empty string to the system command, causing the crash.
Since net-tools is installed, this is likely a routing conflict. Please try these steps:
Isolate the Network: If WiFi or Docker uses the same 192.168.1.x subnet, the SDK fails to select the correct path. Temporarily disable them to test: sudo nmcli radio wifi offsudo ifconfig docker0 down Then retry ./ConnectToCamera.
Verify the Route: Run ip route get 192.168.1.101. The output must show your physical Ethernet interface (e.g., dev eth0 or eno1). If it shows nothing, you need to add a static route in your OS settings.
Disable Firewall:sudo ufw disable
If the problem persists, please let me know and I will reach out to the corresponding department for a solution.
I was using Claude to help debug this and it changed the example program ConnectToCamera to connect directly via IP and that was actually able to connect and capture images via the other tools if we changed the program to just take in the input via cli. Here was the diff of what was changed in the example code. Also it still has the problem that the ping command fails but it still seems to go ahead under the hood.
Index: area_scan_3d_camera/Basic/ConnectToCamera/ConnectToCamera.cpp
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/area_scan_3d_camera/Basic/ConnectToCamera/ConnectToCamera.cpp b/area_scan_3d_camera/Basic/ConnectToCamera/ConnectToCamera.cpp
--- a/area_scan_3d_camera/Basic/ConnectToCamera/ConnectToCamera.cpp (revision 394f6bb415e8a1ffc951d5d2b4d5f0817db3407d)
+++ b/area_scan_3d_camera/Basic/ConnectToCamera/ConnectToCamera.cpp (date 1768591585226)
@@ -38,41 +38,50 @@
#include "area_scan_3d_camera/Camera.h"
#include "area_scan_3d_camera/api_util.h"
-int main()
+int main(int argc, char* argv[])
{
- std::cout << "Discovering all available cameras..." << std::endl;
- std::vector<mmind::eye::CameraInfo> cameraInfoList = mmind::eye::Camera::discoverCameras();
+ mmind::eye::Camera camera;
+ const std::string successMessage = "Connected to the camera successfully.";
+
+ // If an IP address is provided as argument, connect directly
+ if (argc > 1) {
+ std::string ipAddress = argv[1];
+ std::cout << "Connecting to camera at IP: " << ipAddress << std::endl;
+ showError(camera.connect(ipAddress), successMessage);
+ } else {
+ std::cout << "Discovering all available cameras..." << std::endl;
+ std::vector<mmind::eye::CameraInfo> cameraInfoList = mmind::eye::Camera::discoverCameras();
- if (cameraInfoList.empty()) {
- std::cout << "No cameras found." << std::endl;
- return -1;
- }
+ if (cameraInfoList.empty()) {
+ std::cout << "No cameras found." << std::endl;
+ std::cout << "Tip: You can connect directly by IP: ./ConnectToCamera <ip_address>" << std::endl;
+ return -1;
+ }
- // Display the information of all available cameras.
- for (int i = 0; i < cameraInfoList.size(); i++) {
- std::cout << "Camera index: " << i << std::endl;
- printCameraInfo(cameraInfoList[i]);
- }
+ // Display the information of all available cameras.
+ for (int i = 0; i < cameraInfoList.size(); i++) {
+ std::cout << "Camera index: " << i << std::endl;
+ printCameraInfo(cameraInfoList[i]);
+ }
- std::cout << "Please enter the index of the camera that you want to connect: ";
- unsigned inputIndex;
+ std::cout << "Please enter the index of the camera that you want to connect: ";
+ unsigned inputIndex;
- // Enter the index of the camera to be connected and check if the index is valid.
- while (1) {
- std::string str;
- std::cin >> str;
- if (std::regex_match(str.begin(), str.end(), std::regex{"[0-9]+"}) &&
- atoi(str.c_str()) < cameraInfoList.size()) {
- inputIndex = atoi(str.c_str());
- break;
- }
- std::cout
- << "Input invalid! Please enter the index of the camera that you want to connect: ";
- }
+ // Enter the index of the camera to be connected and check if the index is valid.
+ while (1) {
+ std::string str;
+ std::cin >> str;
+ if (std::regex_match(str.begin(), str.end(), std::regex{"[0-9]+"}) &&
+ atoi(str.c_str()) < cameraInfoList.size()) {
+ inputIndex = atoi(str.c_str());
+ break;
+ }
+ std::cout
+ << "Input invalid! Please enter the index of the camera that you want to connect: ";
+ }
- mmind::eye::Camera camera;
- const std::string successMessage = "Connected to the camera successfully.";
- showError(camera.connect(cameraInfoList[inputIndex]), successMessage);
+ showError(camera.connect(cameraInfoList[inputIndex]), successMessage);
+ }
camera.disconnect();
std::cout << "Disconnected from the camera successfully." << std::endl;
Thanks for the update! This aligns with the feedback from our internal team, who also suggested connecting directly via IP to bypass potential network restrictions. I’ll record these findings and share them with our development team for further review.
Was there any guidance from them on how what the Ping error output was in the SDK or how to configure the network correctly so I do not need to know the IP before hand?
Here’s the reply from our internal team. Hope this helps.
The issue of being unable to obtain the IP address of the industrial computer’s network port is only a prompt and will not affect the normal use of the camera. This prompt can be ignored.
The high probability of this occurring is due to the presence of other network cards on the industrial computer, which causes the acquisition to fail. You can try configuring an independent network segment and temporarily disabling the other network cards, leaving only the camera network card enabled.
Thanks for the info I will continue using the IP address to connect. But I would think your sdk should be able to work with other networks connected. Also I have tried disabling the other networks and the issue still occurs.
Hi Thomas, thanks for your patience. I’ve shared your feedback with our team. While the IP connection is a valid workaround, I understand that the SDK should ideally discover the camera automatically, especially since it works on Windows.
Our team suggests that the ‘Ping error’ you see is a secondary prompt caused by network interference and shouldn’t stop the camera from functioning once connected. However, I am still pushing for more specific guidance on the Discovery issue in multi-NIC environments. In the meantime, please refer to the network troubleshooting documentation for further investigation: FAQ: Using Mech-Eye API