×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

INDI LibCamera Driver

  • Posts: 106
  • Thank you received: 33

Replied by Simon on topic INDI LibCamera Driver

Change lines containing github.com/... to github.com/... I get error when trying to execute without https://.
1 year 4 months ago #88153

Please Log in or Create an account to join the conversation.

  • Posts: 106
  • Thank you received: 33

Replied by Simon on topic INDI LibCamera Driver

I still got error No package 'libcamera' found. I added libcamera-dev to end of line 44 like this
sudo apt install build-essential libboost-system-dev libboost-thread-dev libboost-program-options-dev libboost-test-dev libcamera-dev
and line 48 was OK.
1 year 4 months ago #88154

Please Log in or Create an account to join the conversation.

  • Posts: 106
  • Thank you received: 33

Replied by Simon on topic INDI LibCamera Driver

After executing line 49 make -j4 I get this:
Scanning dependencies of target indi_libcamera_ccd
[ 50%] Building CXX object CMakeFiles/indi_libcamera_ccd.dir/indi_libcamera.cpp.o
In file included from /usr/include/libindi/defaultdevice.h:23,
                 from /usr/include/libindi/indiccd.h:30,
                 from /home/stellarmate/Projects/indi-3rdparty/indi-libcamera/indi_libcamera.h:34,
                 from /home/stellarmate/Projects/indi-3rdparty/indi-libcamera/indi_libcamera.cpp:21:
/usr/include/libindi/indilogger.h:72: warning: "LOG_ERROR" redefined
   72 | #define LOG_ERROR(txt)  DEBUG(INDI::Logger::DBG_ERROR, (txt))
      | 
In file included from /home/stellarmate/Projects/indi-3rdparty/indi-libcamera/core/options.hpp:21,
                 from /home/stellarmate/Projects/indi-3rdparty/indi-libcamera/core/video_options.hpp:14,
                 from /home/stellarmate/Projects/indi-3rdparty/indi-libcamera/core/libcamera_encoder.hpp:10,
                 from /home/stellarmate/Projects/indi-3rdparty/indi-libcamera/indi_libcamera.h:29,
                 from /home/stellarmate/Projects/indi-3rdparty/indi-libcamera/indi_libcamera.cpp:21:
/home/stellarmate/Projects/indi-3rdparty/indi-libcamera/core/logging.hpp:9: note: this is the location of the previous definition
    9 | #define LOG_ERROR(text) std::cerr << text << std::endl
      | 
[100%] Linking CXX executable indi_libcamera_ccd
[100%] Built target indi_libcamera_ccd

Last Line went OK and I can see driver in EKOS (see attached image), but when I try to start EKOS I get Error dialog: INDI Driver LibCamera crashed (see attached image).

Thumbs up for you OUTTA!
1 year 4 months ago #88155
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 123
  • Thank you received: 13

Replied by Outta on topic INDI LibCamera Driver

try to add libcamera-apps
as well, they come by default for RpiOS, probably not for StellarMate
1 year 4 months ago #88156

Please Log in or Create an account to join the conversation.

  • Posts: 106
  • Thank you received: 33

Replied by Simon on topic INDI LibCamera Driver

I already have latest libcamera-apps.
sudo apt install libcamera-apps
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libcamera-apps is already the newest version (1.0-stable~202210121703).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 year 4 months ago #88157

Please Log in or Create an account to join the conversation.

  • Posts: 123
  • Thank you received: 13

Replied by Outta on topic INDI LibCamera Driver

Ok, So regarding crashes that is where fun (and our work) starts :)

My crashes as well, but a bit differently, now install QTCreator, and follow steps from tutorial, to enable debugging.
Last edit: 1 year 4 months ago by Outta.
1 year 4 months ago #88158

Please Log in or Create an account to join the conversation.

  • Posts: 106
  • Thank you received: 33

Replied by Simon on topic INDI LibCamera Driver

