Ultimaker Buildplate Camera: verschil tussen versies

Uit MakerSpace Leiden
Ga naar: navigatie, zoeken
(Setup)
k (MarkKlaauw heeft de pagina UltimakerBuildplateCamera hernoemd naar Ultimaker Buildplate Camera zonder een doorverwijzing achter te laten)
 
(7 tussenliggende versies door 2 gebruikers niet weergegeven)
Regel 1: Regel 1:
 +
[[Category:Nodes & network devices]]
 
= Use =
 
= Use =
  
Login to the CRM (https://makerspaceleiden.nl/crm) and select the 3rd menu option.
+
Login in [https://mijn.makerspaceleiden.nl mijn.makerspaceleiden.nl] and in the navigation menu select Live 3D printer camera.
  
 
[[Bestand:Buildplate1.png]]
 
[[Bestand:Buildplate1.png]]
Regel 16: Regel 17:
 
    
 
    
 
   [Service]
 
   [Service]
   ExecStart=/usr/bin/ssh -i /etc/ultimaker-tunnel -l tunnel -p 222 -T -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -L 127.0.0.1:9998:CAMERAIP:8080 volmolengracht -
+
   ExecStart=/usr/bin/ssh -N -i /etc/ultimaker-tunnel -l tunnel -p 222 -T -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -L 127.0.0.1:9998:CAMERAIP:8080 volmolengracht -
 
   RestartSec=30
 
   RestartSec=30
 
   Restart=always
 
   Restart=always
Regel 29: Regel 30:
 
And a 'permit' line for this has been added to the .ssh/authorized keys file on the space-side:
 
And a 'permit' line for this has been added to the .ssh/authorized keys file on the space-side:
  
      no-pty,permitopen="192.168.6.12:8080",command="/bin/sh"  ssh-rsa AAAA....=  
+
    no-pty,permitopen="192.168.6.12:8080",command="/bin/true"  ssh-rsa AAAA....=  
 +
 
 +
With the 'ssh-rsa AAA...' taken from /etc/ultimaker-tunnel.pub.
 +
 
 +
Note that this has to be done in the admin interface; under users (not in ~/.ssh; that file is automatically overwritten) - and need to be given 'tunnel' permissions.
  
 
At this port on the Ultimaker; there is a webcam module that accepts two rest calls (AFAIK): '''?action=stream''' en '''?action=snapshot'''. We take the latter to not overload things (and not having to deal with async streaming, etc).
 
At this port on the Ultimaker; there is a webcam module that accepts two rest calls (AFAIK): '''?action=stream''' en '''?action=snapshot'''. We take the latter to not overload things (and not having to deal with async streaming, etc).
  
The connection is then reverse proxied by the ultimaker module in our CRM https://github.com/MakerSpaceLeiden/makerspaceleiden-crm. The key config is in views.py:
+
The connection is then reverse proxied by the ultimaker module in [https://mijn.makerspaceleiden.nl mijn.makerspaceleiden.nl] (https://github.com/MakerSpaceLeiden/makerspaceleiden-crm). The key config is in views.py:
  
 
     def snapshot(request):
 
     def snapshot(request):

Huidige versie van 29 jul 2024 om 20:25

Use

Login in mijn.makerspaceleiden.nl and in the navigation menu select Live 3D printer camera.

Buildplate1.png

Buildplate2.png

Setup

The ultimaker buildplate camera relies on a SSH tunnel provided by the service:

  [Unit]
  Description=Tunnel for the ultimaker camera
  After=network.target
  
  [Service]
  ExecStart=/usr/bin/ssh -N -i /etc/ultimaker-tunnel -l tunnel -p 222 -T -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -L 127.0.0.1:9998:CAMERAIP:8080 volmolengracht -
  RestartSec=30
  Restart=always
  
  [Install]
  WantedBy=multi-user.target

The key has been created with:

   ssh-keygen -f  /etc/ultimaker-tunnel 

And a 'permit' line for this has been added to the .ssh/authorized keys file on the space-side:

   no-pty,permitopen="192.168.6.12:8080",command="/bin/true"  ssh-rsa AAAA....= 

With the 'ssh-rsa AAA...' taken from /etc/ultimaker-tunnel.pub.

Note that this has to be done in the admin interface; under users (not in ~/.ssh; that file is automatically overwritten) - and need to be given 'tunnel' permissions.

At this port on the Ultimaker; there is a webcam module that accepts two rest calls (AFAIK): ?action=stream en ?action=snapshot. We take the latter to not overload things (and not having to deal with async streaming, etc).

The connection is then reverse proxied by the ultimaker module in mijn.makerspaceleiden.nl (https://github.com/MakerSpaceLeiden/makerspaceleiden-crm). The key config is in views.py:

   def snapshot(request):
      img = requests.get("http://127.0.0.1:9998/?action=snapshot").content
      return HttpResponse(img, content_type="image/jpeg")

With the updating done by a few lines of javascript - see https://github.com/MakerSpaceLeiden/makerspaceleiden-crm -> ultimaker/templates and then index.html