I like the project and understand your predicament better now. Difficult to come up anything specific without that hardware. Some searches show that similar projects have been done, apparently successfully (like: 1, 2, 3, 4). Motion seems to be up to date (github is alive), so I don’t think the features are deprecated (maybe some supporting packages are missing or not configured). It would be the simplest solution to get that to work. It seems that this kind of projects had more interest several years ago - you’re a bit late to the party
Did you come across this thread in your previous searches (similar problem) https://forums.raspberrypi.com/viewtopic.php?t=43844?
Are you using motion or the newer motionplus?
Have you considered serving the files over NFS? (Then no need for ssh sftp, etc.) The NFS clients could have automount set up so that trying to access /net/nfs-server-hostname would automatically mount the remote file system and some idle period would automatically unmount.
No, but I can see from the commands in that thread (and by the 2013 date) that it’s not written for Bullseye, which supposedly implemented several changes in managing the camera, in addition to having moved to Python3 (and I’m not sure if that last item affects anything other than the install process for MotionEye
, which I’m not attempting to use anymore for now.)
Motion
.
According to the Motion Project (for info):
Motion is the original software dating back to 2000 while MotionPlus is a new application. MotionPlus was added as a new application in order to allow for removal of older functionality rarely used while also adding new functionalities.
I don’t have any experience with it, but sounds like an interesting option, if a bit complicated (for me). I’m currently using an external SSD attached to a hub on my always-on RPi4B for backing up files from all my machines. (Low electricity usage)
I can only really dabble around the edges of your questions.
If you are coding it yourself, no. Handle errors as you want.
Yes, but, for example, sshfs
has a reconnect
option.
Personally, I envisaged using ssh
(as either sftp
or sshfs
) to transfer files from the source (the Pi with the camera) to a server. I take your point that you don’t really have a server - but maybe that is telling you that it is time that you do.
Then, if performance is not adequate for random clients pulling files from the server, you would push files to the client using some other protocol or the same protocol, whatever works.
That depends.
NFS is a bit complicated if you want it to be secure.
For limited use and strictly being used on the local network without security, NFS is really simple to set up.
If the possibility exists that you might want to access the camera’s images from outside your local network then security is a must - and in that case SSH is not a bad starting point.
Frankly, from a functionality point of view, it won’t really matter. There are many choices of protocol for remote access to files / for transferring files from one computer to another. So I would suggest getting the bigger picture design sorted out before worrying about exactly what protocol(s) move files around.
I wouldn’t worry about the power consumption of the computers involved but that might depend on whether you have solar panels or not. I mean sure if you are going to operate an industrial strength server in a rack in an air-conditioned computer room then it’s a consideration but my guess is that one solar panel will run every Pi in your house and an optional ultra-compact server if you wanted one - and still have plenty left over.
You could legitimately raise the issue of … but what about at night? (when there is no solar generation) In that case, the first question to you is whether the camera you are using has the IR filter or not. If you are filtering IR then you probably aren’t capturing images at night (which may or may not be a consideration relating back to the underlying purpose here). If you aren’t capturing images at night then you can just sleep the whole functionality overnight (when a panel wouldn’t be generating any power).
IMAP is not used to send email. IMAP is used to receive email when the email is stored permanently on the server. In most cases SMTP will be used to send email to your email service provider for delivery to your mailbox - from where one or more IMAP clients could access that email.
Provided that the email is strictly a notification and does not include any image content, that could work as a way of distributing notifications (and should nicely handle which clients are on at the time and which clients are off).
Sorry, I can’t help with the core of the problem, which is actually using the camera - but it is not something that I have played with.
I just wanted to say this is super cool and I wish you luck. Reading your posts are like reading a master class in fun computing.
Battery powered movement (IR) activated light will help with that. It will make life a bit easier and safer too. And you can either use rechargeable batteries or get a light that has solar panels (and a sensor that activates the light only when it’s dark). Pretty cheap old school tech. Or, you can get a high powered construction light with the sensor and blind anyone trying to approach your porch (makes funny clips for a compilation of blinded people cussing)
Thanks for this tip.
Actually, with the exterior lighting I do get some somewhat usable imagery at night, of my walkway and a short stretch of the public sidewalk out front. But right, I don’t expect anyone will knock on my door in the wee hours, although I still review the video clips out of interest. (Unfortunately I don’t have solar panels, but maybe in the future; electricity here is some of the most expensive in the nation, although my usage is not so high. Or I could get a Pi Camera NOIR.)
I was simply thinking that I might have already maxed out the number of devices that Startmail allows for desktop email (unless they’ve removed the limit lately). They require a per-device password. I also use Proton Mail, but I don’t know if it would work on desktop without their “bridge.” I’ll have to investigate, if I decide to use email notification. Or just get a third, simpler provider.
But really, maybe your suggestion about desktop notification and sshfs
might work better anyway.
Still, I’ll keep trying to get streaming working, because then I’ll likely notice in real time when random people (petitioners, solicitors, etc.) head for my door.
You flatter, sir!
Using TightVLC Remote/Viewer, I hooked up a plain camera to a small laptop and tried stream. It worked, albeit clumsily but I was just checking to see if it would work. The laptop was old so I had it send (stream IMO is same thing) from my garage peeking out the window, to my desktop in home.
It’s been a long time since I used it when it crashed, but for Linux versions, TightVLC today says:
If you need a version working in Windows 95/98/ME, Windows NT 4.0, or in Unix-like systems (including Linux)
Just a thought,
~s
Thanks for the suggestion. The tiny PiZero is fairly low-spec’ed, so I don’t know if it could handle remotely displaying an entire desktop over VNC. There’s also still the issue that my Pi Camera isn’t conveying the video stream to the remote browser (or remotely in VLC), which is my main problem.
Works perfectly for creating and storing stills and video clips with the motion
software, though. [Edit: The motion
package works for stills and video clips, I mean. Still working on getting actual live streaming to work with the Pi Camera.]
Wow. Now I feel like I finally made a contribution. Unless you already tried VNC in which case, don’t tell me that
No, I meant that the installed motion
software makes the Pi Camera work for stills and video clips.
But keep contributing. You’re a valued forum member.
Or, at the risk of sounding like a stuck record , run your own mail server. If you only need this internally to your network then the security considerations become less significant, and the degree of difficulty will be lower, and you just won’t have any restrictions. However running your own mail server may be overkill if the only thing it is used for is motion notifications.
From what I’ve seen of commercial offerings, they probably just use some proprietary protocol to throw UDP (unicast or multicast) notifications around the local network. That would very likely require some coding.
εὕρηκα! I found a way to get a live stream in Bullseye:
Run this on the Pi:
libcamera-vid -t 0 --inline --listen -o tcp://192.168.xxx.xxx:5555 -n
and open a network stream in VLC at:
tcp/h264://192.168.xxx.xxx:5555
Instant live video.
And it only took a month of trawling the internet. (That’s sarcasm.)
Now I’m ready for the onslaught of electoral campaign door-knockers later this year.
Just in case it might help someone out there…
I had been wondering why my Pi Camera V2.1’s Sony 8-megapixel lens, which is supposedly set to a fixed infinity focus at the factory, was producing slightly blurry images of my target area.
I happened to read on some blog that the initial run of the V2.1 was not set to the same focal length, and that this little plastic ring, which is included in the box with the camera - but which comes with no guide or explanation whatsoever - is actually a focal adjustment tool:
(shown beside a common disk battery, for size comparison)
Underside, magnified through a loupe; note the notches in the inner ring, which align to the tiny tabs around the outside of the camera lens:
So I placed it over the lens, gave it a short, counterclockwise twist, and the image focus was greatly improved. (It’s trial and error, I’m afraid. Adjust, check image, adjust…)
Just wanted to follow up on this…
The RPi0 is doing its job generally well. I usually have it set to collect motion-activated movies (although, again, it actually monitors changes in pixels, not motion per se) above a set minimum noise level. It typically produces a couple hundred 640x480 clips per day (not all of which I actually watch). I don’t bother with collecting simultaneous stills.
Occasionally I stream live video instead. (It’s not possible to do both live stream and motion-activated collection at once, as the camera can only be busy with one or the other.)
For info, though, the Pi Zero W sometimes gets bogged down and stalls, I guess from its processing limitations, and I think it probably overheats sometimes. (It seems to happen even more frequently if I set a larger image size or greater framerate.) In such cases, the ssh connection gets broken and the only way to restart the device is to cut the power and restart. (I run it “headless.”)
So I’m thinking of upgrading either to a Pi Zero 2 W, or a more capable Pi in general. Overall, I’m satisfied, though, and it has been a cool project.
And the reason I ended up with this particular version of the Zero is that it was part of a kit with camera and cable… and I didn’t completely research all the options, versions, etc.