j.l9883
ERROR LOG:
launch.service: Failed with result 'exit-code'.
launch.service: Scheduled restart job, restart counter is at 4.
Stopped launch.service - Launch script on Raspberry Pi boot.
Started launch.service - Launch script on Raspberry Pi boot.
6]: Traceback (most recent call last):
6]: File "/home/lr-receiver-1/Documents/localreach-pi/slave_pi_streaming/Laun>
6]: import obsws_python as obs
6]: ModuleNotFoundError: No module named 'obsws_python'
launch.service: Main process exited, code=exited, status=1/FAILURE
Launch.service
[Unit]
Description=Launch script on Raspberry Pi boot
After=multi-user.target
[Service]
Type=simple
WorkingDirectory=/home/lr-receiver-1/Documents/localreach-pi
Environment=/home/lr-receiver-1/.pyenv/versions/3.9.19/lib/python3.9/site-packa>
ExecStart=/usr/bin/python3 /home/lr-receiver-1/Documents/localreach-pi/slave_pi>
Restart=on-failure
[Install]
WantedBy=multi-user.target
Lauch.py
import obsws_python as obs
import time
import subprocess
import os
# Define connection details (update as needed)
os.chdir("C:\\Program Files\\obs-studio\\bin\\64bit")
subprocess.Popen(["C:\\Program Files\\obs-studio\\bin\\64bit\\obs64.exe"])
time.sleep(5)
host = 'localhost'
port = 4455
password = '5UsvT80aANE10yuL'
timeout = 3
# Create a request client
client = obs.ReqClient(host=host, port=port, password=password, timeout=timeout)
# Open a fullscreen projector for a specific scene
printname=client.send("GetCurrentProgramScene",raw=True)
scene_name = printname["sceneName"] # Replace with your scene name
monitor_index = 1 # Monitor index, 0 for primary monitor, 1 for secondary, etc.
# Send request to open fullscreen projector
response = client.send('OpenVideoMixProjector', {
'videoMixType': "OBS_WEBSOCKET_VIDEO_MIX_TYPE_PREVIEW",
'monitorIndex': monitor_index
})
time.sleep(3)
print(f"Fullscreen projector opened for scene '{scene_name}' on monitor {monitor_index}.")
print(printname)