motioneyeos icon indicating copy to clipboard operation
motioneyeos copied to clipboard

Feature Request Avahi

Open steveww opened this issue 9 years ago • 29 comments
trafficstars

Please include the avahi-daemon in the OS image. This would make finding the device on the network much easier via mDNS.

steveww avatar Dec 30 '15 11:12 steveww

I'd have to read a bit about that as I'm not really sure how it works, but yes, normally I don't see why not. Unless of course it pulls a large amount of dependencies which would break the lightweight nature of motionEyeOS.

ccrisan avatar Dec 30 '15 16:12 ccrisan

It depends on dbus for client notification, so not too bad. Avahi could then be used to advertise the web address, ssh and possibly other services like the video stream from the camera. Additionally motioneye could use the client to auto configure additional cameras etc.

steveww avatar Dec 30 '15 16:12 steveww

Guys cal you elaborate if this is still important. Thanks!

bortek avatar Feb 23 '17 14:02 bortek

I'd also like to see this added to the default install. If you need configuration files for the different services let us know.

ciscomonkey avatar May 17 '17 15:05 ciscomonkey

I’d love to see this in there. I can see that avahi is already in the packages list but doesn’t appear to be operations all by default. Anyone know how to enable it??

StewartSnow avatar Jun 04 '18 13:06 StewartSnow

@StewartSnow You could try enabling avahi and building motionEyeOS image from source. Running ./build.sh raspberrypi menuconfig will bring up the image configuration. Look for Avahi and enable it, save it, and compile.

Other than enabling the package, do you know what configuration is needed to get avahi to work?

jasaw avatar Jun 08 '18 23:06 jasaw

@jasaw I believe by default you don't need any configuration for this package. Once it's installed it will pick up the current hostname and announce it's mdns name to all other clients on the network as [hostname].local. It's so useful as you no longer need to continually keep track of IP addresses, setup manual DNS records for each host, or set static IP addresses. It just works.... no config needed. Would be great to have available by default - and could pave the way for the interest in camera discovery - as this is basically the same as the Apple Bonjour service - used for discovery of services on a network :)

StewartSnow avatar Jun 09 '18 09:06 StewartSnow

Is there any possibility to see this feature implemented? It would be a great improvement.

macsip avatar Nov 30 '18 22:11 macsip

Any news about it?

eretna avatar May 29 '19 19:05 eretna

This would mean I don't have to plug it/ trawl the DHCP sniff the network in to find the IP address. This is a must have :)

JamesCordell avatar Aug 29 '19 15:08 JamesCordell

Agreed. This is would be a good feature to have. I've just come looking for it now. Shame it's not possible yet.

morrisonj avatar Nov 18 '19 22:11 morrisonj

Agree. This would be excellent.

zackkitzmiller avatar May 25 '20 18:05 zackkitzmiller

IMO waste of time, as the default name is effectively meye-. If it called itself meye-newcamera or meye-newhub or even motioneyeos it would be like the RPI's default of raspberrypi.local.

On Mon, May 25, 2020 at 2:28 PM Zack Kitzmiller [email protected] wrote:

Agree. This would be excellent.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ccrisan/motioneyeos/issues/94#issuecomment-633677671, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEZTUHKLWTDFDZ222RLDUM3RTK2DHANCNFSM4BXS7GAQ .

-- Thanks

Kevin Shumaker

Personal Tech Support https://kevinshumaker.wixsite.com/thethirdlevel

N38° 19' 56.52" W85° 45' 8.56"

Semper Gumby “Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA Ethics are what we do when no one else is looking. Quis custodiet ipsos custodes? “There is no end to the good you can do if you don’t care who gets the credit.” - C Powell You know we're sitting on four million pounds of fuel, one nuclear weapon and a thing that has 270,000 moving parts built by the lowest bidder. Makes you feel good, doesn't it?

starbasessd avatar May 25 '20 20:05 starbasessd

