Guide: Install Avahi (Bonjour) on Netgear R7000 with Entware

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Author Message
mrengles
DD-WRT User


Joined: 25 Feb 2010
Posts: 255

PostPosted: Tue Mar 03, 2015 16:57    Post subject: Guide: Install Avahi (Bonjour) on Netgear R7000 with Entware Reply with quote
Hello Everyone,

If you want to install DDWRT-K3-ARM compatible software packages checkout the links below:

http://www.dd-wrt.com/phpBB2/viewtopic.php?t=279003
https://github.com/Entware-ng/Entware-ng/wiki/Install-on-DD-WRT

Before you even get started your should have JFFS mounted and your USB mounted to /opt with an extra swap partition. Google if you don't know how to setup your USB for opt and swap. Hint... GParted Linux Live CD. Laughing

Here's a simple guide to install Avahi (Bonjour, Zerconf, mDNS) with a working startup script and sample services to advertise.

1. SSH/Telnet into your router and issue the following commands (each line is a separate command).

Code:

wget -O - http://pkg.entware.net/binaries/armv7/installer/entware_install.sh | sh


When asked to select your install location use whatever number corresponds to /opt.

2. Now that Entware-ARM (opkg) is installed onto your DDWRT router - update the packages and install avahi (each line is a separate command).

Code:

opkg update
opkg install avahi-utils
opkg install nano


3. Add the text below to your startup scrip. Administration > Commands > Save Startup

Code:

echo "nogroup:x:114:nobody" >> /etc/group
echo "nobody:*:114:114:avahi:/opt/sbin/avahi-daemon:/bin/false" >> /etc/passwd
sleep 20
touch /opt/etc/avahi/avahi-daemon.conf
touch /opt/etc/dbus-1/session.conf
touch /opt/etc/dbus-1/system.conf
/opt/etc/init.d/rc.unslung start


If you want to use my sample Avahi services for http, https, pdl-printer, sftp and ssh add them to /opt/etc/avahi/services/ and restart the router. Only add the services that you have enabled on the router. If you need more services or need to change something Google is your friend. Laughing

After the router has been restarted... Check to make sure avahi, dbus are running with the "top" command. You will see them in the list of running programs.

If you make changes to any of the config files or services issue the command below to restart avahi and dbus without having to restart.

Code:

/opt/etc/init.d/rc.unslung restart



You can edit the Avahi services directly on the router using nano that we installed earlier in this guide.

Code:

nano /opt/etc/avahi/services/pdl.service


Mrengles aka Robert



Avahi Services.zip
 Description:
Sample Avahi Advertised Services for AFP, FTP, HTTP, HTTPS, NFS, PDL-Printer, SFTP, SMB (Samba), SSH, Telnet and VNC.

Download
 Filename:  Avahi Services.zip
 Filesize:  8.47 KB
 Downloaded:  566 Time(s)



Last edited by mrengles on Sun Jan 24, 2016 17:42; edited 6 times in total
Sponsor
mrengles
DD-WRT User


Joined: 25 Feb 2010
Posts: 255

PostPosted: Wed Mar 04, 2015 13:44    Post subject: Reply with quote
i've added a few more services to the downloads sections. Most of the stock ddwrt options now have an avahi service available.

Good luck!
elRadix
DD-WRT Novice


Joined: 16 Feb 2015
Posts: 20

PostPosted: Wed Mar 04, 2015 22:15    Post subject: Reply with quote
thanks, followed your instructions, everything works as intended
mrengles
DD-WRT User


Joined: 25 Feb 2010
Posts: 255

PostPosted: Wed Mar 04, 2015 22:26    Post subject: Reply with quote
elRadix wrote:
thanks, followed your instructions, everything works as intended


Good to hear! happy to know it's also working for you.
john8791
DD-WRT Novice


Joined: 24 Mar 2015
Posts: 21

PostPosted: Thu May 14, 2015 2:21    Post subject: Re: Guide: Install Avahi (Bonjour) on Netgear R7000 with Ent Reply with quote
mrengles wrote:
Hello Everyone,

If you want to install DDWRT-K3-ARM compatible software packages checkout the links below:

https://www.asuswrt.eu/how-to-install-entware-arm/
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=279003

Before you even get started your should have JFFS mounted and your USB mounted to /opt with an extra swap partition. Google if you don't know how to setup your USB for opt and swap. Hint... GParted Linux Live CD. Laughing

Here's a simple guide to install Avahi (Bonjour, Zerconf, mDNS) with a working startup script and sample services to advertise.

