Python Forum
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pelco D protocol
#1
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
Reply
#2
If you can echo it to the camera, then you can probably just use print(), right?
Reply
#3
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()
Reply
#4
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.
Reply
#5
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...
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  I have an issue with Netmiko Error reading SSH protocol banner omarhegazy 2 3,513 May-16-2022, 06:05 PM
Last Post: omarhegazy
  Programming a routing protocol leemao 2 2,141 Jul-13-2021, 05:47 PM
Last Post: leemao
  Splitting the audio file into smaller packets before transfer using UDP protocol in p MuhammadAli152 0 3,647 May-15-2020, 03:01 PM
Last Post: MuhammadAli152
  Help Importing Protocol Library Into Scapy joedirgy 0 2,039 May-02-2019, 07:31 PM
Last Post: joedirgy
  Retrieve protocol in lower case Variables 1 2,333 May-02-2019, 04:46 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020