bkbilly / lnxlink

🖥 Effortlessly manage your Linux machine using MQTT.
https://bkbilly.gitbook.io/lnxlink
MIT License
286 stars 31 forks source link

Webcam availability not working for me #137

Open julianlawson opened 1 week ago

julianlawson commented 1 week ago

What type of installation are you running?

Server

Which Linux OS are you using?

Linux Mint 21.3 Cinnamon

Which version of LNXLink has the issue?

2024.11.0

Describe the problem

The "webcam" module seems to have stopped recognising when the camera is turned on. When I turn the webcam on, it webcam sensor stays OFF every update_interval, and the camera_used sends ON rapidly (several times a second). See MQTT messages below. I'm unclear on what the purpose of the two different sensors are; I had previously used only webcam and it seemed to work correctly.

julian@Juba-Mint:~/lnxlink$ mosquitto_sub -v -h HOSTNAME -u USER -P PASSWORD -C 200 -t lnxlink/juba-mint/monitor_controls/# | grep cam Output: lnxlink/juba-mint/monitor_controls/webcam OFF lnxlink/juba-mint/monitor_controls/webcam OFF lnxlink/juba-mint/monitor_controls/webcam OFF lnxlink/juba-mint/monitor_controls/camera_used ON lnxlink/juba-mint/monitor_controls/camera_used ON lnxlink/juba-mint/monitor_controls/camera_used ON lnxlink/juba-mint/monitor_controls/camera_used ON lnxlink/juba-mint/monitor_controls/camera_used ON lnxlink/juba-mint/monitor_controls/camera_used ON lnxlink/juba-mint/monitor_controls/camera_used ON lnxlink/juba-mint/monitor_controls/camera_used ON lnxlink/juba-mint/monitor_controls/camera_used ON lnxlink/juba-mint/monitor_controls/webcam OFF lnxlink/juba-mint/monitor_controls/camera_used ON lnxlink/juba-mint/monitor_controls/camera_used ON lnxlink/juba-mint/monitor_controls/camera_used ON lnxlink/juba-mint/monitor_controls/camera_used ON lnxlink/juba-mint/monitor_controls/camera_used ON lnxlink/juba-mint/monitor_controls/camera_used ON lnxlink/juba-mint/monitor_controls/camera_used ON lnxlink/juba-mint/monitor_controls/camera_used ON lnxlink/juba-mint/monitor_controls/camera_used ON lnxlink/juba-mint/monitor_controls/camera_used ON lnxlink/juba-mint/monitor_controls/webcam OFF lnxlink/juba-mint/monitor_controls/webcam OFF lnxlink/juba-mint/monitor_controls/camera_used ON lnxlink/juba-mint/monitor_controls/webcam OFF lnxlink/juba-mint/monitor_controls/active_window Webcamoid, The ultimate webcam suite! — Mozilla Firefox lnxlink/juba-mint/monitor_controls/webcam OFF `

Additional context

No response

Configuration

mqtt:
  prefix: lnxlink
  clientId: Juba-Mint
  server: !private
  port: 1883
  auth:
    user: !private
    pass: !private
    tls: false
    keyfile: ''
    certfile: ''
    ca_certs: ''
  discovery:
    enabled: true
  lwt:
    enabled: true
    qos: 1
    retain: false
update_interval: 5
hass_url: null
hass_api: null
modules: null
custom_modules: null
exclude:
- battery
- boot_select
- brightness
- fullscreen
- docker
- ir_remote
- bluetooth
- gamepad
- gpio
- inference_time
- keep_alive
- keyboard_hotkeys
- network
- power_profile
- screenshot
- send_keys
- speech_recognition
- steam
- xdg_open
settings:
  hotkeys: null
  disk_usage:
    include_disks:
    - /dev/sdd2
    - /dev/sda3
    - /dev/nvme0n1p2
    exclude_disks: []
  statistics: https://analyzer.bkbilly.workers.dev
  bash:
    expose:
    - name: Mute Sound
      type: button
      command: amixer -q -D pulse sset Master mute
      icon: mdi-volume-mute
    - name: Unmute Sound
      type: button
      command: amixer -q -D pulse sset Master unmute
      icon: mdi-volume-unmute
    - name: Screen Lock status
      type: sensor
      command: cinnamon-screensaver-command -q | head -n 1 | sed 's/The screensaver
        is //'
    allow_any_command: false
  mounts:
    autocheck: false
    directories: []
  restful:
    port: 8112
  systemd: null
  gpio:
    inputs: null
    outputs: null
  ir_remote:
    receiver: null
    transmitter: null
    buttons: []
