Showing posts with label scripts. Show all posts
Showing posts with label scripts. Show all posts

Thursday, October 31, 2024

PiKVM to NVR

 

Trying to connect to your IP Camera Network Video Recorder (NVR) via your PiKVM and it’s not working? No video from the NVR on your PiKVM or the mouse is not working fully or at all? Here is how to fix it. This should work for any NVR/DVR, however it has been tested successfully on the following:

Dahua NVR to PiKVM

Reolink NVR to PiKVM

Swann NVR to PiKVM

Lorex NVR to PiKVM

Hikvision NVR to PiKVM



The reason your PiKVM is not working with your NVR is the resolution (1920x1080 or higher) at 60Hz, and the mouse mode. The resolution issue results in no video and the mouse mode makes it so you cant move your mouse around or sometimes click. To fix the video issue, you could drop your NVR HDMI settings to a lower resolution, lower than 1920x1080. I did not want to do that, so here's how i did it.


Connect to the PiKVM via terminal in the webUI or SSH

https:<pikvmip> or ssh <pikvmip>


Change to root

su


Enable read/write mode

rw


Follow the steps below to change the resolution and Hz


Enable 1920x1080 resolution at 60Hz (Source: https://wiki.geekworm.com/X680?TheOrder=1)


    To support max resolution 1920x1080 60Hz (for V1.5 only)

nano /boot/config.txt
Change the line7 from dtoverlay=tc358743 to dtoverlay=tc358743,4lane=1
Save and exit by hitting CTRL + X, answering Y and hitting Enter when prompted.
Editing the EDID
nano /etc/kvmd/tc358743-edid.hex
Delete existing EDID data, then copy and paste below new EDID data
00FFFFFFFFFFFF005262888800888888
1C150103800000780AEE91A3544C9926
0F505400000001010101010101010101
010101010101011D007251D01E206E28
5500C48E2100001E8C0AD08A20E02D10
103E9600138E2100001E000000FC0054
6F73686962612D4832430A20000000FD
003B3D0F2E0F1E0A202020202020014F
020323454F041303021211012021A23C
3D3E1F102309070766030C00300080E3
007F8C8C0AD08A20E02D10103E9600C4
8E210000188C0AD08A20E02D10103E96
00138E210000188C0AA01451F0160026
7C4300138E2100009800000000000000
00000000000000000000000000000000
00000000000000000000000000000087
Save the config
CTRL + O, Enter
Exit Nano
CTRL + X, Enter
Now that you have changed your resolution, you need to modify the mouse settings as the remote mouse may not work with your NVR.
Enable Single relative mouse mode (source: https://docs.pikvm.org/mouse/#single-relative-mode)
Edit the KVMD override file
nano /etc/kvmd/override.yaml
Add the following to the file:
kvmd:
    hid:
        mouse:
            absolute: false
            horizontal_wheel: false
Save the config
CTRL + O, Enter
Exit Nano
CTRL + X, Enter
Change the system back to read-only 
ro
(NOTE: THIS STEP IS IMPORTANT!!!! You could destroy your MicroSD or whatever storage if you forget this step.)

Reboot the PiKVM

reboot


Wait a few minutes for the device to come back online and connect to the WebUI of the PiKVM and you should see your NVR video and be able to click around.

 


 Now you can see we get a picture and mouse!!

Shoutouts

Geekworm, for their documentation, technical support and great products! No endorsement, I but their stuff all the time, plus the official PiKVM prebuilts.

PiKVM, for their excellent documentation, hardware and software.

Reddit users curiouswidget, mehstg, hendrics2 and the subreddit pikvm:

https://www.reddit.com/user/curiouswidget/

https://www.reddit.com/user/mehstg/

https://www.reddit.com/user/hendrics2/ 

https://www.reddit.com/r/pikvm/comments/oc8x57/

 

Keyword/Search Terms:PiKVM,EDID,NVR,Hikvision,Dahua,Amcrest,kvmd,60hz,50hz,dtoverlay,geekworm,video,mouse,no picture,no video,rasberry pi,raspberrypi,HDMI,USB.

Tuesday, April 11, 2017

Dynamic DNS

Best Free Dynamic DNS Solution

Dynamic DNS

When DynDNS stopped providing free Dynamic DNS services I was left searching for a solution. I found NO-IP.org which I used for a few years, but got fed up with having to login every month to re-activate. So I found a solution that provides that, before I tell you about it. Let me list a few services and the pro's and caveats I found with them.

AFRAID (https://freedns.afraid.org/)
   Pro:
    -Free

   Con:
    -TBD

DuckDNS (https://www.duckdns.org/)
   Pro:
    -Free

   Con:
    -Must use existing credentials (Facebook, Google+, Twitter, etc.)

No-IP (http://www.noip.com/)
   Pro:
    -Free

   Con:
    -Monthly Login and Captcha Re-Activation

Hurricane Internet Services (https://dns.he.net/)
   Pro:
    -Free

   Con:
    -Requires too much personal information for registration

FreeMyIP (https://freemyip.com/)

   Pro:
    -Free
    -Anymous
    -No Registration
    -No Expiration
    -No Ad's

   Con:
    -Not sure if it is trustworthy



Keywords: Free Dynamic DNS, DynDNS Alternative, No-IP Alternative, 

Monday, November 7, 2016

Hikvision cURL Enable Telnet

Here is how to enable Telnet on my Hikvision NVR using a cURL command, you can use it on the camera's as well.


cURL Command:
curl -T telnet_on.xml http://admin:12345@192.168.1.100:80/ISAPI/System/Network/telnetd

curl -T telnet_off.xml http://admin:12345@192.168.1.100:80/ISAPI/System/Network/telnetd


Contents of telnet_on.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Telnetd version="2.0" xmlns="http://www.isapi.org/ver20/XMLSchema">
<enabled>true</enabled>
</Telnetd>


Contents of telnet_off.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Telnetd version="2.0" xmlns="http://www.isapi.org/ver20/XMLSchema">
<enabled>false</enabled>
</Telnetd>

Monday, October 24, 2016

Hikvision cURL Enable or Disable IR LED

Here is how to turn on or off the IR LED on my Hikvision Camera using a cURL command, you can use it on your camera's as well.


cURL Command:
curl -T irlight_on.xml http://admin:12345@192.168.1.100:80/ISAPI/System/Hardware

curl -T irlight_off.xml http://admin:12345@192.168.1.100:80/ISAPI/System/Hardware


Contents of irlight_on.xml:

<?xml version="1.0" encoding="UTF-8"?>
<HardwareService xmlns="http://www.hikvision.com/ver20/XMLSchema" version="2.0">
<IrLightSwitch>
<mode>open</mode>
</IrLightSwitch>
</HardwareService>


Contents of irlight_off.xml:

<?xml version="1.0" encoding="UTF-8"?>
<HardwareService xmlns="http://www.hikvision.com/ver20/XMLSchema" version="2.0">
<IrLightSwitch>
<mode>close</mode>
</IrLightSwitch>
</HardwareService>

Monday, October 10, 2016

Hikvision cURL Enable SSH

Here is how to enable SSH on my Hikvision Camera using a cURL command, you can use it on the camera's as well.


cURL Command:
curl -T ssh_on.xml http://admin:12345@192.168.1.100:80/ISAPI/System/Network/ssh

curl -T ssh_off.xml http://admin:12345@192.168.1.100:80/ISAPI/System/Network/ssh


Contents of ssh_on.xml:

<?xml version="1.0" encoding="UTF-8"?>
<SSH version="2.0" xmlns="http://www.isapi.org/ver20/XMLSchema">
<enabled>true</enabled>
</SSH>


Contents of ssh_off.xml:

<?xml version="1.0" encoding="UTF-8"?>
<SSH version="2.0" xmlns="http://www.isapi.org/ver20/XMLSchema">
<enabled>false</enabled>
</SSH>

Tuesday, May 5, 2015

Convert Dahua IP Camera Video (.DAV) to MP4

Here is a quick way to convert video recorded from the Dahua IP camera in .dav format to .mp4 format that is playable on any media player.
 
ffmpeg -y -i InputFile.DAV -vcodec libx264 -crf 25 output.mp4


Change the 25 to the number of frames per second that your video is recorded in.

Friday, February 20, 2015

Ad Blocking using pfSense

Here is a simple way to block ad's for you entire network using pfSense, this is easy as editing the host file on a machine. (You must be using pfsense as your router or configure your router to use the IP of your pfsense server as the DNS server.)

Login to pfSense: Go to "Services", then "DNS Forwarder" and paste the Ad sites you would like to block in the following format under "Advanced":
address=/<url-here>/<ip-here>

So to block smartclip.net for example, enter the following

address=/smartclip.net/127.0.0.1

Note: This entry above will block *.smartclip.net by pointing it back to your local machine. For example that line will block www.smartclip.net, test.smartclip.net, etc. It's like a DNS Wildcard.

Normally the following URL would resolve as follows:

nslookup test.smartclip.net 

Name:    test.smartclip.net
Address: 78.46.98.112

nslookup www.smartclip.net

Name:    www.smartclip.net
Address: 213.203.209.152


By adding the line address=/smartclip.net/127.0.0.1, the nslookup now returns the following:
Name:    test.smartclip.net
Address: 127.0.0.1

Name:    www.smartclip.net
Address: 127.0.0.1





Sunday, June 15, 2014

OpenVPN Test On LAN

Here is how to test your OpenVPN on the same network (local network) as your VPN server.

Change the remote line to point to the local private IP of your OpenVPN server, now you can connect to the vpn server while sitting on the same subnet.


For example your remote connection is MYDNS.dyndns.org, change this to point to the actual IP of the device on the network ex 192.168.1.100(If your OpenVPN server is your router, it will be the address of the router 192.168.1.1 or 192.168.0.1, etc.

In the image above I added a second remote line and commented out the first one by using a # sign, when I want to revert back I can just comment out the local remote line and uncomment the dynamic dns one.

Thursday, June 27, 2013

GV-CAW220 with Zoneminder Working

This is how I got my Geovision GV-CAW220 IP Camera working in Zoneminder.

Step 1) Follow instructions here to install H264 for Zoneminder if you don't already have RTSP streams working in Zoneminder.

Step 2) Add the camera to Zoneminder:
          i) Create a new monitor and choose source as ffmpeg
         ii) Click on source tab, add
rtsp://username:password@192.168.1.120:8554/CH001.sdp?tcp to  the source(change your IP as neccessary on your network, and your username and password.
         iii) Colours is 24 bit, Width is 1920, Height is 1080, Click save and it should now work. Please note if you want to use the Sub stream change the CH001 from 001 to 000.


Please note, with motion detection recording to SD card of the camera and zoneminder streaming ON simultaneously I get RTSP drop outs. I had to disable Audio and change monitoring mode to scheduled. If you have found a way to avoid video dropouts in ZM when using RTSP please let me know. Or at-least an auto reconnect feature.

This should also work with GV-CB120, GV-CB120W, GV-CB220, GV-CBW220 and other Geovision IP Cameras in Zoneminder. Please leave a comment if it worked for other cameras so I can list them here.

Saturday, March 9, 2013

IPC-HDB3200 and Zoneminder Working

This is how I successfully got the Dahua HDB3200 1080p IP Camera working in Zoneminder with H264. The camera is also known as ESC-HDB3200, IPC-HDB3200, DH-HDB3200. I have this camera working in Full HD 1920x1080 resolution in Zoneminder, you may need to increase your shmget, shmall to help with size of the frames. You can google that part for Zoneminder, but the steps below have worked for me twice with 2 different servers running Ubuntu Server 12.04, 1 machine was a fresh install and the other already had zoneminder and ffmpeg installed but the HDB3200 was not working.

Step 1) Login to linux server, run sudo su.

Step 2) run   I)sudo apt-get install checkinstall
                  II) sudo apt-get install git
        III)Install YASM 1.2(This avoids the error talked about in Step 3(pink text strikedout):

 wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz

 tar xvzf yasm-1.2.0.tar.gz

 cd yasm-1.2.0

 ./configure

 make && make install

 cd ..

Step 3) Follow the steps here to install H264 and FFMPEG.(If this is your blog, please let me know if I can copy paste your instructions on my page and give credits to you in the footer.) Follow the steps on that blog link under the title: "Compiling FFmpeg on Ubuntu" Note: I did not have the folder "/home/user/code", so I ran the commands from the present working directory. So after  cd's to the folder I did cd .. instead of cd /home/user/code.

