このブログを検索

2023/01/05

motionでカメラを二つ使う

 motion4.3.2

root@raspberrypi:/etc/motion# cat /etc/os-release

PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"

(略)


よくわからなかったのでメモ。


motion.confの下の方に、以下のような設定があり、コメントアウトされている。


##############################################################

# Camera config files - One for each camera.

##############################################################

; camera /usr/etc/motion/camera1.conf

; camera /usr/etc/motion/camera2.conf

; camera /usr/etc/motion/camera3.conf

; camera /usr/etc/motion/camera4.conf


カメラを2台使うなら、最初の2行をコメントアウトして、設定ファイルを置けばよい。

camera~ のところは、以前は thread~ だったが、変わったようだ。


設定ファイルに記載するのは、2台のカメラ固有の設定のみでよい。
それ以外の設定は motion.confの内容が使われるようだ。


以下、サンプル。

設定ファイルの場所と名前は変えた。

camera0がraspiカメラで、camera1が外付けのUSBカメラ。
筐体を横にしたので、camera0だけ rotate 270を設定した。

##############################################################

# Camera config files - One for each camera.

##############################################################

camera /etc/motion/camera0.conf

camera /etc/motion/camera1.conf

; camera /usr/etc/motion/camera3.conf

; camera /usr/etc/motion/camera4.conf


#camera0.conf

# Video device (e.g. /dev/video0) to be used for capturing.
videodevice /dev/video0

# Image width in pixels.
width 800

# Image height in pixels.
height 600

# Maximum number of frames to be captured per second.
framerate 5

# Text to be overlayed in the lower left corner of images
text_left CAMERA0

# Text to be overlayed in the lower right corner of images.
text_right %Y-%m-%d\n%T-%q

norm 1

rotate 270


#camera1.conf

# Video device (e.g. /dev/video0) to be used for capturing.
videodevice /dev/video1

# Image width in pixels.
width 800

# Image height in pixels.
height 600

# Maximum number of frames to be captured per second.
framerate 5

# Text to be overlayed in the lower left corner of images
text_left CAMERA1

# Text to be overlayed in the lower right corner of images.
text_right %Y-%m-%d\n%T-%q

norm 1


本家のヘルプページ

2022/12/21

net-snmpとTWSNMP

 Net-SNMP

SNMPでなんかやるときはいつも TWSNMPというソフトを使っていたが

GUIがイマイチで更新もされておらずなんだかなあと思っていたが

Net-SNMPというのを見つけた。


職場で一度使ったことがあるがコマンドベースで使いやすかったので

メモしておく。


サイトにアクセスするとdownloadのページがある。

昔はwindows用インストーラがあったような覚えがあるが、今は「source」しかない。


下記リンクにあった。

net-snmp - Browse /net-snmp binaries/5.7-binaries at SourceForge.net


net-snmp-5.7.0-1.x86.exe

が、2011-08-09 と、ずいぶん古い。

インストールしようとしたら32ビットだった。


x64があったがさらに古い。

net-snmp - Browse /net-snmp binaries/5.5-binaries at SourceForge.net

2009-09-29


まあいっか。

インストール。

デフォルトでは

c:\usr

という変なディレクトリにインストールされる。

まあいっか。

「PATHが1024文字以上あった読めないから自分でPATHを追加しろ」

というメッセージが出た。

そんなに長いPATHになっているのか。

わかったよ。


c:\user\bin

をPATHに追加。

c:/usr/etc/snmp/snmp.conf

が設定ファイル。


なんか設定したおぼえがあるが、

中身を見ると特に設定が必要なさそうなので

とりあえず動かしてみる。

snmpwalk -v 2c -c public 172.16.xx.xx

最後のIPアドレスは家にあるcatalystのアドレス。

snmp-serverの設定はいれてある。


やっぱり特に何も設定しなくても動いた。


ホスト名を取ってみる。

C:\>snmpget -v 2c -c public 172.16.xx.xx SNMPv2-MIB::sysName.0

SNMPv2-MIB::sysName.0 = STRING: hogehoge


TWSNMPはFCとかいう、新しいバージョンができていてWindowsストアからインストールできた。

起動してブラウザでアクセスする。


2022/12/03

ネットワークエンジニア7つ道具(2022年12月)

マスク

ボールペン

鉛筆

消しゴム

鉛筆削り

赤鉛筆

LANケーブル

コンソールケーブル

USBシリアル変換アダプタ

充電器

ライトニングケーブル

iPhone

Paypay

ウェットティッシュ

サクラエディタ

折り畳み傘


2022/05/17

DKIM

先日SPF対応をした。 
機能はしているのだが、それを使って止めたいメールを止めることができていない。

SPFでは不十分だというのでDKIMも入れた。

dnf(yum) install opendkim

でいいと、どのページにも書いてあるのだが

opendkim-genkey がない、と言われる。

検索するとロシア語のページに opendkim-tools も入れる、とあった。

噓つき!

dnsレコードを書いて、postfixの設定も入れて、
とりあえず動いた。


2022/05/14

redhatのsubscriptionが更新できないのはサーバの時刻が正しくないからだった

 

[root@peter ~]# subscription-manager register
Registering to: subscription.rhsm.redhat.com:443/subscription
Username: hogehoge
Password:
Unable to verify server's identity: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:897)
[root@peter ~]# date
Thu Aug 12 07:23:06 JST 2027
[root@peter ~]#
[root@peter ~]#
[root@peter ~]#
[root@peter ~]# date --set="14 MAY 2022 04:06:00"
Sat May 14 04:06:00 JST 2022
[root@peter ~]#
[root@peter ~]#
[root@peter ~]#
[root@peter ~]#
[root@peter ~]#
[root@peter ~]#
[root@peter ~]#
[root@peter ~]# subscription-manager register
Registering to: subscription.rhsm.redhat.com:443/subscription
Username: hogehoge
Password:
The system has been registered with ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
The registered system name is: peter.monqy.net

2022/05/07

ネットワークエンジニア七つ道具 2022年版

iPhone
モバイルバッテリー 
ライトニングケーブル
USB-Cケーブル
USBミニケーブル
ASAHIネットの固定IP
OpenVPN
PaloAlto
Fortigate
CiscoASA
anyconnect
ESXi
万年筆
ボールペン(黒)
ボールペン(赤)
鉛筆
消しゴム
シャーペン
シャーペンの芯
ノート
サクラエディタ
ウェットティッシュ
ハンカチ
チリ紙
輪ゴム
ホチキス
ちいさいハサミ
マスク
Suica
100円玉
1000円札
Paypay