update_on_change: false

Logs

Nov 23 16:16:10 Juba-Mint systemd[2554]: Started LNXlink.
Nov 23 16:16:10 Juba-Mint lnxlink[3307336]: INFO:lnxlink:Added missing configuration option: settings.systemd
Nov 23 16:16:10 Juba-Mint lnxlink[3307336]: INFO:lnxlink:Added missing configuration option: settings.gpio
Nov 23 16:16:10 Juba-Mint lnxlink[3307336]: INFO:lnxlink:Added missing configuration option: settings.ir_remote
Nov 23 16:16:10 Juba-Mint lnxlink[3307336]: INFO:lnxlink:LNXlink 2024.11.0, Python 3.10.12
Nov 23 16:16:10 Juba-Mint lnxlink[3307336]: INFO:waitress:Serving on http://0.0.0.0:8112
Nov 23 16:16:10 Juba-Mint lnxlink[3307336]: INFO:lnxlink:No systemd settings found on configuration.
Nov 23 16:16:10 Juba-Mint lnxlink[3307336]: INFO:lnxlink:Loaded addons: active_window, audio_select, bash, camera_used, cpu, disk_io, disk_usage, display_env, gpu, idle, interfaces, media, memory, microphone_used, mounts, notify, required_restart, restart, restful, screen_onoff, shutdown, speaker_used, statistics, suspend, sys_updates, systemd, temperature, update, webcam, wifi
Nov 23 16:16:10 Juba-Mint lnxlink[3307336]: INFO:lnxlink:MQTT connection: Success
Nov 23 16:16:10 Juba-Mint lnxlink[3307336]: INFO:lnxlink:MQTT Media Player configuration name: lnxlink/Juba-Mint_media_player
Nov 23 16:31:14 Juba-Mint lnxlink[3307336]: INFO:lnxlink:Sending statistics data: {"uuid": "84d16bb75f014e22ba5294e5fdf9bc68", "version": "2024.11.0"}
bkbilly commented 12 hours ago

The command to find if the camera is used is fuser /dev/video* and checks the exit code. Could you check the output of the following command when the camera is used and when it is not?

fuser /dev/video*; echo $?
julianlawson commented 10 hours ago

Hi Vasilis, thanks for coming back to me.

The output from fuser seems to be correct, see below, though I still get OFF on topic .../monitorcontrols/webcam

Let me know if there's anything else I can do to help diagnose.

=====

@.:~$ fuser /dev/video; echo $? # before starting webcam 1 **@.:~$ fuser /dev/video; echo $? # after starting webcam /dev/video0: 3052m 0 **@.**:~$ fuser /dev/video; echo $? # after shutting down webcam

On Sun, 1 Dec 2024 at 10:32, Vasilis Koulis @.***> wrote:

The command to find if the camera is used is fuser /dev/video* and checks the exit code. Could you check the output of the following command when the camera is used and when it is not?

fuser /dev/video*; echo $?

— Reply to this email directly, view it on GitHub https://github.com/bkbilly/lnxlink/issues/137#issuecomment-2509677735, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP4Y7BASTCNOOXU7C5JLFP32DLQSDAVCNFSM6AAAAABSLH7GCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMBZGY3TONZTGU . You are receiving this because you authored the thread.Message ID: @.***>

bkbilly commented 10 hours ago

I think I misread your issue...

There are 2 different modules you are talking about.

  1. The camera_used module is sending if the camera is used or not by any application.
  2. The webcam module is part of 2 sensors that are created. The switch entity Webcam and the camera entity Webcam feed. When the switch is active, it starts sending the live image to the camera antity.

I hope this clears things up. Let me know if you have any issue with any of the modules I mentioned above.