WebIOPi ファイルの自作
設定ファイル
/etc/webiopi/config が、設定ファイルで、この中で、
1 読み込ませるスクリプトファイルの指定 2 WEBサーバーとしてのルートの指定 3 "Welcome" file の指定
を行う。
SCRIPTS
[SCRIPTS] # Load custom scripts syntax : # name = sourcefile # each sourcefile may have setup, loop and destroy functions and macros #myscript = /home/pi/webiopi/examples/scripts/macros/script.py
とある。
name = 、、、と指定できるので、name.関数名と呼び出せる?
HTTP
[HTTP] # HTTP Server configuration enabled = true port = 8000 # File containing sha256(base64("user:password")) # Use webiopi-passwd command to generate it #passwd-file = /etc/webiopi/passwd # Change login prompt message prompt = "WebIOPi" # Use doc-root to change default HTML and resource files location #doc-root = /home/pi/webiopi/examples/scripts/macros # Use welcome-file to change the default "Welcome" file #welcome-file = index.html
ポートの指定、パスワードの指定、ドキュメントルートの指定、welcome-fileの指定ができる。
他はこれから勉強する。