luizribeiro / mariner

Web interface for controlling MSLA 3D Printers based on Chitu controllers, such as the ones by Elegoo and Phrozen.
MIT License
243 stars 64 forks source link

Raspberry pi camera streaming feature #206

Open dajosco opened 3 years ago

dajosco commented 3 years ago

First, what you've done here is awesome. I am definitely trying this next weekend. I would suggest the possibility to add as a feature to stream video from the raspberry pi camera hooked up to its port. That would be really handy.

Thanks for your dedication!

luizribeiro commented 3 years ago

Hey! I think this is a good idea, but I'd rather not have it as part of the core package - since not everyone has a camera.

I've been considering building a plugin system, which would allow people to build plugins and install them for features like this one.

What do you think?

BobLoblaw5 commented 3 years ago

I would also be very interested in being able to use a pi camera. Would be really nice to be able to quickly check and make sure everything is still attached to the build plate.

Also thank you so much for making this program! I just got it running on my Creality LD-002H (you should also be able to add the LD-002R to the list of compatible printers because the motherboards appear to be identical.)

Hypertoken commented 3 years ago

I think a camera is a great idea as well. I've actually installed MJPG-streamer and view the camera in an iframe with mariner. I'd be great to have a bit more polish though. :)

However I have to say, as a side note; its very hard to get a good shot with the cover on my printer, and I just can't print with it off. ;) mariner

dogmachine commented 3 years ago

I think a camera is a great idea as well. I've actually installed MJPG-streamer and view the camera in an iframe with mariner. I'd be great to have a bit more polish though. :)

However I have to say, as a side note; its very hard to get a good shot with the cover on my printer, and I just can't print with it off. ;) mariner

i'm basically doing the same but with https://github.com/pikvm/ustreamer which is better suited for a rpi. also will soon have x264 support.

anthonny-gunawan commented 3 years ago

Waiting for this features, I put the Pi inside, have not tested what the camera see... but hopefully it will works

Soldering directly to make it smaller: image

and mounting inside the cover: image

dogmachine commented 3 years ago

Waiting for this features, I put the Pi inside, have not tested what the camera see... but hopefully it will works

I have been on a bit of a journey with the camera: https://imgur.com/a/iKbDWnW

DivineJimmi commented 3 years ago

@Hypertoken Can you make a small tutorial how you implemented a camera stream into the webUI?

Hypertoken commented 3 years ago

@Hypertoken Can you make a small tutorial how you implemented a camera stream into the webUI?

@DivineJimmi. I wouldn't call it "Implemented" but this is what I did.

  1. Install Mariner; You probably already did this ;)
  2. Install MJPG-streamer ( or ustreamer as @dogmachine suggests); there are plenty of tutorials out there for these.
  3. Once the camera is working, I just wrote a simple HTML to display it, with Mariner in an iframe. mariner_video html
DivineJimmi commented 3 years ago

Tbh i have absolute no idea how to write a html file. Maybe you can provide me with a step by step guideline?

Hypertoken commented 3 years ago

@DivineJimmi LOL, this really isn't the place for it, but... You can just use notepad to write the file. The screenshot I included above is the entire file.

mariner_video html

https://pastebin.com/pdfQLQig You just need to change the ip to your raspberry pi ip or hostname. Save the file with the html extension. Then open it in your browser. You might need to adjust the top:500px tag to get the camera frame where you want it.

daxliniere commented 3 years ago

All of this and more can be done with Node-RED which comes pre-installed on Raspberry Pi OS (including Light). I am actually in the process of building a platform to do all of this and more. Definitely check out Node-RED, it's free, awesome and the community is very nice and helpful.

All the best! Dax. image

DivineJimmi commented 3 years ago

This looks really good. So for my understanding in the future this is easy to implement? I have absolutely no idea how to do this with nodenred.

daxliniere commented 3 years ago

@DivineJimmi, I didn't know anything about Node-RED until 2 months ago. :) Though I am an engineer and can think logically, I'm definitely not a programmer, so I'm sure you can learn NR, too.

Once I've got my system all figured out, I'm going to post the entire flow to import directly into NR. Then you just need to select which sensors and output relays you have chosen to connect.

DivineJimmi commented 3 years ago

@daxliniere So you are connecting your sensors to the GPIO pins and choose them in your setup? Is this working with a camera too?

daxliniere commented 3 years ago

@DivineJimmi, yes exactly. NR interfaces with all manner of things using modules, such as the Pi modules that come preinstalled. I have not got this particular setup working with a camera, but I have another Pi which takes a feed from a network (IP) camera and emails it to me upon a specific set of conditions, and the Pi-Zero has a camera connector on-board so I'm sure it would be a piece of cake to get the camera working, too.

daxliniere commented 3 years ago

@DivineJimmi, just find the Node-RED Youtube channel and watch their tutorials playlist. That'll give you an idea of how simple, but powerful it is.

Kaympe20 commented 2 weeks ago

I think a camera is a great idea as well. I've actually installed MJPG-streamer and view the camera in an iframe with mariner. I'd be great to have a bit more polish though. :)

However I have to say, as a side note; its very hard to get a good shot with the cover on my printer, and I just can't print with it off. ;) mariner

How did you do an iframe on the web page? Did you just edit the underlying html?