[I received one error regard a switch --disable-asm or something along those lines, I just re-ran the command with the switch it was promting(--disable-asm or something like that, READ the error and correct my switch.)]

Now on my clean install I received no other errors except the one listed above, which was fixed with the correct switch. However on my production server I did receive an error near the end but the camera worked in zoneminder regardless!!!

Step 4) You followed the instructions above, zoneminder is installed(you should know how to do that), under images in options the path for ffmpeg is added(/usr/bin/ffmpeg) and ffmpeg is checked off as available.
Now reboot the server, shutdown -r now

Step 5) Add the camera to zoneminder:
          i) Create a new monitor and choose source as ffmpeg
         ii) Click on source tab,
add rtsp://admin:admin@192.168.1.100:554/cam/realmonitor?channel=1&subtype=0?tcp to the source(change your IP as neccessary on your network, and admin admin to your  username and password.
         iii) Colours is 24 bit, Width is 1920, Height is 1080, Click save and it should now work. Please note if you want to use the Sub stream change the subtype from 0 to 1.
       

This should work with Dahua IPC-HFW-3200C and many different IP cameras that support RTSP, most problems with RTSP not working can be resolved by using FFMPEG with the RTSP url and H264.


***I know you don't need to include sudo if you already started with sudo su, however I assume some people may miss this step and it will do no harm. I take NO responsibility for errors, loss or any result due to you following my instructions, I had a hard time getting it to work and once I figured it out I thought I would help other people out.