It’s not a waste of time, and hostnames are configurable. When you have something like 200 devices in your network, and you don’t want to ansible or chef everyone, service discovery is incredibly important. I use consul as a routing mesh and I need it to resolve DNS as expected. Even with the hash it’s still not discoverable. The best thing I would do for now is add this particular device to my local DNS server and hope the static IP never somehow gets messed up, or it gets moved to a different subnet.

In any case. I find mDNS to be incredibly useful for this sort of device.

On Mon, May 25, 2020 at 15:11 starbasessd [email protected] wrote:

IMO waste of time, as the default name is effectively meye-. If it called itself meye-newcamera or meye-newhub or even motioneyeos it would be like the RPI's default of raspberrypi.local.

On Mon, May 25, 2020 at 2:28 PM Zack Kitzmiller [email protected] wrote:

Agree. This would be excellent.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <https://github.com/ccrisan/motioneyeos/issues/94#issuecomment-633677671 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AEZTUHKLWTDFDZ222RLDUM3RTK2DHANCNFSM4BXS7GAQ

.

-- Thanks

Kevin Shumaker

Personal Tech Support https://kevinshumaker.wixsite.com/thethirdlevel

N38° 19' 56.52" W85° 45' 8.56"

Semper Gumby “Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA Ethics are what we do when no one else is looking. Quis custodiet ipsos custodes? “There is no end to the good you can do if you don’t care who gets the credit.” - C Powell You know we're sitting on four million pounds of fuel, one nuclear weapon and a thing that has 270,000 moving parts built by the lowest bidder. Makes you feel good, doesn't it?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ccrisan/motioneyeos/issues/94#issuecomment-633703276, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA3HMCYDOI7URGLCTCLYMTRTLGFLANCNFSM4BXS7GAQ .

zackkitzmiller avatar May 25 '20 20:05 zackkitzmiller

IMO waste of time, as the default name is effectively meye-. If it called itself meye-newcamera or meye-newhub or even motioneyeos it would be like the RPI's default of raspberrypi.local.

You would set a unique hostname for each Pi to something useful and memorable like meye-frontdoor.local or meye-whatever.local. I would find this very helpful in my install of 8 Pi's running motioneye...

morrisonj avatar May 25 '20 20:05 morrisonj

Think about what you said. 'hostnames are configurable' They are, but AFTER you remote into it. At least until CCrisan adds 'hostname' to the list of pre-configurable (/boot/...) files.. Or use the MAC address instead of the serial number, or some other way of not using a random number.

 When you havesomething like 200 devices in your network, and you don’t

want to ansible or chef everyone, service discovery is incredibly important. Granted. I have about 100 devices on my local home network, myself. 80% are set up via MAC address static issue IP via my Ubiquity router.

 I use consul as a routing mesh and I need it to resolve DNS as

expected. Even with the hash it’s still not discoverable. Again, granted.

 The best thing I would do for now is add this particular device to my

local DNS server and hope the static IP never somehow gets messed up, or it gets moved to a different subnet I basically have to fire up a new PI, with RASPBIAN, and get the MAC that way, if I plan on it being part of my regular network, or hunt through the DHCP interface on my router and look for a new meye- ( in the pool of open DHCP addresses) I hate doing anything multiple times, myself. . I think it might be easier to put an option in 'os.conf' or a seperate file'hostname.conf' that you can put in /boot, like the statc_ip configuration files, or ssh, or wpa_supplicant.conf files.

On Mon, May 25, 2020 at 4:27 PM Zack Kitzmiller [email protected] wrote:

It’s not a waste of time, and hostnames are configurable. When you have something like 200 devices in your network, and you don’t want to ansible or chef everyone, service discovery is incredibly important. I use consul as a routing mesh and I need it to resolve DNS as expected. Even with the hash it’s still not discoverable. The best thing I would do for now is add this particular device to my local DNS server and hope the static IP never somehow gets messed up, or it gets moved to a different subnet.

In any case. I find mDNS to be incredibly useful for this sort of device.

On Mon, May 25, 2020 at 15:11 starbasessd [email protected] wrote:

