Pelco P1220 support
Been trying to get ODM to work with an Pelco P1220 with no luck so far.
This camera suports: Open API: Pelco API, ONVIF Profile S and Profile G
Firmware Version: 05.10.57 (MB: 48 PB: 15) date of 5/14/2021
I did a git clone and build onvifmgr
running ONVIF_DEBUG=1 ./onvifmgr
First part is scanning, nothing found. Here is the output:
INFO 25-10-11 23:38:49.548184 124504606700288 onvif_app.c:534: Starting ONVIF Devices Network Discovery...
DEBUG 25-10-11 23:38:49.548544 124504606700288 task_manager.c:19: Task Manager : Event Added
TRACE 25-10-11 23:38:49.548560 124504606700288 onvif_app.c:493: EventQueue Added : 0/1/8
DEBUG 25-10-11 23:38:49.548575 124503141099200 task_manager.c:27: Task Manager : Event Started
TRACE 25-10-11 23:38:49.548616 124503141099200 onvif_app.c:493: EventQueue Dispatching : 1/0/8
TRACE 25-10-11 23:38:49.548638 124503141099200 onvif_app.c:145: _start_onvif_discovery
DEBUG 25-10-11 23:38:49.548858 124503141099200 onvif_discovery.c:211: Sending NVT probe...
DEBUG 25-10-11 23:38:51.551257 124503141099200 onvif_discovery.c:211: Sending NVT probe...
DEBUG 25-10-11 23:38:53.553620 124503141099200 task_manager.c:23: Task Manager : Event finished
TRACE 25-10-11 23:38:53.553644 124503141099200 onvif_app.c:493: EventQueue Dispatched : 0/0/8
TRACE 25-10-11 23:38:53.553655 124504606700288 onvif_app.c:609: OnvifApp__discovery_finished_cb
Second part is manually adding the camera:
DEBUG 25-10-11 23:40:16.258040 124504606700288 task_manager.c:19: Task Manager : Event Added
TRACE 25-10-11 23:40:16.258070 124504606700288 onvif_app.c:493: EventQueue Added : 0/1/8
DEBUG 25-10-11 23:40:16.258083 124502897841856 task_manager.c:27: Task Manager : Event Started
TRACE 25-10-11 23:40:16.258122 124502897841856 onvif_app.c:493: EventQueue Dispatching : 1/0/8
INFO 25-10-11 23:40:16.258154 124502897841856 onvif_app.c:343: Manually adding URL : 'http://192.168.15.24:80/onvif/device_service'
INFO 25-10-11 23:40:16.258217 124502897841856 onvif_device.c:403: Created Device:
INFO 25-10-11 23:40:16.258222 124502897841856 onvif_device.c:404: protocol -- http
INFO 25-10-11 23:40:16.258226 124502897841856 onvif_device.c:405: host : 192.168.15.24
INFO 25-10-11 23:40:16.258230 124502897841856 onvif_device.c:406: port -- 80
INFO 25-10-11 23:40:16.258234 124502897841856 onvif_device.c:407: endpoint : onvif/device_service
INFO 25-10-11 23:40:16.258241 124502897841856 onvif_device.c:126: [http://192.168.15.24:80/onvif/device_service] OnvifDevice__authenticate
DEBUG 25-10-11 23:40:16.258251 124502897841856 onvif_device_service.c:40: [http://192.168.15.24:80/onvif/device_service] Invoking GetSystemDateAndTime
TRACE 25-10-11 23:40:16.259568 124502897841856 onvif_base_service.c:216: [http://192.168.15.24:80/onvif/device_service] No time adjustment required. Camera in sync with client.
INFO 25-10-11 23:40:16.259598 124502897841856 onvif_base_service.c:321: ONVIF_DEBUG variable set. '1'
POST /onvif/device_service HTTP/1.1
Host: 192.168.15.24
User-Agent: gSOAP/2.8
Content-Type: application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver10/device/wsdl/GetSystemDateAndTime"
Content-Length: 1314
Connection: close
Accept-Encoding: gzip,deflate
SOAPAction: "http://www.onvif.org/ver10/device/wsdl/GetSystemDateAndTime"
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"><SOAP-ENV:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" SOAP-ENV:mustUnderstand="true"><wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Time"><wsu:Created>2025-10-12T03:40:16Z</wsu:Created><wsu:Expires>2025-10-12T03:40:26Z</wsu:Expires></wsu:Timestamp><wsse:UsernameToken xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Auth"><wsse:Username>admin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">AgPXjg0cahDbojg0iTjn5EAAlYw=</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">ICPraPKETXiVrkiCz3R1mNd/Fb8=</wsse:Nonce><wsu:Created>2025-10-12T03:40:16Z</wsu:Created></wsse:UsernameToken></wsse:Security></SOAP-ENV:Header><SOAP-ENV:Body><tds:GetSystemDateAndTime xmlns:tds="http://www.onvif.org/ver10/device/wsdl"></tds:GetSystemDateAndTime></SOAP-ENV:Body></SOAP-ENV:Envelope>
HTTP/1.1 200 OK
Server: gSOAP/2.8
Content-Type: application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver10/device/wsdl/GetSystemDateAndTime"
Content-Length: 2385
Connection: close
Date: Mon, 26 Apr 2021 10:52:55 GMT
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:wsrf-bf2="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsrf-r="http://docs.oasis-open.org/wsrf/r-1" xmlns:wsrf-bf="http://docs.oasis-open.org/wsrf/bf-1" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsrf-r2="http://docs.oasis-open.org/wsrf/r-2" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tr2="http://www.onvif.org/ver20/media/wsdl" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:timg1="http://www.onvif.org/ver10/imaging/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:tse="http://www.onvif.org/ver10/search/wsdl" xmlns:trc="http://www.onvif.org/ver10/recording/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl"><SOAP-ENV:Header></SOAP-ENV:Header><SOAP-ENV:Body><tds:GetSystemDateAndTimeResponse><tds:SystemDateAndTime><tt:DateTimeType>Manual</tt:DateTimeType><tt:DaylightSavings>false</tt:DaylightSavings><tt:TimeZone><tt:TZ>GMT0</tt:TZ></tt:TimeZone><tt:UTCDateTime><tt:Time><tt:Hour>10</tt:Hour><tt:Minute>52</tt:Minute><tt:Second>55</tt:Second></tt:Time><tt:Date><tt:Year>2021</tt:Year><tt:Month>4</tt:Month><tt:Day>26</tt:Day></tt:Date></tt:UTCDateTime><tt:Extension><tt:Region>:Greenwich/GMT</tt:Region></tt:Extension></tds:SystemDateAndTime></tds:GetSystemDateAndTimeResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
INFO 25-10-11 23:40:16.300331 124502897841856 onvif_base_service.c:338: ONVIF_DEBUG variable set. '1'
INFO 25-10-11 23:40:16.300435 124502897841856 onvif_device.c:151: [http://192.168.15.24:80/onvif/device_service] Camera SystemDateAndTime : '2021-04-26 06:52:55'
TRACE 25-10-11 23:40:16.300447 124502897841856 onvif_device.c:54: [http://192.168.15.24:80/onvif/device_service] OnvifDevice__createServices
DEBUG 25-10-11 23:40:16.300454 124502897841856 onvif_device_service.c:68: [http://192.168.15.24:80/onvif/device_service] Invoking GetServices
TRACE 25-10-11 23:40:16.300801 124502897841856 onvif_base_service.c:231: [http://192.168.15.24:80/onvif/device_service] Time adjustment [2025-10-12 03:40:16] to [2021-04-26 10:52:55] offset -140806041
INFO 25-10-11 23:40:16.300830 124502897841856 onvif_base_service.c:321: ONVIF_DEBUG variable set. '1'
POST /onvif/device_service HTTP/1.1
Host: 192.168.15.24
User-Agent: gSOAP/2.8
Content-Type: application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver10/device/wsdl/GetServices"
Content-Length: 1347
Connection: close
Accept-Encoding: gzip,deflate
SOAPAction: "http://www.onvif.org/ver10/device/wsdl/GetServices"
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"><SOAP-ENV:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" SOAP-ENV:mustUnderstand="true"><wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Time"><wsu:Created>2025-10-12T03:40:16Z</wsu:Created><wsu:Expires>2025-10-12T03:40:26Z</wsu:Expires></wsu:Timestamp><wsse:UsernameToken xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Auth"><wsse:Username>admin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">Qsu2bdYiFpa6JYpFj0oT/q0JpOE=</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">ICPraMxiV4T/3DuoAEbMQE+/p4k=</wsse:Nonce><wsu:Created>2021-04-26T10:52:55Z</wsu:Created></wsse:UsernameToken></wsse:Security></SOAP-ENV:Header><SOAP-ENV:Body><tds:GetServices xmlns:tds="http://www.onvif.org/ver10/device/wsdl"><tds:IncludeCapability>true</tds:IncludeCapability></tds:GetServices></SOAP-ENV:Body></SOAP-ENV:Envelope>
HTTP/1.1 400 Bad Request
Server: gSOAP/2.8
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 2041
Connection: close
Date: Mon, 26 Apr 2021 10:52:55 GMT
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:wsrf-bf2="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsrf-r="http://docs.oasis-open.org/wsrf/r-1" xmlns:wsrf-bf="http://docs.oasis-open.org/wsrf/bf-1" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsrf-r2="http://docs.oasis-open.org/wsrf/r-2" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tr2="http://www.onvif.org/ver20/media/wsdl" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:timg1="http://www.onvif.org/ver10/imaging/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:tse="http://www.onvif.org/ver10/search/wsdl" xmlns:trc="http://www.onvif.org/ver10/recording/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl"><SOAP-ENV:Header></SOAP-ENV:Header><SOAP-ENV:Body><SOAP-ENV:Fault><SOAP-ENV:Code><SOAP-ENV:Value>SOAP-ENV:Sender</SOAP-ENV:Value></SOAP-ENV:Code><SOAP-ENV:Reason><SOAP-ENV:Text xml:lang="en"/></SOAP-ENV:Reason></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ERROR 25-10-11 23:40:16.653894 124502897841856 onvif_device_service.c:68: [http://192.168.15.24:80/onvif/device_service] Unhandled ERROR 1 [(null)]
ERROR 25-10-11 23:40:16.653937 124502897841856 onvif_base_service.c:389: SOAP 1.2 fault SOAP-ENV:Sender [no subcode]
ERROR 25-10-11 23:40:16.653937 124502897841856 onvif_base_service.c:389: ""
ERROR 25-10-11 23:40:16.653937 124502897841856 onvif_base_service.c:389: Detail: [no detail]
INFO 25-10-11 23:40:16.653953 124502897841856 onvif_base_service.c:338: ONVIF_DEBUG variable set. '1'
ERROR 25-10-11 23:40:16.654049 124502897841856 onvif_device.c:73: [http://192.168.15.24:80/onvif/device_service] Failed to retrieve device services...
ERROR 25-10-11 23:40:16.654062 124502897841856 onvif_device.c:187: [http://192.168.15.24:80/onvif/device_service] OnvifDevice__authenticate - Failed to create media service [5]
ERROR 25-10-11 23:40:16.654075 124502897841856 onvif_app.c:387: An soap error was encountered
DEBUG 25-10-11 23:40:16.654185 124502897841856 task_manager.c:23: Task Manager : Event finished
TRACE 25-10-11 23:40:16.654200 124502897841856 onvif_app.c:493: EventQueue Dispatched : 0/0/8
GUI shows "Unexected error occured" and fails to add the camera.
Network is using the second eth port the computer on its own private network with no gateway. Manually network configured. No dhcp and so on.
My wild guess is that "GetServices" isnt implemented on this camera. There are alternative ways to retreive service URIs, so I'll simply add some fallback mechanism. I should have time tomorrow to work on it.
I noticed that the camera system datetime is offset by 4years and I know at least one of my camera wouldn't work with an offset too large. You could try to get the time synced while I implement a fallback, see if that solves it.
The web interface has no way of manually setting the date/time, only the time servers, either "none", DHCP, or manual time server dns/IP address. So it will take a while for me to redo my network setup to allow it to the internet to ....hold on....I think I can just turn on NTP to allow private IP net access...its already running on my computer.
Update: That was easy, just had to config it in the camera. NTP was already running and sharing on all private IP networks. It update the time. Still same error. Note I compile it on my side from github clone, but I have not dug into the doc to get it to list all the dependencies and version of those. I saw it downloaded a few.
Note: When I first start up the client, I just click "reset" to get past that window as I have no clue what that is for and don't need it.
Firmware is dated 5/14/2021. Not sure of what version of ONVIF it currently supports.
Glad you figured out how to set the time setting and got it out of the way.
At this point my suspicions are really around the ONVIF version implemented on this camera. I couldn't find what version introduced "GetServices", but "GetCapabilities" documentation hints that it wasn't always there.
I'll simply add a "GetCapabilitities" fallback in case 'GetServices" fails and see if that fixes your issue. The fix is gonna be in OnvifSoapLib
I suppose I knew this may be a problem since I apparently kept the code commented out. So it was really quick to implemented.
The changes are already ready for testing.
Since the changes are actually within a depencency, you will need to call autogen.sh again to pull them.
./autogen.sh <insert configure options here>
make clean
make -j$(nproc)
./onvifmgr
Regarding you note about the application password, I suppose I should add a little more details on the UI.
This is the password that's used to encrypt/decrypt the configuration file to protect the camera credentials on the system.
(The file can't be read using a plain text editor)
Clicking "Reset" actually deletes the previous data file and creates a new one with the password entered.
1. I should make it more intuitive in the UI.
2. It should be possible to disable this security entirely.
I did some quick scanning over the docs on the main ONVIF site. I notice the "GetServices" is Profile G that is meant for on device storage while Profile S does not have that command. There is no SD card in this camera, so Profile G might be disabled. But I need to test for that by putting an SD card in it and configure it. I also found that "GetCapabilitities" is deprecated but not removed yet in favor of "GetServices".
I still need to figure out how device discovery works so I can troubleshoot as to why the camera can not be auto discovered.
Profile Q has been deprecated and it explains why when I upgraded the firmware the open API now has a setting to be open or auth requirement API. I have several of these cameras, so I might do some A/B testing there.
From what I understood, "GetServices" is part of the core onvif device definition. You can find it in the devicemgmt wsdl.
The discovery is a simple UDP broadcast over port 3702. Although there may be a need to introduce some settings to accommodate more complex networks. By default, the broadcast message has a max hop count of 1 for security reasons. In a situation where you need your discovery broadcast to pass through another router, this value may need to be increased.
Such properties are not currently exposed but could easily be added.
EDIT:
The gsoap property is ipv4_multicast_ttl and controls the socket IP_MULTICAST_TTL property.
EDIT 2:
You can use the environment variable PROBE_DEBUG to troubleshoot gSoap UDP messages.
PROBE_DEBUG=1 ./onvifmgr
Thank you. I will be able to test this in a couple days due to I did not have an empty compatible SD card to test my theory before going a rebuild/update. So I have to buy one. Don't worry, they are cheap and I need to get some more anyway.
I found a PDF outlining a procedure for Device Discovery, including what we just encounter here. Section 5 covers "GetServices" and "GetCapabilitities" plus more. ONVIF Device Feature Discovery Specification There may be a later version, but could not find it.
Be careful with all these various ONVIF specs. It's better to focus on one at a time since it's easy to get confused across schemas. (Some method exists in multiple schemas)
I would suggest looking at ONVIF Core Specification 8.1.2 Capability exchange.
I even considered using "GetServiceCapabilities" at one point, but some cameras like the Merit LILIN demos aren't working properly.
All that said, manually adding the camera should work now. I did commit a fix yesterday.