What's new
  • 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!

Running Asus DSL-N14U as AP, network storage and print server

So, I have one of these and my purpose is to run it as an AP, network storage and print server. I'll document what little I've learned and what I need, in case someone is interested.
I'm having a problem posting this, so I'll try posting it in parts.

So, what is this thing, then? Asus DSL-N14U is a big-endian MIPS device. The stock firmware runs a 2.6 kernel.
Linux DSL-N14U 2.6.22.15 #1 SMP Sat Nov 30 02:26:27 CST 2019 mips unknown
In case it isn't immediately obvious, it is a DSL modem. Wireless CAT suggests the processor is Ralink RT63365E. (The router version, RT-N14U, apparently runs a different processor, MediaTek MT7620N.)

Based on talk on the internet about ASUS routers, DSL-N14U is slightly different from other ASUS devices. Possibly because of it being MIPS, there is no nvram command-line tool, which many resources around the internet talk extensively about in relation to ASUS WRT. The cgi-bin/ scripts reference nvram functions but apparently it only exists as functions in some libraries. From what I can tell, instead of nvram there's tcapi. Tcapi is less useful because it always requires a node name and I haven't seen a list anywhere. Looking at some of the scripts, there are nodes such as Apps_Entry and Wanduck_COMMON. There's also USB_<Something I can't remember right now>. Apparently the part before the underscore seems to be enough, so e.g. Apps and USB are also accepted.

So, I'm running the device as an AP with it's LAN port connected to my actual modem LAN port. It doesn't have an AP mode as such but I basically just disabled DHCP and use the same subnet as the modem. The modem runs the DHCP and that works fine, because they're on the same subnet. I obviously still filter the MAC addresses on both devices.

Incidentally, if anyone else is running more than one router on their LAN, I very much suggest changing all their IP addresses to something else than 192.168.1.1.
That way, you'll be spared of any address conflicts, if you ever need to factory reset any of them. AFAIK, most, if not all, devices default to that address.

For the file storage, I simply stuck a 32 GB USB memory stick on it as I don't anticipate much use for it. It's NTFS, because I'm running Windows on my computer (yes, I know), and that choice does disallow the use of some features like links. Remains to be seen whether that becomes a problem.
 
As for custom scripting, I first couldn't get custom scripts to run (tried what was described in jarpatus/asuswrt_scripts on GitHub) - even on the original 1.1.0.4 firmware.
Updating the firmware to stock 1.1.2.3_805 and installing Download Master also installed the apps_init_run.sh script and created the init.d system on the flash drive.
After that, the procedure described by jarpatus runs stuff on startup without problems - you just need the init.d/S99scriptname and a /opt/lib/ipkg/info/scriptname.control file containing the line Enabled: yes. (99 and scriptname being whatever you wish.)

One thing to note, though, is that Download Master gets downloaded and installed from the internet. At least DSL-N14U requires that it detects a WAN connection for the install to work. I tried setting a 0.0.0.0/0 route to my modem but to no avail, although setting a route to the near-by NTP server worked for that service. What worked for DM install was setting the WAN to Ethernet WAN (and enabling it). I simply connected the chosen Ethernet WAN port to the modem LAN too and then I gave it a different IP address and also another MAC address (I simply incremented the last byte on the LAN one) on Special Requirement from ISP so that the modem wouldn't accidentally route those WAN packets to the LAN address.
I disconnected the WAN port cable once I was done but I might change to using that one instead. It'd be more proper but I haven't tested what it does to the AP clients' DHCP, for example. I also haven't even tested whether DM works with the LAN or the WAN port. I just feel that while the WAN port is more likely to "work", it may also bring with it all sorts of complications I don't actually need, since I have the separate modem to handle that stuff.