IMO waste of time, as the default name is effectively meye-. If it called itself meye-newcamera or meye-newhub or even motioneyeos it would be like the RPI's default of raspberrypi.local.

On Mon, May 25, 2020 at 2:28 PM Zack Kitzmiller < [email protected]> wrote:

Agree. This would be excellent.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/ccrisan/motioneyeos/issues/94#issuecomment-633677671 , or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AEZTUHKLWTDFDZ222RLDUM3RTK2DHANCNFSM4BXS7GAQ

.

-- Thanks

Kevin Shumaker

Personal Tech Support https://kevinshumaker.wixsite.com/thethirdlevel

N38° 19' 56.52" W85° 45' 8.56"

Semper Gumby “Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA Ethics are what we do when no one else is looking. Quis custodiet ipsos custodes? “There is no end to the good you can do if you don’t care who gets the credit.” - C Powell You know we're sitting on four million pounds of fuel, one nuclear weapon and a thing that has 270,000 moving parts built by the lowest bidder. Makes you feel good, doesn't it?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub <https://github.com/ccrisan/motioneyeos/issues/94#issuecomment-633703276 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAA3HMCYDOI7URGLCTCLYMTRTLGFLANCNFSM4BXS7GAQ

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ccrisan/motioneyeos/issues/94#issuecomment-633707176, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEZTUHMCOPTS2TMBJPQIO33RTLIBXANCNFSM4BXS7GAQ .

-- Thanks

Kevin Shumaker

Personal Tech Support https://kevinshumaker.wixsite.com/thethirdlevel

N38° 19' 56.52" W85° 45' 8.56"

Semper Gumby “Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA Ethics are what we do when no one else is looking. Quis custodiet ipsos custodes? “There is no end to the good you can do if you don’t care who gets the credit.” - C Powell You know we're sitting on four million pounds of fuel, one nuclear weapon and a thing that has 270,000 moving parts built by the lowest bidder. Makes you feel good, doesn't it?

starbasessd avatar May 25 '20 20:05 starbasessd

Jim: My point exactly. You currently can't set a name before first boot, the default name is 'meye- ' and thus avahi and other 'find by name services' don't exactly work before you remote in and change the name, and you can't remote in by name until you change such name, or look at the DHCP server to find the name or ip address. I have a number of PI motionEyeOS devices, cameras and hubs, and the first thing I have to do is go hunt them down. PITA. At least until I have the device in the Static IP list.

On Mon, May 25, 2020 at 4:31 PM Jim [email protected] wrote:

IMO waste of time, as the default name is effectively meye-. If it called itself meye-newcamera or meye-newhub or even motioneyeos it would be like the RPI's default of raspberrypi.local.

You would set a unique hostname for each Pi to something useful and memorable like meye-frontdoor.local or meye-whatever.local. I would find this very helpful in my install of 8 Pi's running motioneye...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ccrisan/motioneyeos/issues/94#issuecomment-633708259, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEZTUHIKJGOTDG5SZBPCQBLRTLITRANCNFSM4BXS7GAQ .

-- Thanks

Kevin Shumaker

Personal Tech Support https://kevinshumaker.wixsite.com/thethirdlevel

N38° 19' 56.52" W85° 45' 8.56"

Semper Gumby “Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA Ethics are what we do when no one else is looking. Quis custodiet ipsos custodes? “There is no end to the good you can do if you don’t care who gets the credit.” - C Powell You know we're sitting on four million pounds of fuel, one nuclear weapon and a thing that has 270,000 moving parts built by the lowest bidder. Makes you feel good, doesn't it?

starbasessd avatar May 25 '20 20:05 starbasessd

When you havesomething like 200 devices in your network

In this scenario, you would configure the host name by creating /boot/hostname. From memory, I think it is already supported. Can you guys please try it and report back?

jasaw avatar May 25 '20 23:05 jasaw

