roleoroleo / sonoff-hack

Custom firmware for Sonoff GK-200MP2B camera
GNU General Public License v3.0
200 stars 45 forks source link

Static Ip #125

Closed GeorgeGero closed 1 month ago

GeorgeGero commented 1 year ago

This is a really nice project. Gongratulations for that ... I want to change the IP of the camera to static from DHCP because th Blue Iris machine is to another subnet . Is it possible to do this ? Thanks in advance

roleoroleo commented 1 year ago

I really don't know if it's possible. You can try to set the ip address adding the file /mnt/mmc/startup.sh with the line ifconfig wlan0 YOUR.IP.ADD.ESS if you are using wifi or ifconfig eth0 YOUR.IP.ADD.ESS if you are using ethernet. But I don't know if there is some sonoff process that overwrites this setting.

GeorgeGero commented 1 year ago

Thanks for your reply .. In the sd card I see a file boot.sh (not startup.sh) .. But I see that it calls a script (dhcp.sh) .. I will try to add the ifconfig line at the end ..This is the code inside the boot.sh

# Fix hostname
cp /mnt/mtd/ipc/app/script/dhcp.sh /tmp/dhcp.sh
HOSTNAME=$(cat /var/sdcard/sonoff-hack/etc/hostname)
sed -i "s/dhcpname=\$2/dhcpname=$HOSTNAME/g" /tmp/dhcp.sh
mount --bind /tmp/dhcp.sh /mnt/mtd/ipc/app/script/dhcp.sh
roleoroleo commented 1 year ago

Please, check this commit: https://github.com/roleoroleo/sonoff-hack/commit/08de41c0aa908c043ecba7c56ef9aa665aab5d37

github-actions[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.