basler / pypylon

The official python wrapper for the pylon Camera Software Suite
http://www.baslerweb.com
BSD 3-Clause "New" or "Revised" License
540 stars 209 forks source link

Problem with connection to Raspberry Pi #746

Open DiogoFerreira77 opened 2 months ago

DiogoFerreira77 commented 2 months ago

Describe what you want to implement and what the issue & the steps to reproduce it are:

Hi,

I need to develop a program for object detection with YOLO using a Raspberry Pi. So for this case I am using a basler aca1300-30gm. The problem that I am facing is that I can't establish a communication between the raspberry Pi and the camera. In a PC environment works well, and using a router for the Raspberry works as well, however, I don't want to use the router or a PC. The interface used is GigE.

I did like the documentation says: sudo ifconfig eth0 192.168.178.1 netmask 255.255.255.0 but that disapear after a few seconds... Am I missing something? How can I solve this?

Is your camera operational in Basler pylon viewer on your platform

Yes

Hardware setup & camera model(s) used

Camera: Basler aca1300-30gm PC : Raspberry Pi 4 model B 8GB RAM OS: Debian GNU/Linux 12 (bookworm) aarch64 Kernel: 6.6.20+rpt-rpi-v8

Runtime information:

python: 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0]
platform: linux/aarch64/6.6.20+rpt-rpi-v8
pypylon: 3.0.1 / 7.4.0.38864
thiesmoeller commented 2 months ago

So only the rpi with a direct connected camera.

Rpi <~> camera

Then you can configure the rpi ethernet to use LLA.

Assume you rpi is currently using e.g. network Manager... In this case you can't use ifconfig

DiogoFerreira77 commented 2 months ago

@thiesmoeller Yes its only rpi with a directed connected camera. I apologize for my lack of knowledge, but how could I do that?

thiesmoeller commented 2 months ago

Try searching for static address on rpi forums https://forums.raspberrypi.com/viewtopic.php?p=2144413#p2144413

DiogoFerreira77 commented 1 month ago

Well, I think I solved it. What I did was: 1 - With a pc and pylon viewer installed I went to Pylon IP Configurator, and put auto ip (LLA) 2 - On the RPI I added a new IP addres (the same as the camera): a) sudo ip address xxx.xxx.xxx.xxx/xx dev eth0 b) sudo nano /etc/network/interfaces

  #add the following lines:

  auto eth0 
  iface eth0 inet static
  address xxx.xxx.xxx.xxx
  netmask 255.255.255.0

c)reboot

3 - With Pylon Viewer installed on the RPI, I went again to Pylon IP Configurator and put it with IP Static.

And well, it worked.