motioneye-project / motioneye

A web frontend for the motion daemon.
GNU General Public License v3.0
3.99k stars 654 forks source link

IP camera address not editable in GUI? #1876

Closed Yonny24 closed 3 years ago

Yonny24 commented 4 years ago

Is there a config file I can access to modify the IP address of the cameras, in the case of a camera's IP not being static? Currently, I need to delete the entire camera and start all over again if the IP changes as this field is not editable in the motioneye gui. Happens if I get a power cut for example.

Maybe there isa a config file I can modify but haven't found it. I'm unable to set a static lease on my router for 3 of the cameras.

Thanks

zagrim commented 4 years ago

Yep. In the same directory where the rest of the config is (likely /etc/motioneye at least for non-docker installation) you'll find files named camera-N.conf ("N" being the number corresponding to a camera).

I'd suggest setting the cameras to use a static IP if at all possible (if they get their IP from your router, there's likely an option to reserve IPs in the DHCP settings, or possibly the cameras have some web admin GUI where their network settings could be set. If that isn't possible, one option to having to edit 3 different files in case all 3 change their IP is to add entries in /etc/hosts (on the MotionEye host) for the cameras so that you have local aliases for the cameras which you then can use in MotionEye config to refer to the cameras. The format to be used in /etc/hosts is simply " " (e.g. 1.2.3.4 mycam-1), one entry per line.

Yonny24 commented 4 years ago

Hi zagrim.

I had a look in all the folders named /etc/ last night but could not find anything called motion or motioneye. (ubuntu 20).

Possibly because it is a supervisor addon?

My dhcp server is locked down by the iSP provider. Nothing I can edit there, unfortunately.

zagrim commented 4 years ago

Are you running MotionEye in Docker, then? Because in that case the configuration files might be somewhere else and you just use volume mapping to make them available to the container as /etc/motioneye, but even in that case you should know where you put that stuff :) It might be that you are not able to see inside /etc/motioneye as a regular user but you should still be able to see it. What installation instructions you have used to set up MotionEye?

zagrim commented 4 years ago

From your other question it seems to me that you are actually running MotionEye as an addon to Hass.io, am I right? I know nothing of how things are set up in that case, or where the configs are put, but surely the installation instructions mention that.

Yonny24 commented 4 years ago

Hi zagrim. Yes that is right. The addons are dockers in their own right. You can control them from portainer and see them in glances but have no idea where the standard config files are. ok no worries I'll continue asking about. Thanks for your replies. If I can't get to the config files with the addon I may consider wiping it and installing it centrally from ubuntu instead of an addon.

zagrim commented 4 years ago

If you can access the command line on the host running Hassio, there are some options:

Good luck with the search!

Yonny24 commented 4 years ago

Thanks zagrim. When I get some more time I'll look into the options you gave me. I also found if I download the backup file from motioneye and open it in notepad I have all the config there including the camera url/ip. I wonder if I can update that, save it and restore back to motioneye.

zagrim commented 4 years ago

I'd guess modifying the backup and then restoring from it would work, too, although I've not familiar with the content/format of the backup.

LanceMcCarthy commented 2 years ago

In case it helps for future visitors, I thought I'd add a comment.

I am running motioneye in a docker container (specifically, in Home Assistant). I found the camera configs in /data/motioneye folder.

CasperJohansen commented 1 year ago

I'd guess modifying the backup and then restoring from it would work, too, although I've not familiar with the content/format of the backup.

Can confirm it works!

LanceMcCarthy commented 1 year ago
  • use 7zip to wrap it in TAR
  • use online service like Zamzar to convert it to tar.gz

I would strongly advise against using an online service to do the compression because you're uploading sensitive data to an unknown system. You can actually gz compress the tar in the same step:

tar -cvzf filename.tar.gz /path/to/directory_or_file

So let's say you downloaded a folder named "mymotioneyebackup" to your downloads folder. Open Downloads folder in command line (bash or Powershell) and use the one-liner

tar -cvzf mymotioneyebackup.tar.gz ./mymotioneyebackup

CasperJohansen commented 1 year ago

You can actually gz compress the tar in the same step:

tar -cvzf filename.tar.gz /path/to/directory_or_file

So let's say you downloaded a folder named "mymotioneyebackup" to your downloads folder. Open Downloads folder in command line (bash or Powershell) and use the one-liner

tar -cvzf mymotioneyebackup.tar.gz ./mymotioneyebackup

Nice! thanks for the tip!