Author Topic: Camera's IP address changes  (Read 170 times)

Offline davemedlin

  • Sr. Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
Camera's IP address changes
« on: January 29, 2019, 12:58:29 pm »
Hey folks, got a strange one here! I've had two Hikvision IP cams added to my Vera Edge controller for awhile now and they have always worked fine. Just a note that I also use Blue Iris and that is the main tool I use for the cams but I've had them added to Vera just so I can easily see them on my dashboard and on the Vera iOS app and iOS Homewave app.

A few days ago I noticed one of the cams was showing as 'not connected' on the dashboard. Looked over in Blue Iris and it was working fine. Went into the config for the cam in Vera and a different IP address was listed rather than the cam's static address I use. I corrected it to the right address and everything was fine until this morning the cam was showing 'not connected' again in Vera. Go back into its settings in Vera and the IP address has changed again! To the same address it had changed to last time!

The address it keeps changing to is a DHCP reserved address for one of my Echo Dots. What in the heck could be causing this??

Dave

Online rigpapa

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1046
  • Karma: +167/-1
Re: Camera's IP address changes
« Reply #1 on: January 29, 2019, 01:15:34 pm »
Check that the Hikvision camera's MAC address is correct in its "mac" attribute  (and that's it not coincidentally the same as the Dot's, which would be unlikely and bad but not unheard of for products made "overseas").

Although it has not been explicitly stated or confirmed by Vera, I've long suspected that the built-in socket management, when it loses the connection to a device, will go on a hunt for it using the MAC address, and store the newly discovered IP address on the device when found. This probably was meant to make life easier for users that rely on DHCP in their networks and don't know how to use reservations or static addressing. But I suspect there are bugs in that code as well, including potentially saving the wrong address (e.g. process fails somehow but stores the last one it looked at), and dropping the port number from the IP address attribute when it re-writes it.
Author of Reactor, DelayLight, SiteSensor, Rachio, Deus Ex Machina II, Intesis WMP Gateway, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3, Lite. Hassio, Slapdash.

Offline davemedlin

  • Sr. Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
Re: Camera's IP address changes
« Reply #2 on: January 29, 2019, 01:38:35 pm »
Check that the Hikvision camera's MAC address is correct in its "mac" attribute  (and that's it not coincidentally the same as the Dot's, which would be unlikely and bad but not unheard of for products made "overseas").

Although it has not been explicitly stated or confirmed by Vera, I've long suspected that the built-in socket management, when it loses the connection to a device, will go on a hunt for it using the MAC address, and store the newly discovered IP address on the device when found. This probably was meant to make life easier for users that rely on DHCP in their networks and don't know how to use reservations or static addressing. But I suspect there are bugs in that code as well, including potentially saving the wrong address (e.g. process fails somehow but stores the last one it looked at), and dropping the port number from the IP address attribute when it re-writes it.

Hmm, thanks, that might be a good call! Just went into Vera settings again and noticed that when I changed the IP address back to the correct address the camera showed up again fine in Vera but the MAC address was still listed as the one for the echo dot. Changed its setting also to the correct MAC address and we'll see what happens. Question remains though, how it got the IP and MAC addresses changed to that of an echo dot in the first place!