What's new

How to auto-run code as a service on Asuswrt-Merlin?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

boerlx

Occasional Visitor
I’m seeking a little help on how to auto-run at boot as a service the following code « udp-proxy-2020 » on my Asus RT-AC68U running Merlin v386.3_2.

I’m using Roon (music player/server) and this code was written specifically, if I understand, to forward UDP broadcast messages on my LAN over my OpenVPN connections — in that case my iPhone connected to my routers OpenVPN server in tun mode.
All this in order to be able to listen to music remotely on my iPhone using Roon.

I also have a second OpenVPN server set up on my router in tap mode to which I connect with a remote desktop computer. With this set-up the Roon server UDP broadcast message are already forwarded and I can browse and listen to my Roon music library remotely.

I had first contacted the author of this code on Roon user forums and he advised me to ask for some help on how to run this code as a service on my specific router on a more specific forum. So here I am.
 
Before even thinking about running it as a service I'd check that it runs at all. I suspect the pre-built binaries will not work.
 
Before even thinking about running it as a service I'd check that it runs at all. I suspect the pre-built binaries will not work.
I though about that but unfortunately I don't know yet how to do this.
should I copy the binarie to /jffs/scripts/ ?
I believe it needs libpcap is this already installed in Asuswrt-Merlin ?
to test it, can I simply type it in the terminal when I'm connected to the router with ssh ?
thanks.
 
Try following the instructions in the README. Copy the binary to somewhere on your router and run ./udp-proxy-2020 --help
 
Asuswrt-Merlin does not include the dependencies libpcap and golang you need, but you can install them through entware. Also don't forget to give your binary file proper permissions, you may also need to write a script for it to make sure it will run after the router or OVPN is started.


You can always use the top command to check if it is running
 
Asuswrt-Merlin does not include the dependencies libpcap and golang you need, but you can install them through entware. Also don't forget to give your binary file proper permissions, you may also need to write a script for it to make sure it will run after the router or OVPN is started.


You can always use the top command to check if it is running
thanks for this.
I checked how to install entware in the asuswrt-merlin wiki. Do I need to uninstall DownloadMaster as mentioned (I never used it) and if yes I do I do this?
Also will the command chmod a+rx give my binary the proper permissions?
(yep I'm kind of a beginner in this linux command line thing : )
 
Don't bother installing Entware prior to initially testing whether the executable will run or not (yes chmod a+rx is correct). You're just creating extra work for yourself. If it needs external libraries like libpcap it's likely to give an error message to that effect. Then you can think about what to do next.

Even if it does require external libraries it's almost certain those provided by Entware are not going to be of any use as they are compiled for a different environment than the binary is.
 
Please forgive my careless answer, I must agree with the possibility @ColinTaylor pointed out here, considering that the binary file is not built for Asuswrt at all, so it may not even be able to interact with system components. And entware will not help, because the path of entware cannot be used by the binary file.

The best way is to run it as @ColinTaylor said, and see if any errors are returned. Then think about what we should do.

But it is very likely that you need the developer of the binary file to adapt to Asuswrt and Asuswrt-Merlin, because this is a very rare requirement.


By the way, Asuswrt has its own iTunes server. If you save your music in the USB behind the router, you may be able to play music on your phone, but I have never tried this.
 
Out of interest I tried to run on my AC68U:

Code:
admin@r1:/tmp/home/root# ./udp-proxy-2020-0.0.8-linux-arm32
FATAL: kernel too old
Aborted
 
By the way, Asuswrt has its own iTunes server. If you save your music in the USB behind the router, you may be able to play music on your phone, but I have never tried this.
Well, the point was to be able to use Roon and not iTunes or something else such as Plex, Subsonic, etc. This way one can take avantage of unified play cout, tagging (stars, likes) album or tracks will be added/modified on the Roon core database as well as taking advantage of dsp engine (crossfeed, parametric eq, …)
 
Out of interest I tried to run on my AC68U:

Code:
admin@r1:/tmp/home/root# ./udp-proxy-2020-0.0.8-linux-arm32
FATAL: kernel too old
Aborted
Thanks for this. The author of the code had replied on the Roon forum that I'll probably have to test which binary works among the different ones for ARM he released.


By the way, what terminal command do you use to run the code in Asuswrt-Merlin ?
 
Out of interest I tried to run on my AC68U:

Code:
admin@r1:/tmp/home/root# ./udp-proxy-2020-0.0.8-linux-arm32
FATAL: kernel too old
Aborted
If this is the case, the developer must be compatible with Asuswrt and Asuswrt-Merlin. Since this is a consumer router, the kernel will usually not be updated in the future.

Well, the point was to be able to use Roon and not iTunes or something else such as Plex, Subsonic, etc. This way one can take avantage of unified play cout, tagging (stars, likes) album or tracks will be added/modified on the Roon core database as well as taking advantage of dsp engine (crossfeed, parametric eq, …)

If it is me, I will consider whether you can connect to your computer remotely under tun. If so, you may be able to make it work without a "UDP proxy".

This actually only needs to configure some firewall rules and forwarding.

Check out this thread, it might help.
 
I found out how to copy binaries from my mac to the Asus RT-AC68U and run them for a test : )
I'll try the different flavours of compiled ARM binaries on the GitHub and see…
 
