Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cmd for set ip addr #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Unbrick a Hikvision device. Use as follows:

Setup the expected IP address:

linux$ sudo ifconfig eth0:0 192.0.0.128
linux$ sudo ip addr add 192.0.0.128/24 dev enp4s0
osx$ sudo ifconfig en0 alias 192.0.0.128 255.255.255.0

Download the firmware to use:
Expand Down Expand Up @@ -35,7 +35,15 @@ there are two known configurations:

This program defaults to the former. The latter requires commandline overrides:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe delete this paragraph if you're going to put in explicit commands for both?


$ sudo ./hikvision_tftp.py --server-ip=172.9.18.80 --filename=digicap.mav
```bash
sudo ./hikvision_tftp.py --server-ip=192.0.0.128 --filename=digicap.dav
```

OR

```bash
sudo ./hikvision_tftp.py --server-ip=172.9.18.80 --filename=digicap.mav
```

If nothing happens when your device restarts, your device may be expecting
another IP address. tcpdump may be helpful in diagnosing this:
Expand Down
4 changes: 2 additions & 2 deletions hikvision_tftpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ def _bind(self, addr):
raise Error(
('Address %s:%d not available.\n\n'
'Try running:\n'
'linux$ sudo ifconfig eth0:0 %s\n'
'linux$ sudo ip addr add 192.0.0.128/24 dev enp4s0 %s\n'
'osx$ sudo ifconfig en0 alias %s '
'255.255.255.0\n\n'
'(adjust eth0 or en0 to taste. see "ifconfig -a" output)')
'(adjust eth0 or en0 to taste. see "ip addr" output)')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you change the eth0 to enp4s0 above, please adjust it here too so the message is self-consistent

% (addr[0], addr[1], addr[0], addr[0]))
if e.errno == errno.EADDRINUSE:
raise Error(
Expand Down