Hello
i have a project that includes pelco d ptz camera tracking.
i have the pelco d protocol, for example:
FF 01 00 04 3F 00 44 - will pan left at ghigh speed.
how do i "transfer" this commandto the camera in python ?
in linux, it is done by "echo"...
thanks
If you can echo it to the camera, then you can probably just use print()
, right?
hello
im tring to send an hex command to a ptz camera that uses the Pelco D protocol, and connected via rs485 to usb convertor.
this is my code, i don't get any error messages - but it just doesn't pan/tilt the camera. i checked to see if the ptz is working with other software, and it does.
import serial
import serial.rs485
#import struct
#import us
ser = serial.Serial('com4', 9600)
ser.rs485_mode = serial.rs485.RS485Settings(rts_level_for_tx=True, rts_level_for_rx=False, loopback=False, delay_before_tx=None, delay_before_rx=None)
print(ser.isOpen())
thestring = bytearray.fromhex('FF 01 00 04 3F 00 44')
print(thestring)
ser.write(thestring)
#s = ser.read(1)
#print(s)
ser.close()
You mentioned it works with echo
. Please show exactly what's working, as you shouldn't need to use a serial connection at all if you're just echoing text to stdout.
dear nilamo,
i read online that this is how it suppose to eork (regeading echo), i don't have a linux machine.
after doing alot of rading in the internet, i still don't understand what is wrong with the code...