yi-hack-v4 icon indicating copy to clipboard operation
yi-hack-v4 copied to clipboard

Fixed IP Address?

Open silent700 opened this issue 5 years ago • 9 comments

Is there any way in the yi-hack firmware or web interface to set a fixed IP address? DHCP-only is not very flexible. I realize the stock firmware has the same limitation but I had hoped the new fw would add that feature. Poking around the filesystem via ssh login didn't lead me anywhere.

silent700 avatar Aug 25 '20 03:08 silent700

You can probably just do a static DHCP mapping on your router.

norrgrd avatar Aug 25 '20 16:08 norrgrd

Sure that works but doesn't do much good if I want to pre-configure a camera and take it to another network, especially one that I don't control.

silent700 avatar Aug 25 '20 17:08 silent700

That is very true, didn't think of that.

What about setting it with ifconfig?

To set the IP ifconfig wlan0 IPADDRESS netmask 255.255.255.0 up

To set gateway route add default gw IPADDRESS

To set DNS echo "nameserver IPADRESS" > /etc/resolv.conf

Should do the trick!

norrgrd avatar Aug 25 '20 18:08 norrgrd

Did it work @silent700 ?

norrgrd avatar Sep 01 '20 17:09 norrgrd

I have not had a chance to hook the camera back up to test, but I believe I tried to set the IP info manually earlier and the ifconfig command was not present. The OS appears to be pared down to the bare essentials.

silent700 avatar Sep 02 '20 05:09 silent700

I know ifconfig works but I am not sure to which extent! I no longer have any camera running this firmware as it broke the rewind functionality for me through official app which was a deal breaker, therefore I cannot test either.

norrgrd avatar Sep 02 '20 06:09 norrgrd

I think this has worked for me! I did get however

/home/yi-hack-v4 # route add default gw 192.168.1.1 route: SIOCADDRT: File exists

chaos-dotcom avatar Sep 02 '20 14:09 chaos-dotcom

I ran this

/home/yi-hack-v4 # ifconfig wlan0 192.168.1.214 netmask 255.255.255.0 up
/home/yi-hack-v4 # route add default gw 192.168.1.1
route: SIOCADDRT: File exists
/home/yi-hack-v4 # echo nameserver 192.168.1.1 /etc/resolv.conf
nameserver 192.168.1.1 /etc/resolv.conf
/home/yi-hack-v4 # cat /etc/resolv.conf
nameserver 192.168.1.1
/home/yi-hack-v4 #

Will this persist after a reboot?

chaos-dotcom avatar Sep 02 '20 14:09 chaos-dotcom

I have tried this method and works.

  1. Create startup script in /tmp/sd/yi-hack-v4/startup.sh
  2. Input command for set static ip address
#!/bin/sh

# set ip
ifconfig wlan0 192.168.43.41 netmask 255.255.255.0 up

# set gateway
route add default gw 192.168.43.1

# set dns
echo nameserver 192.168.43.1 /etc/resolv.conf

raffifu avatar Mar 06 '22 06:03 raffifu