Ok I tried to run all the allready compiled ARM binaries on the udp-proxy-2020 GitHub and they all similar error that @PeterR reported.
I will check back with the code author and see if there is a way to compile the code for this specific router.
Thanks to all for your replies.
 
If it is me, I will consider whether you can connect to your computer remotely under tun. If so, you may be able to make it work without a "UDP proxy".

This actually only needs to configure some firewall rules and forwarding.

Check out this thread, it might help.
I actually can connect to my computer remotely under tun (with my iPhone). I can even connect to my Roon core but the problem is that I cannot see my iPhone audio out as an endpoint (this means the Roon core does not see my iPhone through the network as an option to send audio to). This is where the udp-proxy-2020 binary comes into play to forward UDP broadcast messages to make this possible under tun.

If I connect to my computer remotely under tap, everything works but tap is unfortunately not possible on iOS.
 
I was playing with my LTS fork, and included a program, udp-broadcast-relay-redux, which may work for you. No other dependancies. Since you are running an AC68, the binary from the fork should just run.
I put the binary and README up if you want to give it a try....
 
I was playing with my LTS fork, and included a program, udp-broadcast-relay-redux, which may work for you. No other dependancies. Since you are running an AC68, the binary from the fork should just run.
I put the binary and README up if you want to give it a try....
thanks for this.

I copied your binary on my router and it seems to run.
If I ./udp-broadcast-relay I get usage instructions and a description text.

How do I run it as root and how should I use it knowing the Roon Core is on a mac on my LAN connected by ethernet to the router and my iphone using Roon for iOS is connected to the router OpenVPN tun server either by WiFi or cellular data ?
(I also have a 2nd OpenVPN server on the same router in tap mode for computer use)
The UPD port where Roon is sending broadcast messages should be 9003.
 
How do I run it as root and how should I use it knowing the Roon Core is on a mac on my LAN connected by ethernet to the router and my iphone using Roon for iOS is connected to the router OpenVPN tun server either by WiFi or cellular data ?
Everything (well almost everythings) runs as root....so don't worry about that. Try something simple first since it seems to execute

udp-broadcast-relay --id 1 --port 9003 --dev br0 --dev tun21

assuming the openvpn server is instance 1
 
Everything (well almost everythings) runs as root....so don't worry about that. Try something simple first since it seems to execute

udp-broadcast-relay --id 1 --port 9003 --dev br0 --dev tun21

assuming the openvpn server is instance 1
I tried to execute the above commande.
I typed ./udp-broadcast-relay --id 1 --port 9003 --dev br0 --dev tun21
I got empty void in the terminal… there was no prompt after. The router was still working. I them quit the terminal and then re logged to the router with ssh.
I also tried with my iphone to connect to the Roon core when on cellular data which I still could but the iphone was still not available as an audio endpoint.
So far does not seem to be working… yet
 
I tried to execute the above commande.
I typed ./udp-broadcast-relay --id 1 --port 9003 --dev br0 --dev tun21
I got empty void in the terminal… there was no prompt after. The router was still working. I them quit the terminal and then re logged to the router with ssh.
I also tried with my iphone to connect to the Roon core when on cellular data which I still could but the iphone was still not available as an audio endpoint.
So far does not seem to be working… yet
I also tried the top command but did not see it running
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top