There is EKOS Debugger that came with Stellarmate. When I run it I get this:
2022-11-15T12:17:30: startup: /usr/bin/indiserver -r 0 -v indi_libcamera_ccd indi_gpsd indi_simulator_telescope
[Attaching after Thread 0x7ff7ff4040 (LWP 21017) fork to child process 21020]
[Detaching after fork from parent process 21017]
2022-11-15T12:17:30: Driver indi_libcamera_ccd: pid=21020 rfd=6 wfd=6 efd=7
2022-11-15T12:17:30: Driver indi_gpsd: pid=21021 rfd=8 wfd=8 efd=9
2022-11-15T12:17:30: Driver indi_simulator_telescope: pid=21022 rfd=10 wfd=10 efd=11
2022-11-15T12:17:30: listening to port 7624 on fd 5
2022-11-15T12:17:30: Local server: listening on local domain at: @/tmp/indiserver
2022-11-15T12:17:30: Driver indi_simulator_telescope: HaAxis: TrackRate 1, trackingRateDegSec 15.041067 arcsec
2022-11-15T12:17:30: Driver indi_simulator_telescope: snooping on GPS Simulator.GEOGRAPHIC_COORD
2022-11-15T12:17:30: Driver indi_simulator_telescope: snooping on GPS Simulator.TIME_UTC
2022-11-15T12:17:30:
Driver indi_simulator_telescope: snooping on Dome Simulator.DOME_PARK
2022-11-15T12:17:30: Driver indi_simulator_telescope: snooping on Dome Simulator.DOME_SHUTTER
2022-11-15T12:17:34: Driver indi_libcamera_ccd: snooping on Telescope Simulator.EQUATORIAL_EOD_COORD
2022-11-15T12:17:34: Driver indi_libcamera_ccd: snooping on Telescope Simulator.EQUATORIAL_COORD
2022-11-15T12:17:34: Driver indi_libcamera_ccd: snooping on Telescope Simulator.TELESCOPE_INFO
2022-11-15T12:17:34: Driver indi_libcamera_ccd: snooping on Telescope Simulator.GEOGRAPHIC_COORD
2022-11-15T12:17:34: Driver indi_libcamera_ccd: snooping on Telescope Simulator.TELESCOPE_PIER_SIDE
2022-11-15T12:17:34: Driver indi_libcamera_ccd: snooping on Rotator Simulator.ABS_ROTATOR_ANGLE
2022-11-15T12:17:34: Driver indi_libcamera_ccd: snooping on Focuser Simulator.ABS_FOCUS_POSITION
2022-11-15T12:17:34: Driver indi_libcamera_ccd: snooping on Focuser Simulator.FOCUS_TEMPERATURE
2022-11-15T12:17:34: Driver indi_libcamera_ccd: snooping on CCD Simulator.FILTER_SLOT
2022-11-15T12:17:34: Driver indi_libcamera_ccd: snooping on CCD Simulator.FILTER_NAME
2022-11-15T12:17:34: Driver indi_libcamera_ccd: snooping on SQM.SKY_QUALITY
2022-11-15T12:17:34: Driver indi_libcamera_ccd: [1:25:12.142898037] [21020] [1;32m INFO [1;37mCamera [1;34mcamera_manager.cpp:293 [0mlibcamera v0.0.0
[Attaching after Thread 0x7fe8a95500 (LWP 21038) fork to child process 21039]
[Detaching after fork from parent process 21020]
2022-11-15T12:17:34: Driver indi_libcamera_ccd: [1:25:12.935604051] [21038] [1;32m INFO [1;37mRPI [1;34mraspberrypi.cpp:1377 [0mRegistered camera /base/soc/i2c0mux/i2c@1/imx477@1a to Unicam device /dev/media1 and ISP device /dev/media0
2022-11-15T12:17:34: Driver indi_libcamera_ccd: [1:25:12.936226005] [21038] [1;31mERROR [1;37mDeviceEnumerator [1;34mdevice_enumerator.cpp:166 [0mRemoving media device /dev/media0 while still in use
2022-11-15T12:17:34: Driver indi_libcamera_ccd: [1:25:12.936292671] [21038] [1;31mERROR [1;37mDeviceEnumerator [1;34mdevice_enumerator.cpp:166 [0mRemoving media device /dev/media1 while still in use
2022-11-15T12:17:34: Driver indi_libcamera_ccd: stderr EOF
2022-11-15T12:17:34: Driver indi_libcamera_ccd: read: Connection reset by peer
2022-11-15T12:17:34: Driver indi_libcamera_ccd: Terminated after #0 restarts.

I'll install QTCreator and will report here my findings. Happy codding! :)
1 year 4 months ago #88159

Please Log in or Create an account to join the conversation.

  • Posts: 123
  • Thank you received: 13

Replied by Outta on topic INDI LibCamera Driver

Comment out
528 cameraManager.reset();
to prevent those first crashes. It still does not work for my camera but i can debug now and find out what exactly is the issue.
1 year 4 months ago #88161

Please Log in or Create an account to join the conversation.

  • Posts: 106
  • Thank you received: 33

Replied by Simon on topic INDI LibCamera Driver

I uncomment 168 Line m_StillApp->StopCamera(); because closing unstoped camera caused error. Now problem is here:

[2022-11-15T15:53:34.673 CET DEBG ][ org.kde.kstars.indi] - INDI Server: "2022-11-15T14:53:34: Driver indi_libcamera_ccd: [4:01:12.658068023] [54041] \u001B[1;35mFATAL \u001B[1;37mIPAManager \u001B[1;34mipa_manager.cpp:109 \u001B[0mMultiple IPAManager objects are not allowed"
1 year 4 months ago #88162

Please Log in or Create an account to join the conversation.

Replied by Jasem Mutlaq on topic INDI LibCamera Driver

Yes this is the issue. We need a way to detect the cameras, but if this is done and the object is NOT released, then we get this issue. If the object is released from memory (the line you commented), we get a crash. You can comment the whole detection code, and just connect directly to whatever camera is detected by libcamera and then it should work.

We lose the ability to provide a list of cameras to select from, but at least you can check the rest of the functionality. Maybe we need to file a bug report with either libcamera-apps or libcamera.
1 year 4 months ago #88163

Please Log in or Create an account to join the conversation.

  • Posts: 106
  • Thank you received: 33

Replied by Simon on topic INDI LibCamera Driver

I commented out all the detection code as you sugested and left only this:
void INDILibCamera::detectCameras()
{
  CameraSP.resize(1);
  CameraSP[0].fill("/base/soc/i2c0mux/i2c@1/imx477@1a", "/base/soc/i2c0mux/i2c@1/imx477@1a", ISS_OFF);
  CameraSP[0].setState(ISS_ON);
}

Now when I start EKOS in KStars I get this:
See last two lines of error log.
[2022-11-15T19:18:07.916 CET DEBG ][           org.kde.kstars.ekos] - Resetting Ekos Manager...
[2022-11-15T19:18:07.967 CET INFO ][           org.kde.kstars.ekos] - "Starting INDI services..."
[2022-11-15T19:18:07.970 CET DEBG ][           org.kde.kstars.indi] - INDI: Starting local drivers...
[2022-11-15T19:18:07.971 CET DEBG ][           org.kde.kstars.indi] - Starting INDI Server:  ("-v", "-p", "7626", "-m", "1024", "-r", "0", "-f", "/tmp/indififo71d1435f") -f "/tmp/indififo71d1435f"
[2022-11-15T19:18:07.989 CET DEBG ][           org.kde.kstars.indi] - INDI: INDI Server started locally on port  7626
[2022-11-15T19:18:07.991 CET DEBG ][           org.kde.kstars.indi] - Starting INDI Driver "indi_libcamera_ccd"
[2022-11-15T19:18:07.992 CET DEBG ][           org.kde.kstars.indi] - INDI Server Started?  true
[2022-11-15T19:18:07.995 CET DEBG ][           org.kde.kstars.indi] - Adding managed driver "LibCamera"
[2022-11-15T19:18:07.996 CET DEBG ][           org.kde.kstars.indi] - INDIListener: Adding a new client manager to INDI listener..
[2022-11-15T19:18:07.997 CET DEBG ][           org.kde.kstars.indi] - INDI: Connecting to local INDI server on port  7626  ...
[2022-11-15T19:18:07.998 CET DEBG ][           org.kde.kstars.indi] - INDI server connected.
[2022-11-15T19:18:07.999 CET INFO ][           org.kde.kstars.ekos] - "INDI services started on port 7,626."
[2022-11-15T19:18:08.011 CET DEBG ][           org.kde.kstars.indi] - INDI Server:  "2022-11-15T18:18:07: startup: /usr/bin/indiserver -v -p 7626 -m 1024 -r 0 -f /tmp/indififo71d1435f"
[2022-11-15T19:18:08.012 CET DEBG ][           org.kde.kstars.indi] - INDI Server:  "2022-11-15T18:18:07: listening to port 7626 on fd 5"
[2022-11-15T19:18:08.013 CET DEBG ][           org.kde.kstars.indi] - INDI Server:  "2022-11-15T18:18:07: Local server: listening on local domain at: @/tmp/indiserver"
[2022-11-15T19:18:08.014 CET DEBG ][           org.kde.kstars.indi] - INDI Server:  "2022-11-15T18:18:07: FIFO: start indi_libcamera_ccd -n \"LibCamera\""
[2022-11-15T19:18:08.015 CET DEBG ][           org.kde.kstars.indi] - INDI Server:  "2022-11-15T18:18:07: With name: LibCamera"
[2022-11-15T19:18:08.016 CET DEBG ][           org.kde.kstars.indi] - INDI Server:  "2022-11-15T18:18:07: FIFO: Starting driver indi_libcamera_ccd"
[2022-11-15T19:18:08.017 CET DEBG ][           org.kde.kstars.indi] - INDI Server:  "2022-11-15T18:18:07: Driver indi_libcamera_ccd: pid=15602 rfd=9 wfd=9 efd=10"
[2022-11-15T19:18:08.018 CET DEBG ][           org.kde.kstars.indi] - INDI Server:  "2022-11-15T18:18:07: Client 8: new arrival from local pid 1104 (user: 1000:1001) - welcome!"
[2022-11-15T19:18:08.019 CET DEBG ][           org.kde.kstars.indi] - INDI Server:  ""
[2022-11-15T19:18:08.370 CET DEBG ][           org.kde.kstars.indi] - INDI Server:  "2022-11-15T18:18:08: Driver indi_libcamera_ccd: snooping on Telescope Simulator.EQUATORIAL_EOD_COORD"
[2022-11-15T19:18:08.370 CET DEBG ][           org.kde.kstars.indi] - INDI Server:  ""
[2022-11-15T19:18:08.371 CET DEBG ][           org.kde.kstars.indi] - INDI Server:  "2022-11-15T18:18:08: Driver indi_libcamera_ccd: snooping on Telescope Simulator.EQUATORIAL_COORD"
[2022-11-15T19:18:08.371 CET DEBG ][           org.kde.kstars.indi] - INDI Server:  "2022-11-15T18:18:08: Driver indi_libcamera_ccd: snooping on Telescope Simulator.TELESCOPE_INFO"
[2022-11-15T19:18:08.371 CET DEBG ][           org.kde.kstars.indi] - Received new device LibCamera
[2022-11-15T19:18:08.371 CET DEBG ][           org.kde.kstars.indi] - INDI Server:  "2022-11-15T18:18:08: Driver indi_libcamera_ccd: snooping on Telescope Simulator.GEOGRAPHIC_COORD"
[2022-11-15T19:18:08.371 CET DEBG ][           org.kde.kstars.indi] - INDI Server:  "2022-11-15T18:18:08: Driver indi_libcamera_ccd: snooping on Telescope Simulator.TELESCOPE_PIER_SIDE"
[2022-11-15T19:18:08.371 CET DEBG ][           org.kde.kstars.indi] - INDI Server:  "2022-11-15T18:18:08: Driver indi_libcamera_ccd: snooping on Rotator Simulator.ABS_ROTATOR_ANGLE"
[2022-11-15T19:18:08.371 CET DEBG ][           org.kde.kstars.indi] - INDI Server:  "2022-11-15T18:18:08: Driver indi_libcamera_ccd: snooping on Focuser Simulator.ABS_FOCUS_POSITION"
[2022-11-15T19:18:08.371 CET DEBG ][           org.kde.kstars.indi] - INDI Server:  "2022-11-15T18:18:08: Driver indi_libcamera_ccd: snooping on Focuser Simulator.FOCUS_TEMPERATURE"
[2022-11-15T19:18:08.371 CET DEBG ][           org.kde.kstars.indi] - INDI Server:  "2022-11-15T18:18:08: Driver indi_libcamera_ccd: snooping on CCD Simulator.FILTER_SLOT"
[2022-11-15T19:18:08.372 CET DEBG ][           org.kde.kstars.indi] - INDI Server:  "2022-11-15T18:18:08: Driver indi_libcamera_ccd: snooping on CCD Simulator.FILTER_NAME"
[2022-11-15T19:18:08.372 CET DEBG ][           org.kde.kstars.indi] - INDI Server:  "2022-11-15T18:18:08: Driver indi_libcamera_ccd: snooping on SQM.SKY_QUALITY"
[2022-11-15T19:18:08.372 CET DEBG ][           org.kde.kstars.indi] - INDI Server:  ""
[2022-11-15T19:18:08.379 CET DEBG ][           org.kde.kstars.indi] - INDIListener: New device "LibCamera"
[2022-11-15T19:18:08.379 CET INFO ][           org.kde.kstars.ekos] - Ekos received a new device:  "LibCamera"
[2022-11-15T19:18:08.381 CET INFO ][           org.kde.kstars.ekos] - Ekos received a new device:  "LibCamera"
[2022-11-15T19:18:08.392 CET DEBG ][           org.kde.kstars.indi] - < LibCamera >: < CONNECTION >
[2022-11-15T19:18:08.398 CET DEBG ][           org.kde.kstars.indi] - < LibCamera >: < DRIVER_INFO >
[2022-11-15T19:18:08.413 CET DEBG ][           org.kde.kstars.indi] - < LibCamera >: < POLLING_PERIOD >
[2022-11-15T19:18:08.423 CET DEBG ][           org.kde.kstars.indi] - < LibCamera >: < DEBUG >
[2022-11-15T19:18:08.433 CET DEBG ][           org.kde.kstars.indi] - < LibCamera >: < CONFIG_PROCESS >
[2022-11-15T19:18:08.441 CET DEBG ][           org.kde.kstars.indi] - < LibCamera >: < ACTIVE_DEVICES >
[2022-11-15T19:18:08.467 CET DEBG ][           org.kde.kstars.indi] - < LibCamera >: < CAMERAS >
[2022-11-15T19:18:08.473 CET INFO ][           org.kde.kstars.indi] - LibCamera :  "[INFO] Debug is enabled. "
[2022-11-15T19:18:08.473 CET DEBG ][           org.kde.kstars.indi] - < LibCamera >: < DEBUG_LEVEL >
[2022-11-15T19:18:08.479 CET DEBG ][           org.kde.kstars.indi] - < LibCamera >: < LOGGING_LEVEL >
[2022-11-15T19:18:08.484 CET DEBG ][           org.kde.kstars.indi] - < LibCamera >: < LOG_OUTPUT >
[2022-11-15T19:18:08.552 CET DEBG ][           org.kde.kstars.indi] - LibCamera : "[DEBUG] Toggle Debug Level -- Alignment Subsystem "
[2022-11-15T19:18:08.604 CET INFO ][           org.kde.kstars.ekos] - Websocket Message "{\"type\":\"get_cameras\"}"
[2022-11-15T19:18:08.606 CET INFO ][           org.kde.kstars.ekos] - Websocket Message "{\"type\":\"get_mounts\"}"
[2022-11-15T19:18:08.606 CET INFO ][           org.kde.kstars.ekos] - Websocket Message "{\"type\":\"get_filter_wheels\"}"
[2022-11-15T19:18:08.607 CET INFO ][           org.kde.kstars.ekos] - Websocket Message "{\"type\":\"get_domes\"}"
[2022-11-15T19:18:08.607 CET INFO ][           org.kde.kstars.ekos] - Websocket Message "{\"type\":\"get_caps\"}"
[2022-11-15T19:18:08.608 CET INFO ][           org.kde.kstars.ekos] - Websocket Message "{\"type\":\"get_scopes\"}"
[2022-11-15T19:18:08.612 CET INFO ][           org.kde.kstars.ekos] - Websocket Message "{\"type\":\"get_states\"}"
[2022-11-15T19:18:08.613 CET INFO ][           org.kde.kstars.ekos] - Websocket Message "{\"type\":\"get_cameras\"}"
[2022-11-15T19:18:08.613 CET INFO ][           org.kde.kstars.ekos] - Websocket Message "{\"type\":\"get_mounts\"}"
[2022-11-15T19:18:08.614 CET INFO ][           org.kde.kstars.ekos] - Websocket Message "{\"type\":\"get_filter_wheels\"}"
[2022-11-15T19:18:08.615 CET INFO ][           org.kde.kstars.ekos] - Websocket Message "{\"type\":\"get_domes\"}"
[2022-11-15T19:18:08.616 CET INFO ][           org.kde.kstars.ekos] - Websocket Message "{\"type\":\"get_caps\"}"
[2022-11-15T19:18:08.616 CET INFO ][           org.kde.kstars.ekos] - Websocket Message "{\"type\":\"get_scopes\"}"
[2022-11-15T19:18:08.619 CET INFO ][           org.kde.kstars.ekos] - Websocket Message "{\"type\":\"get_states\"}"
[2022-11-15T19:18:08.746 CET INFO ][           org.kde.kstars.ekos] - Connecting to "LibCamera"
[2022-11-15T19:18:08.750 CET WARN ][                       default] - QSqlDatabasePrivate::addDatabase: duplicate connection name 'opticaltrains_db', old connection removed.
[2022-11-15T19:18:08.760 CET INFO ][           org.kde.kstars.indi] - LibCamera :  "[ERROR] Error opening camera: illegal rotation value "
[2022-11-15T19:18:18.264 CET INFO ][           org.kde.kstars.ekos] - "Failed to connect to LibCamera. Please ensure device is connected and powered on."
Last edit: 1 year 4 months ago by Simon.
1 year 4 months ago #88165

Please Log in or Create an account to join the conversation.

  • Posts: 123
  • Thank you received: 13

Replied by Outta on topic INDI LibCamera Driver

I see that we have a lot of discrepancy between our issues but indeed I am using Clean RaspberryPiOs Bullseye while you two are both using Stellarmate(ubunu mate?) It might be that we have different libcamea builds as well.

Can you do this command libcamera-hello --version I have this two:
astroberry@raspberrypi:~ $ libcamera-hello --version
libcamera-apps build: 73ab09fcf408 09-11-2022 (14:52:54)
libcamera build: v0.0.1+54-d528119f
libcamera-hello --version
libcamera-apps build: f047a5b01578-intree 12-07-2022 (03:13:06)
libcamera build: v0.0.0+3730-67300b62
1 year 4 months ago #88186

Please Log in or Create an account to join the conversation.

Time to create page: 0.969 seconds