Scooter

Twonky Rebuild

Recommended Posts

Lost my bookmark for doing a rebuild on Twonky can anyone tell me what it is please. If I remember I think Duggie gave it on the Linn forum some time back. It's something like http://192.168.1.89:8080/rbd. 

Share this post


Link to post
Share on other sites

I thought I still had the info but it would appear not. It's many years since I used Twonky. Briain's your man - might be worth a PM to him as he only visits here infrequently.

Mick

Share this post


Link to post
Share on other sites

Thanks, it was Brian some time back on the old Linn forum. This forum has tumbleweed blowing across it doesn’t it, nothing like the old Linn forum.

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

Hi

Sorry for not chipping in in a more timely manner, but I don't often visit the audio forum, these days. Firstly, don't panic at the length of this post as you can ignore all the stuff that I've typed below the dotted line (the rest is just to help anyone searching for Twonky problems and finding this thread)!

You were actually very close with the 'rpd' part, but it is actually rpc, where the 'rpc' part referrs to a (universal) technique known as sending a 'Remote Procedure Call' to a remote server. What I loved about Twonky was that there were a whole bunch of these Remote Procedure Calls that one could perform to make it do things or to change its settings, and below are just a few of handy ones:

The handy Twonky RPC's (ones that most folks will find useful for day user 'maintenance'):

These are used in the form http://IP:port/rpc/<command> so in the below examples, I'll just list the ones I have used on my own server (which resides on 10.11.11.22) and it resides on the default port of 9000 (which can be changed; from memory, the ancient ReadyNAS used 8200).

http://10.11.11.22:9000/rpc/restart (restarts Twonky)
http://10.11.11.22:9000/rpc/rebuild (rebuilds Twonky database)
http://10.11.11.22:9000/rpc/rescan (rescans for newly added media)
http://10.11.11.22:9000/rpc/get_all (shows all settings in the Twonky ini file)

These are the most useful ones, but as I'm very seldom here (and as there aren't old Linn posts available) it's wort appending this post with some more nerdy stuff, just in case in the future, it helps give ideas to anyone searching for answers on how to do something more 'bespoke' than just a database rebuild (so most folks can ignore all the below stuff).

Incidentally, after entering the above, you should get a response in your browser window, for example, after entering the /rpc/restart command, by browser shows the below response:

The server is restarting. This might take a few seconds.

So if you get no response at all, check that you have typed the command correctly into the browser's URL field.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Format examples to illustrate using the more advanced Twonky RPC's (of which there are too many to list):

You can also do a bunch of more 'geeky' type management things via using the 'set_option?' command, like setting or changing the paths to the media directories, moving the directory in which Twonky stores its database, move the directory that Twonky uses to store its image cache (shown below) pinning it to using a particular IP address (handy for servers that have more than one Ethernet port) or indeed, changing the port (so you can change it from 9000 to a port of your choosing). In fact, you can change many of the settings listed within the ini file (as shown by that get_all command) via variations on the below examples (the parameters being the names that you see in the ini file line, or from the get_all trick).

http://10.11.11.22:9000/rpc/set_option?ip=10.11.11.22 (binds Twonky to a single IP, in this example, it would bind it to 10.11.11.22)
http://10.11.11.22:9000/rpc/set_option?cachedir=/<your new chosen path> (changes cache directory)
http://10.11.11.22:9000/rpc/set_option?cachemaxsize=<your chosen max size> (sets maximum size that cache directory can grow to).

Before performing any settings changes via RPC calls such as the above three, it is important to establish both where the ini file resides and what it is called (in case you have to manually edit it or delete it; see footnote) and that can be done via running the /rpc/get_all command and looking for the lines shown below:

ininame=
inipath=

On one of my older NAS units, it was ininame=twonkymedia-server.ini, but on my current Qnap, it is now named (and located) as is shown below (and I've seen instances where it is called something else, too). Obviously, where it resides depends on the make of NAS (or even the model of the NAS and its particular RAID configuration).

Example from my Qnap TS-453A:

ininame=twonkyserver.ini
inipath=/share/CACHEDEV1_DATA/.qpkg/TwonkyServerEU/appdata

Example from another server:

ininame=twonkyvision-mediaserver6.ini
inipath=/etc/config

I don't think that absolutely all of the ini file entries can be directly changed via RPC calls, but many of them can, and as I used to do a lot of testing work, some of these were very useful (for example, when debugging an issue where Twonky wasn't correctly parsing art from the FLAC files, I used the set_option?cachedir to move the cache onto a NAS share, so I could then easily inspect the cache for art problems). I also often had to install beta versions Twonky on several devices (I was once sent 4 beta versions over a 2 day period) and it was far faster to set each new instance up via entering the basic parameters by using a pre-written list of RPC calls (including applying the key, back in the day). Basically, I'm very lazy and it was a lot faster than navigating through and populating the Twonky web interface.

A new one to test Internet access (introduced a few versions into Twonky 8):

Of course, Twonky has radically changed since the days when I used to help debug features (I still use Twonky 6.0.39 as that facilitates fully custom menus, or 'trees' as they are actually called) so perhaps some RPC's have now been depreciated and others have been added, but I do have a pretty current version of Twonky 8 on one of my NAS units and as I use an enterprise firewall (with https inspection and thus I require my own 'certificate authority installed in the root certificate store on all my devices) I did have a problem with the new Twonky on-line system which it calls home to (to verify the license) when Twonky starts up. Okay, this will not be an issue for most folks, but as part of my investigations (in conjunction with Twonky support) one thing that I did find out was that the they had introduced a new faulting RPC (just a few versions back) which facilitates testing of the communication (from the Twonky server installation's perspective) back to their server, so it could be handy if anyone is experiencing an odd problem (as in, install or restart Twonky and you see no media) so I'll publish it here, just in case anyone ever finds it handy:

http://10.11.11.22:9000/rpc/check_backend

On my one, they all failed (which is good as it shows that my 'firewall' - Sophos UTM - was doing its job) so I then sorted out a path to Twonky's www server and after re-running the above, I then got a successful result (the returned results shown below):

Lynx authentication check list:

TIME: OK
RW: OK
TLS: OK
DNS: OK
HTTP: OK
HTTPS: OK
DB: OK

So, not many folks will have to use that back end test RPC, but it is a nice and fast test should you ever have an issue with Twonky 8 not showing media (first try the above to see if it can 'call home').

Bri

PS If one makes a mess of the ini file via typos in the 'set_option?' type calls (and you cannot find and change which setting broke things) then as a last resort, it is entirely safe to delete the ini file and restart Twonky (or reboot the NAS) and that will build a new ini file, based upon settings in a default ini file (this is the file used to pre-configure Twonky with basic settings, like the paths to media directories on a particular vendor's NAS or their bespoke port, for example) but of course, you will have to re-apply any personal settings (changes to the paths and your key, for example).

Edited by Briain
  • Like 1

Share this post


Link to post
Share on other sites

Thank you Brian. You did give me the address on the old Linn forum. My Grand daughter "lost" the book marks and I couldn't remember them. I do use Twonky occasionally but it still has it's problems. It's very rare I rip a CD but when I do they tend to go into the Various folder no matter what or who the artist is. It decided some time to place about 40 albums into the various folder and I cannot fathom out why. So I have just put it down to Twonky. I do a rebuild about once month out of habit really more than anything else. I've cut and pasted your reply onto a document to save on the cloud so I don't lose it again. It also shows how good the old Linn forum was, I would have found it on there no problem. Thank you once again.

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.