01304 827609 info@use-ip.co.uk Find us

Information on the RS-485 protocol?

Robertomcat

Active Member
Messages
47
Points
8
Hello, good afternoon.

I have been trawling the forum, but what I am looking for is not to be found in any posted thread.

Hikvision cameras (and other brands of course) work all PTZ functions through the RS485 port when you connect it to an NVR for example.

I would like to be able to make a tracking system through a Raspberry and RS485 protocol, but I don't know how is the communication between both devices. That's why I wanted to ask here, when you connect a camera to the NVR via RS485 ¿what signals are sent between the two devices to communicate? In the cameras you can change the baud rate and the NVRs send electrical signals to the cameras, but I have no idea in which intensity, ohms... I am not an expert in this type of communication.

Please, is there anyone who can advise me on this subject? Thank you!
 
Hello, good afternoon.

I have been trawling the forum, but what I am looking for is not to be found in any posted thread.

Hikvision cameras (and other brands of course) work all PTZ functions through the RS485 port when you connect it to an NVR for example.

I would like to be able to make a tracking system through a Raspberry and RS485 protocol, but I don't know how is the communication between both devices. That's why I wanted to ask here, when you connect a camera to the NVR via RS485 ¿what signals are sent between the two devices to communicate? In the cameras you can change the baud rate and the NVRs send electrical signals to the cameras, but I have no idea in which intensity, ohms... I am not an expert in this type of communication.

Please, is there anyone who can advise me on this subject? Thank you!
I'm familiar with RS232 and have used RS485 and RS422 for data transfer and telemetry. What sort of tracking are you thinking of?

David
 
I'm familiar with RS232 and have used RS485 and RS422 for data transfer and telemetry. What sort of tracking are you thinking of?

David
Hi @David

My idea is to make the PTZ camera compatible with some star-tracking software such as Stellarium or Astroberry.

I started this idea 14 days ago by asking on a forum in Australia, but nobody had answered me until today. Here is a link to a guy who made an extraordinary invention.


According to the manufacturer's reply, the communication via RS485 in this camera is standard communication, but I have no programming skills, so all this is very much against me.

I have also initiated the same proposal in an astronomy forum.

I would like to be able to do the same with this PTZ85448-HNF-PA camera, which I will soon put on the roof of the village where I live, as I live on the outskirts of the village I have a great view of nature and mountains, and also a sky with a Bortle 4.


P.S: I opened this post in Hikvision, but the camera I have is Dahua, I don't know if someone can move it.
 
I would like to be able to do the same with this PTZ85448-HNF-PA camera,
Make sure the camera is compatible with the software you will use, be careful what you buy to interconnect everything. I'll help where I can, I'm sure the astronomy forums will be a wealth of information and ready made software.

David
 
It’s likely that Hikvision will use a ‘closed’ protocol. That is, they won’t disclose the specific command makeup, how to compile it. As an example Pelco used to use two protocols for their PTZ telemetry - Pelco D and Pelco P. Pelco D was their freely usable control protocol and you could simply download the manual detailing its format (most other manufacturers offered their own proprietary protocols alongside Pelco D for compatibility). Pelco P on the other hand was their closed protocol and unavailable; I managed to get a copy when I needed it for a project, but had to contact them, apply and sign non disclosure agreements etc.

What I used to do previously (a long time ago) was to just read and copy commands for the basics You could connect a laptop to an NVRs RS485 connection via an RS232 to RS485 connection and then monitor the hexadecimal commands received while sending out commands. They’ll be made up of a number of bytes - Address, command byte 1, command byte 2 etc, finishing with a checksum. The sequences contain the functions and decode into ‘address 1’, ‘pan right’, ‘speed 3’ etc, with the checksum performed on the total so the receiver knows if a command was missed. Some of the command bytes may be unused.
 
It’s likely that Hikvision will use a ‘closed’ protocol. That is, they won’t disclose the specific command makeup, how to compile it. As an example Pelco used to use two protocols for their PTZ telemetry - Pelco D and Pelco P. Pelco D was their freely usable control protocol and you could simply download the manual detailing its format (most other manufacturers offered their own proprietary protocols alongside Pelco D for compatibility). Pelco P on the other hand was their closed protocol and unavailable; I managed to get a copy when I needed it for a project, but had to contact them, apply and sign non disclosure agreements etc.

What I used to do previously (a long time ago) was to just read and copy commands for the basics You could connect a laptop to an NVRs RS485 connection via an RS232 to RS485 connection and then monitor the hexadecimal commands received while sending out commands. They’ll be made up of a number of bytes - Address, command byte 1, command byte 2 etc, finishing with a checksum. The sequences contain the functions and decode into ‘address 1’, ‘pan right’, ‘speed 3’ etc, with the checksum performed on the total so the receiver knows if a command was missed. Some of the command bytes may be unused.
Some customised protocols even slice up the hex command strings and reverse them (0xabc = 0xcba). A protocol sniffer can be used to interpret the commands sent and look for the patterns. I think a Dahua PTZ is being used so the command protocol may be in the public domain.

In the late 90's we used an oscilloscope to monitor the rs232 commands between a telescope and its handset. Once we understood the commands, software was written to control the scope from a desktop.
 
Make sure the camera is compatible with the software you will use, be careful what you buy to interconnect everything. I'll help where I can, I'm sure the astronomy forums will be a wealth of information and ready made software.
Well, I would have to find out more specifically, but it could be that a Raspi is used with a UART module?

What I used to do previously (a long time ago) was to just read and copy commands for the basics You could connect a laptop to an NVRs RS485 connection via an RS232 to RS485 connection and then monitor the hexadecimal commands received while sending out commands. They’ll be made up of a number of bytes - Address, command byte 1, command byte 2 etc, finishing with a checksum. The sequences contain the functions and decode into ‘address 1’, ‘pan right’, ‘speed 3’ etc, with the checksum performed on the total so the receiver knows if a command was missed. Some of the command bytes may be unused.
Yes, protocols can change between brands. The person who sold me the camera asked Dahua directly about the communication protocol, and his answer was: "dahua said Standard e RS485 communication protocol", which is a very short answer, which may solve the whole problem, or may not have solved the question at all, because I don't know what the standard protocol is.
 
Well, I would have to find out more specifically, but it could be that a Raspi is used with a UART module?
The UART is usually in the USB converter that you buy, or in the serial port of the device you are using. In the NVR you mention the UART is connected to the RS485 connector. I have 3 USB converters. One is true RS232, the second is serial TTL (3.3Vdc) and the other serial TTL (5Vdc).
 
The UART is usually in the USB converter that you buy, or in the serial port of the device you are using. In the NVR you mention the UART is connected to the RS485 connector. I have 3 USB converters. One is true RS232, the second is serial TTL (3.3Vdc) and the other serial TTL (5Vdc).
OK, I understand. So when the company says that the communication protocol used is the standard, what does it mean? What is that standard? Just to be able to have a little bit more clarity.
 
Back
Top