Jump to content

bspieg

Members
  • Content Count

    3
  • Joined

  • Last visited

Everything posted by bspieg

  1. I am interested in writing a bash script that runs on the camera to change the IR on/off based on sunset/sunrise data that gets updated daily. I have a similar script that runs on Ubuntu Linux where I have access to the curl command. The camera OS lacks the curl command. Anyone got ideas on how to query an external website for sunrise/sunset info without the curl and grep commands? Is there a command on the camera to directly change the camera settings such as IR on/off? I also need a direct way to change the event recording on/off. I turn off the event recording when the IR changes then turn it back on after the camera settles down. Any thoughts, suggestions appreciated. Thanks.
  2. Reloaded firmware I recently bricked my new IPcam while trying to patch the firmware to remove the NAS format issue. So, I had to refresh the firmware. I downloaded a new image from Hikvision's website. I obtained their pdf explaining the reload process which had a link to the TFTP tool imbedded in the pdf. It did not work. I looked around the web for a TFTP tool. I found several but none worked. Then, I discovered the Hikvision TFTP tool on this website. It worked first time. Be sure and use their tool. When the camera is first powered on, it looks briefly (2-3 seconds) for a handshake from the TFTP tool. Be sure to have it setup EXACTLY as stated in the pdf instructions. No cross over cable needed, just a regular ethernet will do. Once the firmware reports loaded, wait 2-3 minutes extra before power cycling. TFTP Firmware tool: ftp://Hikcustomer:welcome@125.99.126.50 Change the Default Language The camera web interface with new firmware is now Chinese. It was English before. I worked a few days to perfect this change which can easily be done on the camera to change the default language to any of those available. The change survives a reboot. First, you need to enable SSH on the camera. Go to the web interface and you'll have to hack your way to find it. Login, click the 4th item on the top which is Configuration. The, third category on the left is Advanced Configuration. 5th item down is Security. 5th tab is Security Service. 2nd item is SSH. Click the box to enable, save. Startup Script Wouldn't it be nice to be able to execute your own scripts at camera startup? There just isn't any mechanism for this ... until now. I'll show you have since we need this to change the web language. This can be used to start all kinds of personal processes. Enjoy! SSH to your camera and login. All this is in english. You are in the top directory. The directory /dav contains the firmware images, boot scripts and this directory survives a reboot. On boot, the script /dav/initrun.sh is run. We will leverage this. Create a directory in /dav to place your script. mkdir /dav/scripts Let's modify /dav/initrun.sh to execute our script at the conclusion of the boot process. You might want to look at this file before modifying it. BE VERY CAREFUL with this series of commands in case you make an error. There is no editor on the camera and care means you can avoid having to copy to/from a NAS for corrections. View the file: cat /dav/initrun.sh backup the file: cp /dav/initrun.sh /dav/initrun-back.sh Modify it by appending a line: echo "bash /dav/scripts/startup.sh &" >> /dav/initrun.sh If you mess up, simple copy from the backup and try again. cp /dav/initrun-back.sh /dav/initrun.sh OK, we now have the camera firing off your non-existent script called startup.sh on boot. We'll create the script shortly. Let's find the website files. The website files are recreated fresh on boot. Let's look at the language files: ls /home/doc/xml You see directories containing the various languages. The file Languages.xml tells the website what to use. Despite the default stated in this file to be English, it defaults to Chinese. So, we won't mess with that file. Instead, we will trick the system. We will change the directory containing Chinese to a different name and replace that directory with a symbolic link to English (or whatever language you want). When the website uses Chinese, it actually uses what we want. If you want a language other than English, make note of the directory name. You will use this in place of "en" as we move forward. Let's create the startup.sh script. We want to change our directory to the xml area. We move the Chinese language from directory zh to zh1. We create a symbolic link for zh that points to en. That's all the script does but it works. We will use echo to create the script. echo "cd /home/doc/xml mv zh zh1 ln -s en zh" > /dav/scripts/startup.sh Check it's contents: cat /dav/scripts/startup.sh The script will survive a reboot. The language will change and remain this way until you replace the firmware. You now have a great new feature - a startup script. You can add to this script to run other things, change the firewall, change which ports are used or run your own scripts. Be sure to watch the memory use. See the memory available with the "df" command. Good luck!
  3. I wish the Hikvision camera had a startup script so I could run some personal scripts or change the firewall settings. I figured out how to do this. IT WORKS! See my previous post where I used this to change the default language settings. The capability works well and survives a reboot. Reference post: http://www.cctvforum.com/viewtopic.php?f=19&t=43993
×