@jasaw: Confirmed. created plaintext file 'hostname', contents 'rpi3b-meos' with notepad++ on Win10, placed in /boot/ partition when imaging SDCard. Worked. Where is that option documented? It's not in the motionEyeOS WIKI that I can find...

On Mon, May 25, 2020 at 7:42 PM jasaw [email protected] wrote:

When you havesomething like 200 devices in your network

In this scenario, you would configure the host name by creating /boot/hostname. From memory, I think it is already supported. Can you guys please try it and report back?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ccrisan/motioneyeos/issues/94#issuecomment-633743779, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEZTUHPRSWAEW6R3QVP4OILRTL64TANCNFSM4BXS7GAQ .

-- Thanks

Kevin Shumaker

Personal Tech Support https://kevinshumaker.wixsite.com/thethirdlevel

N38° 19' 56.52" W85° 45' 8.56"

Semper Gumby “Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA Ethics are what we do when no one else is looking. Quis custodiet ipsos custodes? “There is no end to the good you can do if you don’t care who gets the credit.” - C Powell You know we're sitting on four million pounds of fuel, one nuclear weapon and a thing that has 270,000 moving parts built by the lowest bidder. Makes you feel good, doesn't it?

starbasessd avatar May 26 '20 11:05 starbasessd

It could perhaps be worth pointing out that the value of discovery, in my opinion, extends beyond the pure initial setup which is being debated over the past few comments, but also in ongoing access.

If you have a large number of motioneye instances, being able to access them via motioneyehostname.local is very helpful - rather than needing to mess about with DHCP reserved addresses, internal DNS servers, or other means for accessing a large number of devices via easy name.

Especially since the point mentioned above about being able to pre-define the hostname in the boot config.

StewartSnow avatar May 26 '20 11:05 StewartSnow

@StewartSnow Forgive me for my lack of understanding on exactly what Avahi buys us. I've been accessing my motionEyeOS devices via motioneyehostname.local method for years now. From my understanding, when motionEyeOS requests for IP address via DHCP, it also announces its hostname, which the DHCP server stores against the IP address assigned to it. When I send DNS request to my router to resolve motioneyehostname.local, my router resolves it correctly.

If you don't mind, can you please educate us on what Avahi does? Again, I apologize for my lack of understanding.

@starbasessd We should definitely document the /boot/hostname feature. Can you please create a new issue so we don't forget? I've been swamped by work recently. Thank you for supporting all the users here. Really appreciate it. We should really get @ccrisan to give you permission to update the docs/wiki.

jasaw avatar May 26 '20 23:05 jasaw

Hey @jasaw, Sure - my understanding (rightly or wrongly) is that avahi or mdns service running on a device enables the announcing of a bonjour based hostname address ie motioneyehostname.local. And that without it, you cannot resolve these addresses - it's certainly the experience that I have noticed wherever I've implemented this approach.

A fresh raspberry pi install has this running already, so the name resolve works. But of my experience, a fresh install of motioneyeos does not, so the name resolution does not work.

But it sounds like it does work for you which is strange... In short your experience of effective ".local" name resolution, is exactly what I'd concluded would be achieved by having the mdns service running in motioneyeos... (But perhaps I've missed a trick / miss-understood something along the way here...?)

StewartSnow avatar May 27 '20 09:05 StewartSnow

I tried the /boot/hostname method, it does not work.

In fact, the file disappeared in /boot once boot.. not sure why.

It'd be nice to have mdns setup for motioneyeos

admun avatar Jul 19 '20 21:07 admun

Which version of motionEyeOS? Files placed in /boot usually are deleted once read and / or moved to proper folder Are you using Windows or other OS to connect / and / or burning the image? Did you try <whatever_hostname>.local as well as <whatever_hostname> to connect by name? To confirm hostname change, log into the PI with ssh or PuTTY, or look in the upper left corner. It should have whatever hostname you put in there, ranter than meye-xxxxxxxx

On Sun, Jul 19, 2020 at 5:40 PM Edmond Hui [email protected] wrote:

I tried to /boot/hostname method, it does not work.

In fact, the file disappeared in /boot once boot.. not sure why.

