0

I'm new to the world of Raspberry Pi, so apologies if the answer to these questions seem obvious.

I do a bit of soldering now and then, and I've been given a Raspberry Pi 4 module, and had an extra monitor around, so I decided to make a pseudo microscope with it to help with the soldering, or even just for having a closer look at PCBs. I got a pi camera module with the thin ribbon cable and set up an arm to hold it so it looks down at the table top.

As far as getting it to run, it works. I use:

rpicam-vid -t 0 --width 1920 --height 1080 -f

This provides a live view on the monitor. Even though the fullscreen flag is in the command, it's not quite full screen and you can see a bit of the desktop environment at the top of the screen. That turned out to be fortunate as I can right click the tab that is linked with the camera feed and kill it when I'm done. The next step was I that I wanted to make it so that the camera module would start automatically on startup. I wanted to just have the mouse and not need the keyboard, since I bring the whole microscope setup into a workshop area, so the less I need to bring in, the better. I added a startup script so it would initiate the camera module after startup, but it seems it does this before the desktop environment is loaded, so there is no way to stop the camera module, other than to just unplug the power cable.

How do I go about initiating the camera module automatically but in such a way that I can kill it and safely shut down the Raspberry Pi with the mouse?

My setup is Raspberry Pi 4 Raspberry Pi OS 64-bit based on Debian 12

1
  • 1
    The simple answer would be to add an entry to some GUI menu or a shortcut on the desktop -- put the command in a script and link it to that. I'm not a user of the RpiOS desktop so I can't fill in the details there, but I'm sure it's possible; I'd like to believe it is as easy as, eg., making the script exectuable then drag n' dropping it onto the desktop from a file browser. It probably isn't, but it shouldn't be much harder than that, the main menu itself should have some option somewhere for adding custom entries.
    – goldilocks
    Commented Oct 15 at 13:53

1 Answer 1

0

Ok so thanks go to goldilocks for pointing me in the right direction.

I made the most basic shell script ever which is really just my rpicam-vid command, made it executable and copy-pasted it onto the desktop.

So now rather than having the camera module start automatically upon boot, I just let the Pi boot into the desktop, and with the mouse I start the camera module. Once I'm done with it I can stop it, and then shut down the Pi safely so I don't corrupt the microSD card.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.