tinypilot nvr integration
- @david
dear group,
i bought tinypilot pro, in order to control my two nvrs in server room( ground floor) from my office ( first floor ) via our local lan .
i bought all hardware mentioned in the video
as of now i cannot use mouse movements on my pto control the nvr at all… pls help me i am clewless how to get it done
yours
jef
- Michael Lynch @michael2021-07-09 20:26:43.572Z
Hi Jef, sorry you're running into these issues.
Can you try removing the AIMOS KVM from your setup and seeing if it works when you connect TinyPilot directly to one of your NVR systems?
- Jjef097 @jef097
hi michael,
first thanks for your reply , i bought all the tested components to avoid compatibility issue .
in your advise , u need me to connect tinypilot directly to nvr without event the hdmi repeater ? i will do that tomorrow and update you.
mean while the issue is the setup cannot translate mouse movement to nvr, keyboard is ok. will keep you posted tomorrow.
- Michael Lynch @michael2021-07-09 21:52:27.884Z
The AIMOS KVM works, but it's not an officially supported component. If we're trying to track down why the mouse isn't passing through, it'll be easier if we cut out the third-party components to see if it's an AIMOS problem or a TinyPilot problem.
- Jjef097 @jef097
hi michael
its not translating mouse movement, although mouse right click , scroll is taken on the old mouse location in the nvr. so i think their is a bug moving or translating the mouse movement from web interface to nvr side .
note that nvr i use is dahua and mouse translation is important to operate nvr small screen that represent camera channel.
appreciate your support
regards
jafar- Michael Lynch @michael2021-07-12 19:07:14.162Z
Hi Jef, sorry to hear you're still seeing issues. Can you share your logs from System > Logs in the web dashboard?
- Jjef097 @jef097
- Michael Lynch @michael2021-07-20 20:59:20.610Z
Unfortunately, there isn't anything helpful in the logs. The logs show no mouse errors, so the TinyPilot device thinks that it's sending mouse movement successfully.
Sadly, there's nothing else I can think of to diagnose this issue.
If this prevents you from using TinyPilot for your environment, I can take a return for a full refund if you send an email to returns@tinypilotkvm.com.
- In reply tomichael⬆:Jjef097 @jef097
also i tried usb2.0 and usb3.0 ports on the nvr to translate mouse movments , both didnt work .
- BIn reply tojef097⬆:Brian Walters @BrianW
Hi,
I have this same problem. I purchased the TinyPilot to view the head output of my Lorex NVR. Video works, mouse clicks and scroll wheel work, but mouse motion is not working. Is there any progress on this or other thoughts? The logs were not helpful, no real indication in them about any issues.
- David @david2024-05-27 11:41:27.254Z
Hi @BrianW, I'm sorry you're running into this mouse issue with your NVR.
Thanks for sharing those logs! It doesn't look like your TinyPilot reported any USB input errors, so it sounds like your TinyPilot's mouse is sending input as intended.
If your mouse isn't moving on your NVR, and there are no TinyPilot errors, that suggests your NVR doesn't support TinyPilot's mouse movement input. It's possible that this is due to the mouse mode that TinyPilot uses. We have an open GitHub issue to look at supporting a relative mouse mode, which I think would resolve this problem. I've added a note to the issue suggesting that developing support for relative mouse mode will help with compatibility with devices like your NVR.
Supporting relative mouse positioning is not part of our short-term roadmap yet, but we’re always working to improve TinyPilot’s software and hardware. We prioritize features based on user demand, so we’ll definitely consider your feedback in our planning.
I've reached out to our customer support team to help out with this.
I hope that helps! Please let me know if you have any questions.
- BBrian Walters @BrianW
Hi David,
Thanks for the quick reply. Here is some abbreviated and summarized output from my recent troubleshooting with ChatGPT. Take a look and let me know what you think. It does seem to lead to the same conclusion about supporting relative mouse positioning.
I did disable keyboard as the NVR does not accept keyboard input. To do this I did the following:
- added the following line in /home/tinypilot/settings.yml
usb_keyboard_enabled: false - Commented out the following line in /home/tinypilot/app_settings.cfg
# KEYBOARD_PATH = '/dev/hidg0'
output from ChatGPT session:
Stage:
I told ChatGPT about the problem, that it is a python app capturing input from a web client and proxying to /dev/hidg1.
ChatGTP:
Testing the NVR by writing directly to /dev/hidg1. Try running the following script and observe the response on the NVR screen. Save as move_mouse.py and run as:
sudo python3 move_mouse.py
import struct import time # Function to write HID report to /dev/hidg1 def move_mouse_left(total_distance): # Each step will be -127 to stay within the byte range step = -127 remaining_distance = total_distance with open('/dev/hidg1', 'wb') as f: while remaining_distance < 0: x_movement = max(step, remaining_distance) y_movement = 0 # No movement on Y-axis buttons = 0 # No buttons pressed wheel = 0 # No wheel movement # Construct HID report: 1-byte button, 1-byte x movement, 1-byte y movement, 1-byte wheel report = struct.pack('bbbb', buttons, x_movement, y_movement, wheel) f.write(report) remaining_distance -= x_movement # Optional sleep to simulate real mouse movement time.sleep(0.01) # Move mouse left by -1600 pixels (in chunks of -127) move_mouse_left(-1600)
Results:
it's not working the mouse pointer is not moving on the screen.
ChatGPT:
Try this one
import struct import time # Function to write HID report to /dev/hidg1 def move_mouse_left(total_distance): # Each step will be -127 to stay within the byte range step = -127 remaining_distance = total_distance with open('/dev/hidg1', 'wb') as f: while remaining_distance < 0: x_movement = max(step, remaining_distance) y_movement = 0 # No movement on Y-axis buttons = 0 # No buttons pressed wheel = 0 # No wheel movement # Construct HID report: 1-byte button, 1-byte x movement, 1-byte y movement, 1-byte wheel report = struct.pack('bbbb', buttons, x_movement, y_movement, wheel) # Debugging output print(f"Sending report: {report}") f.write(report) remaining_distance -= x_movement # Optional sleep to simulate real mouse movement time.sleep(0.01) # Move mouse left by -1600 pixels (in chunks of -127) move_mouse_left(-1600)
Results:
Still not working. Can we test sending a right mouse click?
ChatGPT:
Sure, try this one
import struct import time # Function to write HID report to /dev/hidg1 def send_right_click(): with open('/dev/hidg1', 'wb') as f: # Construct HID report: 1-byte button, 1-byte x movement, 1-byte y movement, 1-byte wheel # Button byte: 0x02 (right button pressed), x movement: 0, y movement: 0, wheel: 0 right_click_down = struct.pack('bbbb', 0x02, 0x00, 0x00, 0x00) right_click_up = struct.pack('bbbb', 0x00, 0x00, 0x00, 0x00) # Send right button down f.write(right_click_down) print("Right button down") # Short delay to simulate a click time.sleep(0.1) # Send right button up f.write(right_click_up) print("Right button up") # Send a right mouse click send_right_click()
Results:
so the right click did not show up on the screen. However, when I went to the web interface and did a physical right click the menu popped up in the top left corner. Though the mouse courser was still displayed in the center of the screen. This is after all the test runs of move_mouse.py
ChatGPT:
It sounds like there might be an issue with how the mouse movements and clicks are being interpreted by the NVR. Given that the right click registers in the top left corner while the cursor remains in the center, there might be an issue with the relative/absolute positioning or how the mouse coordinates are being sent.
- David @david2024-05-28 11:10:29.310Z
Thanks for sharing all of that, @BrianW!
I'm pretty confident this is a compatibility issue with TinyPilot and your NVR (specifically how the devices send/interpret mouse input). I've noticed that a number of NVR devices have had similar issues in the past (including the one from earlier in this thread), though I'm not sure whether this is the case with all NVR systems.
Beyond developing a relative mouse mode for TinyPilot, I don't think there's anything we can do here to get TinyPilot working with your NVR, unfortunately.
Our customer support team have reached out to you via email to help with this. If you haven't already, could you find and reply to that email in your inbox?
I hope that helps! Please let me know if you have any questions.
- added the following line in /home/tinypilot/settings.yml