It'd be nice to have mdns setup for motioneyeos

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ccrisan/motioneyeos/issues/94#issuecomment-660713854, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEZTUHOX7JXFAKYRBALXWL3R4NR3BANCNFSM4BXS7GAQ .

-- Thanks

Kevin Shumaker

Personal Tech Support https://kevinshumaker.wixsite.com/thethirdlevel

N38° 19' 56.52" W85° 45' 8.56"

Semper Gumby “Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA Ethics are what we do when no one else is looking. Quis custodiet ipsos custodes? “There is no end to the good you can do if you don’t care who gets the credit.” - C Powell You know we're sitting on four million pounds of fuel, one nuclear weapon and a thing that has 270,000 moving parts built by the lowest bidder. Makes you feel good, doesn't it?

starbasessd avatar Jul 19 '20 22:07 starbasessd

Here's what I am on

motionEye Version 0.42.1 Motion Version 4.2.2+gitUNKNOWN OS Version motionEyeOS 20200606

I am on Linux, mounting the /boot and add hostname.

I ssh and saw on the GUI that hostname was changed, but I do not see mDNS working (despite reported above)

I tried ssh both with or without .local, but getting host not resolve.

admun avatar Jul 20 '20 03:07 admun

Do you have your local router/dhcp server set as the first DNS server in DHCP, or on the Linux machine? IOW if your local router/DHCP server is 192.168.1.1, is your DNS Server setting set to 192.168.1.1, 4.2.2.4, 8.8.8.8 or only to the external DNS servers? My local router handles all internal requests and is listed first. The command on your Linux machine

nmcli device show | grep IP4.DNS

Will show what DNS server(s) you are using, and in what order. If your local router/dhcp server isn't #1 normal DNS will never work. Mine shows: IP4.DNS[1]: 192.168.2.1 IP4.DNS[2]: 8.8.8.8 which is correct for my network.

On Sun, Jul 19, 2020 at 11:18 PM Edmond Hui [email protected] wrote:

Here's what I am on

motionEye Version 0.42.1 Motion Version 4.2.2+gitUNKNOWN OS Version motionEyeOS 20200606

I am on Linux, mounting the /boot and add hostname.

I ssh and saw on the GUI that hostname was changed, but I do not see mDNS working (as reported above)

I tried ssh both with or without .local, but getting host not resolve.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ccrisan/motioneyeos/issues/94#issuecomment-660778877, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEZTUHO2CSMQGHYBFTTU55LR4OZRHANCNFSM4BXS7GAQ .

-- Thanks

Kevin Shumaker

Personal Tech Support https://kevinshumaker.wixsite.com/thethirdlevel

N38° 19' 56.52" W85° 45' 8.56"

Semper Gumby “Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA Ethics are what we do when no one else is looking. Quis custodiet ipsos custodes? “There is no end to the good you can do if you don’t care who gets the credit.” - C Powell You know we're sitting on four million pounds of fuel, one nuclear weapon and a thing that has 270,000 moving parts built by the lowest bidder. Makes you feel good, doesn't it?

starbasessd avatar Jul 20 '20 11:07 starbasessd

I have my router as DNS resolver (which is a Google Wifi).

Welcome to meye.local! [root@meye ~]# cat /etc/resolv.conf domain lan search lan nameserver 192.168.86.1 <---- this is the gateway of my Google Wifi, which also act has DNS resolver [root@meye ~]# hostname -a meye.local

I tried to resolved meye.local and meye.lan but no luck.

Note that I have other raspberry pi running Raspbian and it has avahi. They are discovered as .local. So, I know mDNS is working in the local network.

admun avatar Jul 21 '20 03:07 admun

Any updates on the progress of avahi-daemon feature?

ugoi avatar Oct 04 '23 16:10 ugoi

Non-existent. Little advancement of motionEye, and no advancement of motionEyeOS in 3 years. Avahi was not a feature of buildroot.

starbasessd avatar Oct 04 '23 17:10 starbasessd