After installing the Download Master, things look like this:
Code:
# ls -lF /
drwxrwxr-x    2 admin    root          577 Nov 29  2019 bin/
drwxrwxr-x    4 admin    root           64 Nov 29  2019 boaroot/
drwxrwxrwt    5 admin    root         2280 Oct 24 11:27 dev/
lrwxrwxrwx    1 admin    root            8 Nov 29  2019 etc -> /tmp/etc/
lrwxrwxrwx    1 admin    root            9 Nov 29  2019 home -> /tmp/home/
drwxrwxr-x    3 admin    root         2245 Nov 29  2019 lib/
lrwxrwxrwx    1 admin    root           11 Nov 29  2019 linuxrc -> bin/busybox*
lrwxrwxrwx    1 admin    root            8 Nov 29  2019 mnt -> /tmp/mnt/
lrwxrwxrwx    1 admin    root            8 Nov 29  2019 opt -> /tmp/opt/
dr-xr-xr-x   85 admin    root            0 Jan  1  2000 proc/
drwxrwxr-x    3 admin    root           20 Nov 29  2019 rom/
lrwxrwxrwx    1 admin    root           14 Nov 29  2019 root -> /tmp/home/root/
drwxrwxr-x    2 admin    root          684 Nov 29  2019 sbin/
drwxr-xr-x   10 admin    root            0 Jan  1  2000 sys/
drwxrwxrwt   14 admin    root          780 Oct 24 14:41 tmp/
drwxrwxr-x    3 admin    root          302 Nov 29  2019 userfs/
drwxr-xr-x    8 admin    root          103 Nov 29  2019 usr/
lrwxrwxrwx    1 admin    root            8 Nov 29  2019 var -> /tmp/var/
#
Code:
# ls -lF /opt/
-rwxrwxrwx    1 admin    root        13018 Oct 20 19:59 S50asuslighttpd.1*
-rwxrwxrwx    1 admin    root        65672 Oct 20 19:59 S50downloadmaster.1*
drwxrwxrwx    1 admin    root         4096 Oct 17 02:39 bin/
drwxrwxrwx    1 admin    root            0 Oct 17 02:37 doc/
drwxrwxrwx    1 admin    root            0 Oct 23 10:24 etc/
drwxrwxrwx    1 admin    root            0 Oct 17 02:39 include/
drwxrwxrwx    1 admin    root        28672 Oct 17 02:39 lib/
drwxrwxrwx    1 admin    root            0 Oct 17 02:36 sbin/
drwxrwxrwx    1 admin    root            0 Oct 17 02:38 share/
drwxrwxrwx    1 admin    root            0 Oct 17 02:39 tmp/
drwxrwxrwx    1 admin    root            0 Oct 17 02:36 usr/
#

If you want to log stuff yourself, you can write to /var/log/messages. You'll have to use the logfile format or it'll e.g. break (and stop) dmesg output on that line. You get the correct format by something like date "+%Y-%m-%d %H:%M:%s [Informational] scriptname[$$]: logmessage" >> /var/log/messages. The problem with that is that it's an ordinary file that seems to get rotated to the device log rather erratically, possibly only when the there's another update. You can also do echo logmessage >> /dev/kmsg , which gets your message on the log immediately, but the downside is that the device log shows the entry as coming from the kernel i.e. the scriptname[PID] part simply reads kernel.
 
Why am I talking about custom scripts anyway? Well, I have a GDI printer, HP LaserJet 1018. It requires the firmware to be downloaded before printing (just once after being turned on). That's simple: cat sihp1018.dl >> /dev/lp0. So, I need to daemonize a script to monitor the attachment and detachment of the printer. One way to do it is to read and monitor the device log at /var/log/currLogFile. USB attach and remove events are shown there. (I already have a somewhat working script to that effect that keeps state by doing tail -n 1 in the main shell to control how far the subshell reads, which allows it to also control the starting position. The idea being that you can then start reading the log from the beginning and not miss the printer appearing before the script is run.) But it turns out you don't have to do that, because the printer state is also tracked by one of the tcapi variables: one can simply execute tcapi get USB usb_path_lp0 to see whether the printer is currently connected.
And, yes, you can have both the printer and the storage connected. I, for example, have a cheap Hama 4-port USB 2.0 hub allowing me to do just that.

Of course, having the firmware loaded on the printer still only allows printing from network clients that talk it's language i.e. the clients that have installed the drivers for the printer. If you have the drivers, the LPR printing works fine for me at least when byte counting is enabled. It's just that a big part of the reason for me to have a print server is to be able to print directly from tablets and phones and such and that means having an lpd that supports input filtering so that the print server can do the conversion. The stock firmware lpd doesn't even have printcap.
I'm looking to see if I can use CUPS but the problem with that is that the only prebuilt packages I can find for big-endian MIPS are from Entware and for kernel version 3.4. That might require some wrangling and, anyway, it's a big leap from 2.6, so.... (If someone wants to provide some packages...)
 
Why am I using the stock firmware? Well, quite frankly it still seems like less of a hassle, in a way. I'm looking to get a working setup. I'm not looking for a hobby. The stock firmware works for me, except for the printer driver requirement and that might be fixable. Or not. We'll see. I'll try to post updates if I can get anywhere with it.
I don't have the cross-compile environment set up. I don't want to start setting one up on Windows, if it even is possible, and I won't start running Linux just for that. I also don't want to compile firmwares as it is exactly the kind of thing that can suck up all your time and require a lot of work, if anything goes even slightly wrong.
As for existing firmware binaries, I don't think there are builds available for DSL-N14U or RT63365E. There are OpenWRT builds for RT-N14U but it looks like a sufficiently different device that it could be a cause for some serious headaches or bricking.
TBH, I might feel differently about a custom firmware, though, if a working prebuilt firmware was available for the device but I'm not looking to become a guinea pig for a long alpha-stage development project, if you get what I mean.
Though I'd like the printer on the network, I've managed so far without it and, at the end of the day, can do so in the future.
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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