cbradburne / Hikvision-DS1004KI

Hikvision DS-1004KI PTZ Keyboard - Reprogram

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hikvision-DS1004KI

Hikvision DS-1004KI PTZ Keyboard - Reprogramming

You can completly re-write the firmware for your DS1004KI using Arduino IDE and a few extra bits.

You'll need:
Arduino IDE - https://www.arduino.cc/en/software
Modified Libraries - https://github.com/cbradburne/Hikvision-DS1004KI/tree/main/Arduino/libraries
Waveshare STLinkv2 - https://amzn.to/3qEdqnB
STM32CubeProgrammer - https://www.st.com/en/development-tools/stm32cubeprog.html
Philips Screwdriver
Hair dryer - To remove the display's cover, to access hidden screws.

Install STM32 Arduino Boards

Open Arduino IDE
Open Preferences and paste this link in to the "Additional Boards Manager URLs":
https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
Click OK
Click Tools - Board - Boards Manager...
Search for "STM32"
Install - "STM32 MCU based boards"
Click Tools - Board - "Generic STM32F1 series"
Click Tools - Board part number - "Generic F103VDTx"
(Note: the CPU used is actually a STM32F101VDT, but they are pin compatible)

Install Modified Arduino libraries

2 libraries are needed. These are slightly modified libraries to work with the LED matrix display.
Copy these folders in to your Arduino libraries folder:
    Adafruit-GFX-Library
    HT1632

Change STM32 serial buffer size

Close Arduino IDE.

macOS:
In your home folder, open "Library" folder (may be hidden, click "View", "Show View Options", check "Show Library Folder").
Open "Arduino15",
Then navigate to the file "HardwareSerial.h" located below:

Open "HardwareSerial.h" in a text editor (Visual Studio Code recommended).
Then change 64 to 256 on lines, 44 & 47.

Before:


After:


Save the file and reopen Arduino IDE.

You should now be able to compile the demo sketch - https://github.com/cbradburne/Hikvision-DS1004KI/tree/main/Arduino/HIKVision_DS-1004KI_github

Click - Sketch - Export complied Binary
When it's finished, click - Sketch - Show Sketch Folder
There should now be a .bin file.

Connect the STMLinkV2 to your computer and DS-1004KI via the 20 pin connector. Pin 1 (red cable) on the the DS-1004KI is top right, and power on the DS-1004KI.
Open STM32CubeProgrammer.



To be continued...

About

Hikvision DS-1004KI PTZ Keyboard - Reprogram


Languages

Language:C 86.0%Language:C++ 13.6%Language:Python 0.3%Language:Shell 0.1%Language:Makefile 0.0%