Upgrading to the Pi Camera Module 3

Hi all,
I am running Repetier Server Pro 1.4.13 Mecury-88 on a Pi 3. It works fine with my Pi Camera Module 2. I wish to update to the Pi Camera Module 3 with auto focus and greater resolution. My installation pre-dates the availability of the Module 3.

When I ssh into the Pi, I find that the Repetier update did not update the underlying Bullseye Linux system so I know that the Module 3 software is not in the system. There are many many updates that may be applied to the Linux system. Perhaps because of lack of disk space.

If I update the Linux system do I run the risk of destabilizing the Repetier host? Does that latest raspberry pi disk image on the Repetier web site support the new Camera Module 3? Is it best to start all over than run sudo apt upgrade? If apt upgrade is the way to go I want to backup all my gcode on the Pi, but I can't find the directory where the files are stored, are they in a database?

Sorry for so many questions, but the Repetier software has worked flawlessly for over a year and I have not delved all that deeply into it.

Comments

  • Updating os can break the system especially if you use libcamera. In last time they constantly change version so the included mjpg_stremer will not work any more with it. We have updated linux and mjpg_streamer with newer images, so at least the now official solution should work with the camera, also it will do compression software side so use lots of cpu for it. No idea if they also updated the legacy webcam solution where we can still use hardware mjpg. I only have a Camera Module 2 for testing. 
  • Thanks Repetier, I'll have a go at it with a new image and let you know if it works in this thread. It will take about two weeks.
  • Hi Repetier, The Model 3 camera works on a Pi 3 running Pro 1.4.13 Lunos-42. The Mercury-88 system would not recognize the camera, so I updated. The server will not allow a resolution above 2560x1440.  I am pretty sure the auto focus is not working unless the depth of field is extremely limited. My first try with a time lapse video failed because I don't know how to get it working. I'll keep trying and report back.
  • Higher resolutions need more speed as data amount increases. I have seen logitech 4k cams only working on usb3 in 4k mode for that reason, so sounds like a similar problem.

    For timelapse see our video on homepage
    https://www.repetier-server.com/documentation/

    Smooth Timelapse Videos explains all tricks around timelapse.
  • Hi Repetier. I now understand the resolution limits. I have been poking around Lunos and made a few discoveries. All the necessary capabilities for running the Model 3 camera are present in the distributed libcamera.so used by mjpg-streamer for video input.  I proved this by killing the mjpg_streamer process and running:

    libcamera-hello -t 0 --hdr --qt-preview --autofocus-mode continuous -p 10,10,1000,1000

    A window opens on my X-server and I can see the auto focus actively working. The --hdr option also improves picture quality.  When I place these options in the mjpg_streamer config file using repetier-setup:

    WEBCAM_PICAM_PARAMS="--hdr --autofocus-mode continuous"

    the mjpeg_streamer fails to start as seen in /var/log/messsages
    Oct 15 11:47:03 RepetierServer MJPG-streamer [25963]: starting application
    Oct 15 11:47:03 RepetierServer MJPG-streamer [25963]: enabling daemon mode
    Oct 15 11:47:03 RepetierServer MJPG-streamer [25965]: MJPG Streamer Version.: 2.0
    Oct 15 11:47:03 RepetierServer MJPG-streamer [25965]: input_init() return value signals to exit
    I am trying to find a work-around; perhaps either adding libcamera options to /boot/config.txt or some other file that libcamera will read during mjpg-streamer startup.  I can manually start mjpg_streamer once it is killed. I use the command from the ps axl output:

    /usr/local/bin/mjpg_streamer -i "/usr/local/lib/mjpg-streamer/input_libcamera.so -fps 10 -r 2560x2160 -s 2560x2160 -quality 85"  -o "/usr/local/lib/mjpg-streamer/output_http.so -p 9000 -w /usr/local/share/mjpg-streamer/www"

    This produces a working mjpg_streamer process. However, if I add my options to this command line the initialization fails with: Libcamera Input plugin: unrecognized option '--hdr' it also fails with '-hdr'

    Do you have any guidance?
  • I poked around more this morning and discovered that mjpg_streamer uses the option

    WEBCAM_PICAM_PARAMS="-afmode continuous"
     
    to enable auto focus mode. I placed this in the mjpg_streamer.config file using repetier-setup and now have auto focus working. 

    Sadly, I do not see a mjpg_streamer equivalent to the high dynamic range --hdr option. But the Model 3 camera is now working satisfactorily enough.

    For other users that run into my original post I transferred all my prints from the old host to the new host using the backup printer  selection found on the server's home page that lists all the printers. The gear fly-out menu for the particular printer has that function. Go to the same fly-out menu to restore the backup to the new system.
  • Great that you found this. Here is the homepage of the version we use
    https://github.com/ArduCAM/mjpg-streamer/blob/master/mjpg-streamer-experimental/plugins/input_libcamera/README.md

    The option isn't even listed there but poking in sources I found this current set of options for libcamer:
       fprintf(stderr,
        " [-c | --camera ].......: Chooses the camera to use.\n"
        " [-f | --fps ]..........: frames per second\n" \
        " [-b | --buffercount ]...: Set the number of request buffers.\n"  \
        " [-q | --quality ] .....: set quality of JPEG encoding\n" \
        " [-rot | --rotation]....: Request an image rotation, 0 or 180\n"
        " [-s | --snapshot ] .....: Set the snapshot resolution, if not set will default to the maximum resolution.\n" \
        " ---------------------------------------------------------------\n" \
        " Optional parameters (may not be supported by all cameras):\n\n"
        " [-br ].................: Set image brightness (integer)\n"\
        " [-co ].................: Set image contrast (integer)\n"\
        " [-sa ].................: Set image saturation (integer)\n"\
        " [-ex ].................: Set exposure (integer)\n"\
        " [-gain ]...............: Set gain (integer)\n"
        " [-afmode]..............: Control to set the mode of the AF (autofocus) algorithm.(manual, auto, continuous)\n"
        " [-afrange].............: Set the range of focus distances that is scanned.(normal, macro, full)\n"
        " [-lensposition]........: Set the lens to a particular focus position, expressed as a reciprocal distance (0 moves the lens to infinity), or \"default\" for the hyperfocal distance"
        " ---------------------------------------------------------------\n\n"\
        );

    but no hdr. Not sure if with video streams hdr is also available. I could think that for still images it uses several snapshots with different exposure to create it.



Sign In or Register to comment.