-
Notifications
You must be signed in to change notification settings - Fork 53
Undocumented Linux Features
⚠ Disclaimer: These features are not officially supported by the X1Plus. Improper use may brick or otherwise damage your printer. Proceed with caution. ⚠
It's worth noting that this camera was previously inaccessible to end-users, which is what makes it particularly exciting now.
⚠ However, it's important to be aware that executing this script will stop the GUI on the LCD screen, and you may have to reboot your printer to return to the normal screen. Proceed with caution. ⚠
Executing the script located at /usr/bin/camera_debug.sh enables real-time viewing of images from webcams. Option 10, in particular, streams video from the second webcam positioned near the Lidar sensor to the LCD screen. The image will be displayed in a small rectangle and may appear very dark, potentially appearing entirely black on the screen. Activating the Nozzle LED beforehand from the Gcode Terminal on the printer's LCD GUI could be helpful in such situations.
Currently, this feature may not seem very useful. However, it holds potential for creating interesting timelapses or videos in the future.
If your screen service needs a restart, you may use this command from the SSH console: /etc/init.d/S99screen_service restart. This is especially useful after running VNC server or camera debug scripts, as they may stop the screen service.
It is still recommended to reboot your printer after running those scripts to ensure that all scripts are launched in the order they are intended.
The exposure levels of the chamber camera can be adjusted with the following commands:
-
Disable autoexposure:
v4l2-ctl --device /dev/video20 --set-ctrl exposure_auto=1 -
Set exposure:
v4l2-ctl --device /dev/video20 --set-ctrl exposure_absolute=5000 -
Enable autoexposure:
v4l2-ctl --device /dev/video20 --set-ctrl exposure_auto=3
ISP data from both of the printer's cameras can be saved directly with v4l2-ctl. The following command will save JPG files from the chamber camera stream:
v4l2-ctl --device /dev/video20 --set-fmt-video=width=1280,height=720,pixelformat=MJPG
v4l2-ctl --device /dev/video20 --stream-mmap=3 --stream-count=1 --stream-to /tmp/frame_1.jpg
Nozzle cam captures (use ffmpeg for NV12/YUYV to JPG conversion):
v4l2-ctl --device /dev/video13 --set-fmt-video=width=640,height=480,pixelformat=YUYV
v4l2-ctl --device /dev/video13 --stream-mmap=3 --stream-count=1 --stream-to=/tmp/capture.raw
A much simpler method to view your printer's toolhead camera still captures is to edit your "home" background image settings so that it displays one of the .jpg files in /userdata/log/cam/capture/. The printer updates these .jpg files after every LiDAR calibration, and these files are in several categories: reference images, mask of horizontal laser, mask of vertical laser.
To enable this on your device, open up SSH and use the X1Plus settings CLI to change your background images:
x1plus settings set homescreen.image /userdata/log/cam/capture/lightline_15.jpg
x1plus settings set homescreen.image.printing /userdata/log/cam/capture/calib_14.jpg
This is what this looks like on the X1 Carbon, with both of these keys saved in settings*:
Home image: calib_14.jpg; Print image: lightline_15.jpg
*Note: to reset these images to their defaults, enter the following command:
x1plus settings set homescreen.image null
Perhaps you would like to read:
Or perhaps you would just like to download the latest release?