1. SSH/Telnet into your router and issue the following commands (each line is a separate command).

Code:

cd /jffs
mkdir scripts
wget -c -O entware.arm-setup.sh http://goo.gl/FUX7Nv
chmod +x ./entware.arm-setup.sh
./entware.arm-setup.sh


When asked to select your install location use whatever number corresponds to /opt.

2. Now that Entware-ARM (opkg) is installed onto your DDWRT router - update the packages and install avahi (each line is a separate command).

Code:

opkg update
opkg install avahi-utils
opkg install nano


3. Add the text below to your startup scrip. Administration > Commands > Save Startup

Code:

echo "nogroup:x:114:nobody" >> /etc/group
echo "nobody:*:114:114:avahi:/opt/sbin/avahi-daemon:/bin/false" >> /etc/passwd
sleep 20
touch /opt/etc/avahi/avahi-daemon.conf
touch /opt/etc/dbus-1/session.conf
touch /opt/etc/dbus-1/system.conf
/opt/etc/init.d/rc.unslung start


If you want to use my sample Avahi services for http, https, pdl-printer, sftp and ssh add them to /opt/etc/avahi/services/ and restart the router. Only add the services that you have enabled on the router. If you need more services or need to change something Google is your friend. Laughing

After the router has been restarted... Check to make sure avahi, dbus are running with the "top" command. You will see them in the list of running programs.

If you make changes to any of the config files or services issue the command below to restart avahi and dbus without having to restart.

Code:

/opt/etc/init.d/rc.unslung restart



You can edit the Avahi services directly on the router using nano that we installed earlier in this guide.

Code:

nano /opt/etc/avahi/services/pdl.service


Mrengles aka Robert


Thank you so much for this. Can you explain what step 3. is doing with the "nobody" user?
zyxmon
DD-WRT User


Joined: 07 Sep 2011
Posts: 139

