# Could not open a camera using the IP adresse

**URL:** <https://aravis-project.discourse.group/t/could-not-open-a-camera-using-the-ip-adresse/541>\
**Category:** Using Aravis\
**Created:** [November 14, 2022, 4:53pm UTC](https://aravis-project.discourse.group/t/could-not-open-a-camera-using-the-ip-adresse/541 "2022-11-14T16:53:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Embedded\_Systems\_Eng](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/embedded_systems_eng/32/187_2.png) [@Embedded\_Systems\_Eng](https://aravis-project.discourse.group/u/Embedded_Systems_Eng)\
**Post date:** [November 14, 2022, 4:53pm UTC](https://aravis-project.discourse.group/t/could-not-open-a-camera-using-the-ip-adresse/541/1 "2022-11-14T16:53:58Z")

</div>

Hello,  
I am trying to open a camera using the IP address and I got an error message.

```auto
arv-tool-0.8
FLIR-Blackfly S BFS-PGE-04S2M-20285599 (10.1.0.83)
---------------virtual-machine:~$ ping 10.1.0.83
PING 10.1.0.83 (10.1.0.83) 56(84) bytes of data.
64 bytes from 10.1.0.83: icmp_seq=1 ttl=255 time=1.38 ms
64 bytes from 10.1.0.83: icmp_seq=2 ttl=255 time=1.92 ms

```

my c code is : Eth\_Camera = arv\_camera\_new(“10.1.0.38”, &Eth\_Error);  
my camera exists and could use it using the arv-viewer-0.8 tool.

the error message when I execute the code is this:

```auto
The bandwidth of the USB Camera is 380000000 
The bandwidth of the Ethernet Camera is 0 

**(process:5147): CRITICAL**: 17:47:20.119: arv_camera_is_uv_device: assertion 'ARV_IS_CAMERA (camera)' failed

**(process:5147): CRITICAL**: 17:47:20.119: arv_camera_uv_get_bandwidth: assertion 'arv_camera_is_uv_device (camera)' failed
Found USB_Camera 'Firefly FFY-U3-04S2M'
120 acquisitions took 0.430457 seconds to execute 

```

I am expecting the same thing as my USB camera already connected but, it seems that the camera is not recognizing, the camera object for the ethernet is not instantiated.  
Do you have any idea about this issue, please?

Thank you in advance,

---

<div class="post-metadata">

**Author:** ![Emmanuel](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/emmanuel/32/198_2.png) [@Emmanuel](https://aravis-project.discourse.group/u/Emmanuel)\
**Post date:** [November 14, 2022, 7:27pm UTC](https://aravis-project.discourse.group/t/could-not-open-a-camera-using-the-ip-adresse/541/2 "2022-11-14T19:27:42Z")

</div>

Hi,

> [@Embedded\_Systems\_Eng](#):
>
> my c code is : Eth\_Camera = arv\_camera\_new(“10.1.0.38”, &Eth\_Error);

I guess there is a typo here in the IP address.

Could you run your code with `ARV_DEBUG=all` and attach the output here ?

---

<div class="post-metadata">

**Author:** ![Embedded\_Systems\_Eng](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/embedded_systems_eng/32/187_2.png) [@Embedded\_Systems\_Eng](https://aravis-project.discourse.group/u/Embedded_Systems_Eng)\
**Post date:** [November 14, 2022, 9:20pm UTC](https://aravis-project.discourse.group/t/could-not-open-a-camera-using-the-ip-adresse/541/3 "2022-11-14T21:20:21Z")

</div>

Hello Emmanuel,  
Thank you for your answer!

What do you mean by a typo?  
I will share tomorrow the output with the flag AVR\_DEBUG.  
Does the complication with the debug configuration?

---

<div class="post-metadata">

**Author:** ![Emmanuel](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/emmanuel/32/198_2.png) [@Emmanuel](https://aravis-project.discourse.group/u/Emmanuel)\
**Post date:** [November 14, 2022, 9:41pm UTC](https://aravis-project.discourse.group/t/could-not-open-a-camera-using-the-ip-adresse/541/4 "2022-11-14T21:41:22Z")

</div>

> [@Embedded\_Systems\_Eng](#):
>
> What do you mean by a typo?

The first log says `10.1.0.83`, then you wrote `10.1.0.38`

---

<div class="post-metadata">

**Author:** ![Embedded\_Systems\_Eng](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/embedded_systems_eng/32/187_2.png) [@Embedded\_Systems\_Eng](https://aravis-project.discourse.group/u/Embedded_Systems_Eng)\
**Post date:** [November 14, 2022, 9:48pm UTC](https://aravis-project.discourse.group/t/could-not-open-a-camera-using-the-ip-adresse/541/5 "2022-11-14T21:48:35Z")

</div>

yes, this is the problem I guess a typo, but you tell me to add ARV\_DEBUG=all.  
I’ll test this and I ll back to you.

---

<div class="post-metadata">

**Author:** ![Embedded\_Systems\_Eng](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/embedded_systems_eng/32/187_2.png) [@Embedded\_Systems\_Eng](https://aravis-project.discourse.group/u/Embedded_Systems_Eng)\
**Post date:** [November 15, 2022, 8:56am UTC](https://aravis-project.discourse.group/t/could-not-open-a-camera-using-the-ip-adresse/541/6 "2022-11-15T08:56:05Z")

</div>

Emmnuel Hello,  
I corrected the IP adresse and I added the ARV\_DEBUG=all in my preprocessor.  
The compilation output with the verbos oprion is the following:

```auto

09:48:54 ****Incremental Build of configuration Release for project 01_Multiple_Aquisition****
make all 
Building file: ../src/02-multiple-acquisition.c
Invoking: GCC C Compiler
gcc -DCRITICAL -I/usr/include/aravis-0.8 -I"/home/tarik/git/cameras-software/01_Multiple_Aquisition/Inc" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/02-multiple-acquisition.d" -MT"src/02-multiple-acquisition.o" -o "src/02-multiple-acquisition.o" "../src/02-multiple-acquisition.c"
Finished building: ../src/02-multiple-acquisition.c
 
Building file: ../src/ImgFormat.c
Invoking: GCC C Compiler
gcc -DCRITICAL -I/usr/include/aravis-0.8 -I"/home/tarik/git/cameras-software/01_Multiple_Aquisition/Inc" -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/ImgFormat.d" -MT"src/ImgFormat.o" -o "src/ImgFormat.o" "../src/ImgFormat.c"
Finished building: ../src/ImgFormat.c
 
Building target: 01_Multiple_Aquisition
Invoking: GCC C Linker
gcc -L/usr/lib/x86_64-linux-gnu -o "01_Multiple_Aquisition" ./src/02-multiple-acquisition.o ./src/ImgFormat.o -laravis-0.8 -lgobject-2.0 -lpng
Finished building target: 01_Multiple_Aquisition
 

09:48:56 Build Finished. 0 errors, 0 warnings. (took 2s.466ms)

09:48:59 ****Incremental Build of configuration Release for project 01_Multiple_Aquisition****
make all 
make: Nothing to be done for 'all'.

09:49:00 Build Finished. 0 errors, 0 warnings. (took 338ms)

```

I execute the code the code and the result is this:

```auto
The bandwidth of the USB Camera is 380000000 
The bandwidth of the Ethernet Camera is 0 

**(process:4403): CRITICAL**: 09:49:01.246: arv_camera_uv_get_bandwidth: assertion 'arv_camera_is_uv_device (camera)' failed
Found USB_Camera 'Firefly FFY-U3-04S2M'
120 acquisitions took 0.499622 seconds to execute

```

I have two cameras in my system, the USB is opened and it works but the second one with the ethernet address is not recognized.

The C code is this:

```auto
/* Connect to the first available camera */
	USB_Camera = arv_camera_new(NULL, &USB_error);
	Eth_Camera = arv_camera_new("10.1.0.83", &Eth_Error);

	/* Setting ADC bit Depth */
#ifdef HALFWORD
	// 46 Mb for 120 images
	arv_camera_set_string (USB_Camera, "PixelFormat", "Mono8", &USB_error);
	arv_camera_set_string (Eth_Camera, "PixelFormat", "Mono8", &Eth_Error);
#else
	// 93,3 MB for 120 images
	arv_camera_set_string (USB_Camera, "PixelFormat", "Mono16", &USB_error);
	//arv_camera_set_string (Eth_Camera, "PixelFormat", "Mono16", &Eth_Error);
#endif
	/*
	 * The result is 720*540*10bit*100 image munched 121 images!
	 * I think because the default format is 8bit/px
	 * */
	printf("The bandwidth of the USB Camera is %d \n",
			arv_camera_uv_get_bandwidth(USB_Camera, &USB_error));

	printf("The bandwidth of the Ethernet Camera is %d \n",
			arv_camera_uv_get_bandwidth(Eth_Camera, &Eth_Error));

```

---

<div class="post-metadata">

**Author:** ![Embedded\_Systems\_Eng](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/embedded_systems_eng/32/187_2.png) [@Embedded\_Systems\_Eng](https://aravis-project.discourse.group/u/Embedded_Systems_Eng)\
**Post date:** [November 15, 2022, 1:52pm UTC](https://aravis-project.discourse.group/t/could-not-open-a-camera-using-the-ip-adresse/541/7 "2022-11-15T13:52:31Z")

</div>

Hello, the issue is that the first time I open a camera is use NULL in the arv\_camera\_new, I change it to vendor-serial and it works for me.  
the problem was that I don’t specify any argument for the USB camera and it connect to the Ethernet before the USB. now I connect the USB camera using the string vendor and serial and the IP address for the ethernet camera.  
Thank you in advance for your help.

---

<div class="post-metadata">

**Author:** ![Emmanuel](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/emmanuel/32/198_2.png) [@Emmanuel](https://aravis-project.discourse.group/u/Emmanuel)\
**Post date:** [November 15, 2022, 9:08pm UTC](https://aravis-project.discourse.group/t/could-not-open-a-camera-using-the-ip-adresse/541/8 "2022-11-15T21:08:21Z")

</div>

I’m glad you have fixed your issue.

A note about ARV\_DEBUG: it is not something to be set during the compilation. It is an environment variable to be set before running an aravis based application.

For example, if you are using the bash shell:

```auto
ARV_DEBUG=all ./path/to/your/application

```

[https://aravisproject.github.io/aravis/building.html#debugging-aravis](https://aravisproject.github.io/aravis/building.html#debugging-aravis)