Sunday, February 10, 2013

Linksys CURL Command to Release and Renew WAN IP

Someone asked me to provide the cURL commands to release and renew the WAN IP on Linksys routers so here they are:

Release WAN IP:
curl http://username:password@192.168.1.1/apply.cgi -d "submit_button=Status_Router&submit_type=release&change_action=gozila_cgi&wan_proto=dhcp"

Renew WAN IP:
curl http://username:password@192.168.1.1/apply.cgi -d "submit_button=Status_Router&submit_type=renew&change_action=gozila_cgi&wan_proto=dhcp"

Wednesday, August 1, 2012

Free Sim Unlock

Here is how to unlock HTC Desire HD and other HTC models. First of all I take no responsibility if you damage your phone, I have tried this myself and it works, and easy. 2nd thank you goes out to the maker of this Root/Unlock script. Please donate to him if you like it, half the value of the unlock code would be a decent amount. I am not the creator of this, I am just happy he made it and would like to show him gratitude.

To be safe I'm not posting it here or a URL, so Google Advanced ACE Hack Kit. Thats the tool you will need, the instructions explain everything.

Saturday, June 2, 2012

Embedded Zoneminder Stream

Here is how to embed a IP camera stream from Zoneminder into your own website (I recommend only use it for local site(site accessible only internally), since the password and username is visible.)