PostPosted: Sat May 16, 2015 6:49    Post subject: Reply with quote
Just for information.
There are a couple of experimental packages for Entware.arm (more info in Russian - http://www.zyxmon.org/2015/05/10/ustanavlivaem-entware-arm-na-nestandartnye-zhelezki/ )

One can install experimental libc & busybox packages from http://qnapware.zyxmon.org/binaries-armv7/experimental/
After these packages are installed entware.arm binaries will use /opt/etc/passwd /opt/etc/group .... files for authorization. Changes made with adduser and similar applets are permanent. In this case script in step 3 can be replaced by a couple of commands.

_________________
My forum.
pianoguy
DD-WRT Novice


Joined: 16 Jan 2013
Posts: 15

PostPosted: Wed Jul 15, 2015 14:47    Post subject: Reply with quote
The link to http://goo.gl/FUX7Nv seems to be down.

The link stated on asuswrt works.

But i fail to run the script on a R7000:
Code:
root@DD-WRT:/jffs/scripts# ./entware.arm-setup.sh
-sh: ./entware.arm-setup.sh: not found
root@DD-WRT:/jffs/scripts# sh ./entware.arm-setup.sh
: not foundrm-setup.sh: line 2:
: not foundrm-setup.sh: line 9:
./entware.arm-setup.sh: cd: line 11: can't cd to /tmp
: not foundrm-setup.sh: line 12:
 This script will guide you through the Entware-Arm installation.
 Script modifies only "entware.arm" folder on the chosen drive,
 no other data will be touched. Existing installation will be
 replaced with this one. Also some start scripts will be installed,
 the old ones will be saved on partition where Entware is installed
 like /tmp/mnt/sda1/jffs_scripts_backup.tgz

: not foundrm-setup.sh: line 20:
./entware.arm-setup.sh: line 31: syntax error: unexpected word (expecting "do")


What's wrong here?
pianoguy
DD-WRT Novice


Joined: 16 Jan 2013
Posts: 15

PostPosted: Wed Jul 15, 2015 15:19    Post subject: Reply with quote
I still didn't know what's wrong, but it worked with this script: https://gist.github.com/dreamcat4/6e58639288c1a1716b85
diman82
DD-WRT Novice


Joined: 19 Nov 2010
Posts: 17

PostPosted: Sat Oct 03, 2015 16:41    Post subject: New working link for: entware-arm.sh Reply with quote
I've uploaded the script a new working link:
http://tinyurl.com/ogng5yk

So please change the line in step 1 to:
wget -c -O entware.arm-setup.sh http://tinyurl.com/ogng5yk
Bladiblato
DD-WRT Novice


Joined: 10 Mar 2016
Posts: 37

PostPosted: Sat Mar 12, 2016 12:10    Post subject: Re: New working link for: entware-arm.sh Reply with quote
diman82 wrote:
I've uploaded the script a new working link:
http://tinyurl.com/ogng5yk

So please change the line in step 1 to:
wget -c -O entware.arm-setup.sh http://tinyurl.com/ogng5yk



It seems that link is also down.

:~# wget -c -O entware.arm-setup.sh http://tinyurl.com/ogng5yk
Connecting to tinyurl.com (104.20.88.65:80)
Connecting to eu.storagemadeeasy.com (139.162.215.12:443)
wget: error getting response: Resource temporarily unavailable
diman82
DD-WRT Novice


Joined: 19 Nov 2010
Posts: 17

PostPosted: Sat Mar 12, 2016 12:58    Post subject: Re: New working link for: entware-arm.sh Reply with quote
Bladiblato wrote:
diman82 wrote:
I've uploaded the script a new working link:
http://tinyurl.com/ogng5yk

So please change the line in step 1 to:
wget -c -O entware.arm-setup.sh http://tinyurl.com/ogng5yk



It seems that link is also down.

:~# wget -c -O entware.arm-setup.sh http://tinyurl.com/ogng5yk
Connecting to tinyurl.com (104.20.88.65:80)
Connecting to eu.storagemadeeasy.com (139.162.215.12:443)
wget: error getting response: Resource temporarily unavailable


This is a new one working:
https://eu.storagemadeeasy.com/files/1ee26916decbeb78c12c90003040caab.sh
Bladiblato
DD-WRT Novice


Joined: 10 Mar 2016
Posts: 37

PostPosted: Sat Mar 12, 2016 13:46    Post subject: Server down Reply with quote
@ diman82
Thanks for the link. I've got the entware-arm.sh file.

I have no luck with servers today. It seems that the server qnapware.zyxmon.org is down at the moment. Can't get any files for the installation.



:~# /tmp/mnt/sda1/opt/entware-arm.sh
Info: Checking for prerequisites and creating folders...
Folder /opt/lib exists!
If something goes wrong please clean /opt folder and try again.
Folder /opt/tmp exists!
If something goes wrong please clean /opt folder and try again.
Info: Opkg package manager deployment...
Connecting to qnapware.zyxmon.org (81.4.123.217:80)
wget: can't connect to remote host (81.4.123.217): Operation timed out
chmod: /opt/bin/opkg: No such file or directory
Connecting to qnapware.zyxmon.org (81.4.123.217:80)
wget: can't connect to remote host (81.4.123.217): Operation timed out
Connecting to qnapware.zyxmon.org (81.4.123.217:80)
wget: can't connect to remote host (81.4.123.217): Operation timed out
chmod: ld-2.20.so: No such file or directory
ln: ld-linux.so.3: File exists
Connecting to qnapware.zyxmon.org (81.4.123.217:80)
wget: can't connect to remote host (81.4.123.217): Operation timed out
Info: Basic packages installation...
/tmp/mnt/sda1/opt/entware-arm.sh: line 49: /opt/bin/opkg: not found
/tmp/mnt/sda1/opt/entware-arm.sh: line 50: /opt/bin/opkg: not found
Connecting to qnapware.zyxmon.org (81.4.123.217:80)
wget: can't connect to remote host (81.4.123.217): Operation timed out
Info: Congratulations!
Info: If there are no errors above then Entware.arm successfully initialized.
Info: Add /opt/bin & /opt/sbin to your PATH variable
Info: Add '/opt/etc/init.d/rc.unslung start' to startup script for Entware.arm services to start
Info: Found a Bug? Please report at https://github.com/zyxmon/entware-arm/issues
diman82
DD-WRT Novice


Joined: 19 Nov 2010
Posts: 17

PostPosted: Sat Mar 12, 2016 14:11    Post subject: Re: Server down Reply with quote
Bladiblato wrote:
@ diman82
Thanks for the link. I've got the entware-arm.sh file.

I have no luck with servers today. It seems that the server qnapware.zyxmon.org is down at the moment. Can't get any files for the installation.



:~# /tmp/mnt/sda1/opt/entware-arm.sh
Info: Checking for prerequisites and creating folders...
Folder /opt/lib exists!
If something goes wrong please clean /opt folder and try again.
Folder /opt/tmp exists!
If something goes wrong please clean /opt folder and try again.
Info: Opkg package manager deployment...
Connecting to qnapware.zyxmon.org (81.4.123.217:80)
wget: can't connect to remote host (81.4.123.217): Operation timed out
chmod: /opt/bin/opkg: No such file or directory
Connecting to qnapware.zyxmon.org (81.4.123.217:80)
wget: can't connect to remote host (81.4.123.217): Operation timed out
Connecting to qnapware.zyxmon.org (81.4.123.217:80)
wget: can't connect to remote host (81.4.123.217): Operation timed out
chmod: ld-2.20.so: No such file or directory
ln: ld-linux.so.3: File exists
Connecting to qnapware.zyxmon.org (81.4.123.217:80)
wget: can't connect to remote host (81.4.123.217): Operation timed out
Info: Basic packages installation...
/tmp/mnt/sda1/opt/entware-arm.sh: line 49: /opt/bin/opkg: not found
/tmp/mnt/sda1/opt/entware-arm.sh: line 50: /opt/bin/opkg: not found
Connecting to qnapware.zyxmon.org (81.4.123.217:80)
wget: can't connect to remote host (81.4.123.217): Operation timed out
Info: Congratulations!
Info: If there are no errors above then Entware.arm successfully initialized.
Info: Add /opt/bin & /opt/sbin to your PATH variable
Info: Add '/opt/etc/init.d/rc.unslung start' to startup script for Entware.arm services to start
Info: Found a Bug? Please report at https://github.com/zyxmon/entware-arm/issues


I would check for firewall/proxy settings on your side, because it seems that the server is up & running: got a good reply when acessing from browser:

"It works!

This is the default web page for qnapware.zyxmon.org.

The web server software is running OK."
Bladiblato
DD-WRT Novice


Joined: 10 Mar 2016
Posts: 37

PostPosted: Sat Mar 12, 2016 17:47    Post subject: Reply with quote
Yes, it is my provider. They block some websites for some reason. Even official goverment websites Shocked

I tried 2 other internet providers and 1 doesn't block the http://qnapware.zyxmon.org/ website. I even tried a free VPN server to bypass provider blocks and turn all firewalls off. Although PuTTY still can't connect to the server. PuTTY now says that the server is unreachable ... Question

Well, I guess it's just my luck.

Thanks for the help though!


:~# /tmp/mnt/sda1/opt/entware-arm.sh
Info: Checking for prerequisites and creating folders...
Folder /opt/bin exists!
If something goes wrong please clean /opt folder and try again.
Folder /opt/etc exists!
If something goes wrong please clean /opt folder and try again.
Folder /opt/include exists!
If something goes wrong please clean /opt folder and try again.
Folder /opt/lib exists!
If something goes wrong please clean /opt folder and try again.
Folder /opt/sbin exists!
If something goes wrong please clean /opt folder and try again.
Folder /opt/share exists!
If something goes wrong please clean /opt folder and try again.
Folder /opt/tmp exists!
If something goes wrong please clean /opt folder and try again.
Folder /opt/usr exists!
If something goes wrong please clean /opt folder and try again.
Folder /opt/var exists!
If something goes wrong please clean /opt folder and try again.
Info: Opkg package manager deployment...
Connecting to qnapware.zyxmon.org (81.4.123.217:80)
wget: can't connect to remote host (81.4.123.217): Host is unreachable
chmod: /opt/bin/opkg: No such file or directory
Connecting to qnapware.zyxmon.org (81.4.123.217:80)
wget: can't connect to remote host (81.4.123.217): Host is unreachable
Connecting to qnapware.zyxmon.org (81.4.123.217:80)
wget: can't connect to remote host (81.4.123.217): Host is unreachable
chmod: ld-2.20.so: No such file or directory
ln: ld-linux.so.3: File exists
Connecting to qnapware.zyxmon.org (81.4.123.217:80)
wget: can't connect to remote host (81.4.123.217): Host is unreachable
ln: libc.so.6: File exists
Info: Basic packages installation...
/tmp/mnt/sda1/opt/entware-arm.sh: line 49: /opt/bin/opkg: not found
/tmp/mnt/sda1/opt/entware-arm.sh: line 50: /opt/bin/opkg: not found
Connecting to qnapware.zyxmon.org (81.4.123.217:80)
wget: can't connect to remote host (81.4.123.217): Host is unreachable
Info: Congratulations!
Info: If there are no errors above then Entware.arm successfully initialized.
Info: Add /opt/bin & /opt/sbin to your PATH variable
Info: Add '/opt/etc/init.d/rc.unslung start' to startup script for Entware.arm services to start
Info: Found a Bug? Please report at https://github.com/zyxmon/entware-arm/issues
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum