1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

Pi camera mount

Discussion in 'Mods and Upgrades' started by colton81, Apr 25, 2017.

  1. colton81

    colton81 Active Member

    Joined:
    Feb 21, 2017
    Messages:
    328
    Likes Received:
    71
    im curious if anyone has made a mount similar to the Ultimaker for the Pi camera if so i would love to see it. I have desined one in fusion i will post up later but still having clearnce issues to mount it in the corner
     
  2. OutsourcedGuru

    OutsourcedGuru Active Member

    Joined:
    Jun 3, 2017
    Messages:
    752
    Likes Received:
    141
    I'm working up a design involving the Pi NoIR camera discussed here. I'll get a suction cup and then create a slim/vertical C-shape behind the box to grab onto the shaft of that suction cup, removing those hooks as seen in the photo. I plan to put mine on the left blue window on the inside, of course.

    I thought I would modify the money clip demo print for a second/lower suction cup clip-on to make sure that the ribbon cable hugs the side (totally unnecessary).
     
  3. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    That is where I mounted mine.
     
  4. colton81

    colton81 Active Member

    Joined:
    Feb 21, 2017
    Messages:
    328
    Likes Received:
    71
    Yea i designed a mount for it combining the mounts for the camera on thingiverse and replicating the ultimaker design just never got around to printing it out. I mounted mine in the front left corner temporarily and it worked perfect. Only problem i had was octoprint kept loosing connection to the camera. It would still record but couldnt see it through octoprint
     
  5. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    I also see that OctoPrint UI occasionally drops the camera connection and a refresh solves it. Annoying, but more likely an OctoPrint glitch than anything since the camera is still working behind the scenes.
     
  6. OutsourcedGuru

    OutsourcedGuru Active Member

    Joined:
    Jun 3, 2017
    Messages:
    752
    Likes Received:
    141
    The video feed is supposed to be served up by port 8080 on the Raspi and you'd think that OctoPrint then is just using an HTML iframe or similar to show that content in the main page. It's more likely that it's the server on 8080 that's dropping the connection and that would be mjpg_streamer. If that's the problem then firing up another tab on your browser and visiting your printer's http://name:8080 URL would produce a video which intermittently drops the connection and has to be refreshed.

    Is there an option to drop the video quality? The video frames are both streamed back to the browser and stored on the microSD card so it's entirely possible that it's bumping its head on the ceiling if they only shipped with 4GB cards. When I get my camera, I'll do a "df" before/after streaming to see if we need a 16GB upgrade for that microSD.

    Note that Adafruit has discontinued their Pi NoIR v1 camera for a newer v2 - 8MP version (which of course means that it wants to process, store and stream a much bigger video feed). And so at 1080p30 video ought to be about... 30Mbps would then translate into 8 minutes of streaming per free GB of microSD storage space on the main partition (noting that /var/logs is also on there and competing with that same space).

    It's hard to say how gracefully that mjpg_streamer is behaving as it keeps hitting its head on the ceiling. It might just ungracefully stop everything, delete the stored video file(s) and quietly wait for someone to reconnect to it.

    If it were my code, I'd almost fill the Raspi's microSD with a big temporary file to within a GB of full, start the streaming while holding a stopwatch and expect to lose the connection at around 8 minutes to confirm.

    TL/DR: Wouldn't hurt to update to a 16GB microSD card with these 8MP-resolution cameras.
     
  7. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    Nope if I go directly to the streaming port it is fine and stays.
    OctoPrint UI on the other hands drops it occasionally.
     
  8. OutsourcedGuru

    OutsourcedGuru Active Member

    Joined:
    Jun 3, 2017
    Messages:
    752
    Likes Received:
    141
    Here in these instructions, you'd change this line to drop the video's width/height to something that might run without intermittent drops:

    # start mjpeg streamer
    $MJPEG_STREAMER_HOME/mjpg_streamer -i "$MJPEG_STREAMER_HOME/input_raspicam.so -x 640 -y 480 -fps 15 -ex night" -o "$MJPEG_STREAMER_HOME/output_http.so -w $MJPEG_STREAMER_HOME/www" &
     
    WheresWaldo likes this.
  9. OutsourcedGuru

    OutsourcedGuru Active Member

    Joined:
    Jun 3, 2017
    Messages:
    752
    Likes Received:
    141
    If you wanted to troubleshoot the available-hard-drive-space theory, you could ssh into the Pi and...

    watch --interval=60 df --human-readable /dev/sda1
     
  10. colton81

    colton81 Active Member

    Joined:
    Feb 21, 2017
    Messages:
    328
    Likes Received:
    71
    I put a 16gb sd card into mine and didnt see any difference unless i was supposed to allocate space for something but other then that i didnt see any difference


    Sent from my iPhone using Tapatalk
     
  11. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    OutsourcedGuru likes this.
  12. colton81

    colton81 Active Member

    Joined:
    Feb 21, 2017
    Messages:
    328
    Likes Received:
    71
    Yea i didnt do that i will try that out today


    Sent from my iPhone using Tapatalk
     
  13. OutsourcedGuru

    OutsourcedGuru Active Member

    Joined:
    Jun 3, 2017
    Messages:
    752
    Likes Received:
    141
    Beat me to it. ha

    Anyway, I walked the C code for the streamer and the dude probably ought to wrap a particular function in a try/finally or deal with memory allocation errors, as seen. He just exits-with-error and calls it a day rather than any real fault-tolerant stuff.
     
  14. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    @OutsourcedGuru That is why gstreamer is OSS, you found something that should be changed, so Fork/Clone the repository and change it.
     
    #14 WheresWaldo, Jun 16, 2017
    Last edited: Jun 16, 2017
  15. OutsourcedGuru

    OutsourcedGuru Active Member

    Joined:
    Jun 3, 2017
    Messages:
    752
    Likes Received:
    141
    First things first, I have to sneak off to Fry's (for the camera) and yet keep the girlfriend happy. :laugh:
     
  16. colton81

    colton81 Active Member

    Joined:
    Feb 21, 2017
    Messages:
    328
    Likes Received:
    71
    Good luck lol my fiancé hates how much I spend on this hobby!


    Sent from my iPhone using Tapatalk
     
  17. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    "new parts? What this old thing? Nah, it was always there..."
     
  18. OutsourcedGuru

    OutsourcedGuru Active Member

    Joined:
    Jun 3, 2017
    Messages:
    752
    Likes Received:
    141
    bwoohaha
    IMG_0115.JPG

    I'm thinking I can re-use the unused filament at the end of the last spool in that glue gun. I'm guessing that I can have a little fun with a pause-at-z, drop something into the middle of the part and then "glue" it in place and level the layer with this.
     
  19. OutsourcedGuru

    OutsourcedGuru Active Member

    Joined:
    Jun 3, 2017
    Messages:
    752
    Likes Received:
    141
    And the link to that tutorial.
     

Share This Page