I've been working on a project involving the MQTT Hikvision library available at GitHub. The goal is to use the relay.py script to interact with a HIKVISION ISAPI endpoint. However, I'm encountering two specific issues:
Empty Data Issue: When running the relay.py script, it seems to be sending empty data (consisting of 'fffffffffff...') to the HIKVISION ISAPI endpoint. This behavior is unexpected, and I'm trying to figure out why this is happening.
Function Not Calling Issue: Inside the relay.py file, there's a line player.on_wave = lambda wave: audio.play(utils.wave_to_ulaw(wave)). Unfortunately, this line doesn't seem to be functioning as expected. The audio.play and utils.wave_to_ulaw functions are not being called, and I'm not seeing any output in the terminal despite adding print statements.
Here's a snippet of the relevant part of the relay.py script for reference:
# relay.py
import bus, hiksound, utils
import config
import time
# ... (configuration setup)
player = bus.Player("play", cfg)
# Issue here: This line doesn't seem to call the function as expected
player.on_wave = lambda wave: audio.play(utils.wave_to_ulaw(wave))
# ... (rest of the script)
I've thoroughly checked my dependencies, verified that the script is running, and even added print statements inside audio.play and utils.wave_to_ulaw, but nothing is showing up in the terminal.
Can anyone help me understand why I'm encountering these issues with the MQTT Hikvision project? Any insights, suggestions, or debugging tips would be greatly appreciated.
Thank you!