<img src="http://zoneminder-server-ip/cgi-bin/nph-zms?mode=jpeg&monitor=1&scale=100&maxfps=10&buffer=1000&user=username&pass=password" width="640" height="480">

Dont forget to change the ip to your zoneminder server ip, and the username and password. I recommend creating a non admin account for this. and monitor=1 to the camera you want to view from ZM. 1 would be the first camera hover over the camera url in ZM to find out the monitor ID.

Monday, April 16, 2012

Jpeg to Video

If your using linux and have a bunch of jpeg images you want to convert to video/movie file then just use mencoder in command line. Its quick and easy. Note the following command has to be entered from the directory the images are in.

mencoder -ovc copy -mf w=640:h=480:fps=16:type=jpg 'mf://*.jpg' -o output.avi

 You can use all the image captures captured from your IP Camera to your ftp server or email and compile them into a video that is seek-able by using the command above.

Just copy all the images you want to compile into a video and put them in a folder on your desktop. Open terminal then cd to Desktop and cd to the folder the images are in, then use the command above.

If you captured images in 320x240 you would put that instead of 640x480 respectively in the command above(not mandatory). Also if the video output is playing too fast for your liking just change the fps to a lower number and try again. So if you want to slow it down change the fps from 16 to something lower and if you want to speed it up the playback of the video, increase 16 to a higher number.

Convert ip security camera captured images to video.

Friday, March 23, 2012

XAMMP Redirecting

XAMMP Redirecting to splash. After installing xammp and going to http://localhost and clicking on a language, I keep coming back to splash page. To fix this you need to change the permission on the lang.tmp folder, enter the following:


