I have ssh-access to my raspberry pi. I want to automate it, especially the transmission-daemon. I already set it up so I can use it manually. I have web-interface-access from every device in my network and can use android remote apps for transmission. I'm using the RPC-whitelist without problems. Except one:
I want to write some scripts to control the daemon. To control it I think transmission-remote should be the right thing (isn't it?). I can use it from any device with the daemon and it works. Except from the raspberry pi itself. This is really bad since the scripts are supposed to run on the raspberry pi (started via cron).
The hostname of my RPi is "homeserver".
I can do this on my computer (running ubuntu 12.10):
chocobai@pfubuntu:~$ transmission-remote homeserver -t all -S
homeserver:9091/transmission/rpc/ responded: "success"
chocobai@pfubuntu:~$
But on the raspberry something like this does not work:
pi@homeserver ~ $ transmission-remote -t all -S
Unexpected response: <h1>403: Forbidden</h1><p>Unauthorized IP Address.</p><p>Either disable the IP address whitelist or add your address to it.</p><p>If you're editing settings.json, see the 'rpc-whitelist' and 'rpc-whitelist-enabled' entries.</p><p>If you're still using ACLs, use a whitelist instead. See the transmission-daemon manpage for details.</p>uments":{},"method":"torrent-stop"}
pi@homeserver ~ $
Now you may want to see my RPC-settings from the settings.json. I rebooted and restarted the daemon already several times. I also tried different things in the whitelist. Now here the RPC settings:
"rpc-authentication-required": false,
"rpc-bind-address": "0.0.0.0",
"rpc-enabled": true,
"rpc-password": "{e8ca1abb0e2ed100615b48009bcc935b50e6404c2Nge2Ql1",
"rpc-port": 9091,
"rpc-url": "/transmission/",
"rpc-username": "",
"rpc-whitelist": "192.168.178.*,localhost,172.0.0.1",
"rpc-whitelist-enabled": true,
I'm sure it uses the right settings.json because otherwise the other accesses would still not work. Also it's the standard file in ~/.config/transmission-daemon/settings.json.
A second little problem which is maybe related: When I sudo reboot the RPi, the transmission-daemon starts, but is not accessible via web or apps. Then I make sudo killall transmission-daemon and start it just using transmission-daemon. I'm not sure why this is. There is no different user or something. Maybe it's something with permissions on the settings.json? I'm not that experienced and can't figure out which permission the daemon has when started after reboot. I don't even know why it gets started automatically.
pi@homeserver ~/.config/transmission-daemon $ ls -l | grep settings
-rw------- 1 pi pi 2211 Jan 21 22:55 settings.json
pi@homeserver ~/.config/transmission-daemon $
So this is my problem, I hope you can help me. The main goal is to control the daemon from the RPi itself with commands I can use in a small script or cron. Thanks.
transmission-remote -l --debug