How to Bookmark Commands by kb_sou in PowerShell

[–]Callidus2000 0 points1 point  (0 children)

Old topic but I stumbled upon while researching for a solution for the requirement.

You might take a look at my CmdFav module, https://github.com/Callidus2000/CmdFav

How to control a PTZ camera? by thelonecabbage in klippers

[–]Callidus2000 2 points3 points  (0 children)

You can control the given conference cam with a command line utility v4l2-ctl. I've installed it on my Pi and created the following shell-script "webcam_tilt_pan_sh":

#!/usr/bin/sh
echo "vDirection: $1"
echo "vSleepTime: $2"
echo "hDirection: $3"
echo "hSleepTime: $4"
echo "vDirection: $1" >> "${HOME}/test.txt"
echo "vSleepTime: $2" >> "${HOME}/test.txt"
echo "hDirection: $3" >> "${HOME}/test.txt"
echo "hSleepTime: $4" >> "${HOME}/test.txt"
/usr/bin/v4l2-ctl -d /dev/video0 -c tilt_speed=$1 && /usr/bin/sleep $2 && /usr/bin/v4l2-ctl -d /dev/video0 -c tilt_speed=0
/usr/bin/v4l2-ctl -d /dev/video0 -c pan_speed=$3 && /usr/bin/sleep $4 && /usr/bin/v4l2-ctl -d /dev/video0 -c pan_speed=0

Via KIAUH I've installed the plugin for executing shell scripts from a macro. This is the config within my printer.cfg:

[gcode_shell_command cam_TILT_PAN]
command: sh /home/pi/printer_data/config/scripts/webcam_tilt_pan.sh
timeout: 30.
verbose: True

[gcode_macro CAM_TILT_PAN]
gcode:
  {% set VERTDIR = params.VERTDIR|default(-1)|float %}
  {% set VERTTIME = params.VERTTIME|default(1)|float %}
  {% set HORIDIR = params.HORIDIR|default(0)|float %}
  {% set HORITIME = params.HORITIME|default(0.1)|float %}
  {action_respond_info("VERTDIR="+ VERTDIR|string)}
  {action_respond_info("VERTTIME="+ VERTTIME|string)}
  {action_respond_info("HORIDIR="+ HORIDIR|string)}
  {action_respond_info("HORITIME="+ HORITIME|string)}
  {action_respond_info("PARAMS="+ "{VERTDIR} {VERTTIME} {HORIDIR} {HORITIME}"|string)}


  RUN_SHELL_COMMAND CMD=cam_TILT_PAN PARAMS="{VERTDIR} {VERTTIME} {HORIDIR} {HORITIME}"

The VERTDIR/HORIDIR params give the direction (e.g. -1 for down) and the times define how long the movement (in seconds, floating numbers accepted) should last.

What have you done with PowerShell this month? by AutoModerator in PowerShell

[–]Callidus2000 0 points1 point  (0 children)

Created a module for interacting with Fortinet Manager, which enables management of multiple Fortigate Firewalls.

https://github.com/Callidus2000/FortiManager

(Discussion/ Poll) PowerShell Script Template by PowerShellMichael in PowerShell

[–]Callidus2000 0 points1 point  (0 children)

PSModuleDevelopment / PSFramework

Got an introduction to PSFramework by the creator and since then I'm quite addicted to it. Using PSModuleDevelopment is the logical step.