chmod 775 /opt/lampp/htdocs/xampp/lang/lang.tmp

Now it should work no problem.

Sunday, February 12, 2012

SnakeOS

CURL command to reboot NAS running SnakeOS

curl http://username:password@ip-address/cgi-bin/status.cgi -d reboot=Reboot&press=OK


To use this command in windows, view my other scripts post by clicking scripts tag below this post.

Sunday, January 1, 2012

cURL on Windows

Here is how to use the curl command on any Windows system. Once you complete the steps below you will be able to execute curl commands from the command prompt.



Download cURL here.

Extract the contents of the archive.

Open the extracted folder, then open the bin folder in the extracted folder.

Cut or copy the files in the bin folder and paste it into C:\WINDOWS\system32\

You should now be able to type curl into command prompt and be able to use it. Note curl will become a global command in command prompt so u can use the command regardless of your current working directory.

Friday, November 25, 2011

ZoneMinder Export Failed Fix

If your getting export failed or a 45KB file from ZoneMinder export in Ubuntu, then most likely you are using a version below 1.25.0 of Zoneminder. Here is how to fix it.

1) Open  terminal on the server running zoneminder.

2) Enter the following:
gksudo gedit /usr/share/zoneminder/skins/classic/includes/export_functions.php

3) Scroll to line 255 and look for the following line(error is in red):

$exportFileList = array_merge( $exportFileList, exportFileList( $eid ), $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc );

and edit it to this(remove bracket at the end of $eid and place it after $exportMisc):

$exportFileList = array_merge( $exportFileList, exportFileList( $eid , $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc ));

Save and close the file. Now try the export function and it should work without a hitch.

All credits should go to ¨Fitch¨ on bugs.launchpad.net(Bug #740809), Thank You.

Monday, May 23, 2011

Stream IP Camera to N770

Well I tried many ways to get to stream IP Camera to Nokia N770 Maemo, here´s how I finally did it.

1) Make sure Xterm is installed.

2) Install Wget , single click install file from N770.

3) Install MPlayer

4) Install Becomeroot

5) Launch Xterm, type sudo gainroot

6) Then type:
mkfifo stream.mjpeg
wget http://username:password@IPAddress:port/videostream.cgi -O fifo.mjpeg & mplayer -demuxer 35 fifo.mjpeg
 
add -aspect 16:9  to fill out the full screen(no black bars) so it would look like this:
 
wget http://username:password@IPAddress:port/videostream.cgi -O fifo.mjpeg & mplayer -aspect 16:9 -demuxer 35 fifo.mjpeg 
 
You should now be streaming full screen to your N770, the http link in step 6 is to stream Foscam or Foscam Clone to N770. Lookup the link for your IP camera and replace http:*.cgi with your link.

Tuesday, January 25, 2011

Browser Redirect Virus

So I had this virus that was redirecting my browsers, AVG, Spybot and MalwareBytes did not detect anything. After running Hijackthis, I noticed some scheduled tasks. When I checked my Task scheduler I notice 23 Scheduled tasks, that ran mshta.exe and some URL. I deleted all of these scheduled tasks,searched my C drive for mshta.exe and deleted all instances of it(may need to use Unlocker to do this).

Once I rebooted I ran AVG, Spybot and MalwareBytes again, AVG found 4 things and could not remove them:

"C:\WINDOWS\system32\svchost.exe (1652):\memory_001a0000";"Trojan horse Agent_r.XJ";"Object is inaccessible."
"C:\WINDOWS\system32\svchost.exe (1652)";"Trojan horse Agent_r.XJ";""
"C:\WINDOWS\explorer.exe (636):\memory_001a0000";"Trojan horse Agent_r.XJ";"Object is inaccessible."
"C:\WINDOWS\explorer.exe (636)";"Trojan horse Agent_r.XJ";""

After some google'ing I found someone recommending TDSSKiller from Kaspersky. So I ran this program and it found 2 threats and removed them with a reboot, healed my system completely, AVG scan confirmed this.


Download Link: http://support.kaspersky.com/downloads/utils/tdsskiller.zip

PiKVM to NVR

  Trying to connect to your IP Camera Network Video Recorder (NVR) via your PiKVM and it’s not working? No video from the NVR on...