manually edit minidlna.conf? keep getting overwritten

Discussion in 'Tomato Firmware' started by onlinespending, May 16, 2012.

  1. onlinespending

    onlinespending Addicted to LI Member

    I am using TomatoUSB which has the nice GUI for controlling DLNA. However, there are a couple of options that are not included in the GUI which I wish to manually edit (root_container, so that I can keep the browsing clean, and friendly_name, so I can give it a more descriptive name, such as "DLNA Server"). I edit /etc/minidlna.conf but as soon as I even restart minidlna, the .conf file is being overwritten by the settings I had saved through the GUI (removing my root_container and friendly_name settings). I even went as far as trying to write my minidlna.conf to nvram. Is there another location that Tomato stores its .conf?
  2. shibby20

    shibby20 Network Guru Member

    no, but config file is re-generation every time when you click save button. You can disable minidlna from GUI, copy minidlna.conf file from /etc to /jffs or usb drive, edit conf file and start minidlna manually
    minidlna -f /path/to/minidlna.conf
  3. onlinespending

    onlinespending Addicted to LI Member

    Thanks! Now of course it'd be great to see those options added to the GUI ;-)
  4. akswiff

    akswiff New Member Member


    very old thread but exactly my issue, so I try this before starting a new one.

    So easy that it's never explained in detail (I searched a lot):
    I want to edit minidlna.conf but I don't know how!
    I know it's in (/tmp)/etc/ but I can't just add this Directory in Windows as it's not visible right?
    Guess I need to access the file via putty/ssh but how exactly would I do this? Would be nice if someone could explain that!

    And if the issue with overwriting the config on each restart or save still exists, where do I put these comands to start minidlna manually?
    minidlna -f /path/to/minidlna.conf


    cp /mnt/DATA/dlna/minidlna.alt /etc
    service dlna restart


    nvram setfile2nvram /etc/minidlna.alt
  5. Monk E. Boy

    Monk E. Boy Network Guru Member

    Connect to your router via ssh. putty is a free ssh client for windows if you're stuck here.

    Use vi to edit the minidlna.conf file to add whatever options you want that aren't in the GUI (although if the options are in the GUI you're far better off sticking to it). You may need to google how to use vi. i puts vi into insert mode which should be fairly easy to use (just use the cursor keys to move around, to add a new line you have to move to the end of the line above it then hit enter), escape takes it out of insert mode, once escaped out :wq writes changes to the current file and quits.

    Copy the updated minidlna.conf file off to a location that will survive a reboot. Typically this means a USB drive but if you lack a USB port you can enable/format jffs and store it there.

    After you have a static minidlna.conf file add minidlna -f /path/to/minidlna.conf (with /path/to/ being replaced with the actual path to the minidlna.conf file you saved off in the previous step) to administration -> scripts -> firewall.

    You can now either reboot the router to trigger the firewall script or manually start minidlna -f /path/to/minidlna.conf from Tools -> System.

    Just be really careful of what you type while you're in vi, it's very easy to get it completely messed up by not being in insert mode when you start typing. The only way out at that point is to either shut down your ssh session or try to escape out and type :q! to force it to quit without saving changes. I absolutely loathe vi's interface but it's the only damn thing present on every Unix box so I've stuck with remembering the bare minimum... and a vi cheatsheet tacked to my wall.
    Last edited: Oct 5, 2016
  6. akswiff

    akswiff New Member Member

    Thanks for the explanation!
    I remembered it was WinSCP I earlier used to access and edit the conf file (on a different router with DD-wrt).
    But now I actually managed to attach/open the folder in Windows explorer (just unhide and set write permission to hidden root folder in tomato GUI / samba file sharing) so I was able to edit minidlna.conf with a standard editor.
    The rest worked according to your description. But of course I also had to stop media server from tomato GUI.

    The reason was to set "Browse" as the one and only root folder, so I start directly in my folder, without the default Music/Pictures/Video stuff. Works as expected!
  7. akswiff

    akswiff New Member Member

    Do you happen to know if I can do this on the standard FW too?
    It's a ASUS RT-N18U. They all have ASUSWRT right? If this uses minidlna too, I could probably edit the .conf file the same way. Just have to find it and make sure it's not overwritten.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice