- Raspberry Pi ImagerによるRaspberry Pi OSの標準インストールにて、
pi
ユーザーでGUIに自動ログインになる状態を想定。 - Raspberry Pi OS(32bit/64bit) 2023-10-10 Released のGUIはLXDEなので、GUI起動後のアプリ起動はLXDEの作法となる点。
- LXDEの標準ディスプレイマネージャーLXDMのRaspberry Pi OSでの個人設定ファイルは、
~/.config/lxsession/LXDE-pi/autostart
xset s off
でスクリーンセーバーOFFxset s noblank
で黒画面OFFxset -dpms
でDPMSによるディスプレイ側の消灯機能を動かなくする
- GUI上での再生はVLCを使う。VLCはRaspberry Pi OSの標準インストールに含まれる。RaspberryPi Zeroだとパワー不足、Raspberry Pi Zero 2 Wだと再生可能(但しティアリングが発生する)。
VLC
のCLIバージョンのcvlc
を使う。- コンソールから
cvlc
でGUIに表示させる場合、オプションに--vout=mmal_xsplitter
を使う。ネット情報で--vout=drm_vout
と書かれているものもあったが、うまく動かなかった。 --loop
でループ再生。
- コンソールから
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Delayを使わないArduino時計 | |
Arduinoにはシステム時刻があって、RTCを持たないArduinoでは | |
起動時必ず1970/01/01T00:00:00Z(UNIX epoch)に初期化されています | |
Arduinoのコンパイラでは__DATE__定数と__TIME__定数が使えますので、 | |
コンパイル時に埋め込まれるこれらの定数を利用してシステム時刻を | |
設定します。 | |
当然ながら、コンパイル時にコンパイラがあるシステムの時刻が定数 | |
として埋め込まれますので、コンパイル直後以外のArduinoリセット時 | |
には時刻が狂うことになります。 | |
DS1307RTCのライブラリを参考にした。 |
- AWSでEC2のインスタンスを借りる
- 今回は東京リージョンのCentOS 6.3 x86_64 Release MediaのAIM(ami-3fe8603e)でインスタンスを建てる
- Security Group: L2TP/IPsec(Inbound 22/TCP: SSH, 500/UDP: ISAKMP, 1701/UDP: L2TP, 4500/UDP: IPSec NAT Traversal)を許可
- ec2-54-249-173-214.ap-northeast-1.compute.amazonaws.com(グローバルIPアドレス:
54.249.173.214
)にrootでログイン
[root@ip-10-132-164-105 ~]# setenforce 0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use CGI; | |
use File::Spec; | |
use FindBin; # mod_perl環境じゃない場合 | |
#use FindBin::Real; # mod_perlなど | |
use HTML::Template; | |
use Time::Piece; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Dim fName | |
fName = "%fName%" | |
Dim myWorkBook | |
Set myWorkBook = GetObject(fName) | |
Dim xlApp | |
Set xlApp = myWorkBook.Application | |
Dim fName2 | |
fName2 = "%fName2%" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> | |
#define OE 7 | |
#define DYNA 8 | |
#define DYNB 9 | |
#define DATA 11 | |
#define LATCH 10 | |
#define CLK 13 | |
char pattern[] = { |
Raspberry Pi 3 B+ を NOOBS 1.92からセットアップ直後からスタートする。
利用するGPS製品ははこれ
GPS受信機キット 1PPS出力付き 「みちびき」対応: センサ一般 秋月電子通商 電子部品 ネット通販
Vcc
GND
Txd
Rxd
と 1pps出力の5線あるうち1pps出力以外の4線を利用する。
Vcc に 5V、TxdとRxdは3.3VでOK
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# カレントディレクトリのScreenShot hoge.png を hoge.pngにリネーム | |
# bashでリネーム 変数 $FILE は ${FILE}とも書ける | |
# ${FILE##ScreenShot }とすると文頭から最長マッチでその文字列を除去した文字列を値として持つ | |
for FILE in *; do mv "${FILE}" "${FILE##ScreenShot }"; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# Timezoneの設定(GUI使わずコマンドにて) | |
sudo raspi-config nonint do_change_timezone Asia/Tokyo | |
# Raspberry PiのSPIを有効にする(GUI使わずコマンドにて) | |
sudo raspi-config nonint do_spi 0 | |
# 再起動 | |
sudo reboot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
#https://codeday.me/jp/qa/20190304/361513.html | |
import signal, sys | |
import evdev | |
from evdev import InputDevice, ecodes, list_devices, categorize | |
# キースキャンコードとキャラクターの対応リスト | |
scancodes = { |
NewerOlder