1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

[SOLVED] JSON parse failed

Discussion in 'Asuswrt-Merlin' started by Steini, Aug 4, 2016.

  1. Steini

    Steini Occasional Visitor

    Joined:
    Jan 29, 2016
    Messages:
    18
    Location:
    Norway
    I was trying to Change settings in Transmission script and i got this error when tryin to start Transmission again:

    JSON parse failed in /opt/etc/transmission-daemon/settings.json at pos 0: SPECIAL_EXPECTED -- remaining text "/opt/etc/init.d/"[FAILED]

    I think I read somwhere that you can reset all settings.
    Can anyone help me to fix this again please?
     
  2. TeHashX

    TeHashX Very Senior Member

    Joined:
    Jul 6, 2012
    Messages:
    952
    Location:
    Europe
  3. Steini

    Steini Occasional Visitor

    Joined:
    Jan 29, 2016
    Messages:
    18
    Location:
    Norway
    Thank you for the script. I use putty but I have no experience so I have followed a guide to install transmission.
    In my script port forwarding was not enabled so I was just changing it to "true" to enable it. When I tried to start transmission again the error came up. Maybe I did something else without knowing it.

    I've been reading for hours in this forum and searched the Web for a solution but my basic skills in programming and Linux are zero so I'm just not able to make to much sense of these things.
    I'm not a newbie in making my home network work and have been playing around with my computers for years so I usually get things to work. :)

    In other words it would be of big help with some instructions or a guide on how to replace my current script to the one you posted a link.
    As I mentioned in my first post I think I read somewhere that it is a command that resets all settings but I can't find it.
    Also I think there are a command for updating or searching for new releases. It would be great to get a list of commands that works for things like that.

    I hope someone can point me in the right direction. :)
     
  4. TeHashX

    TeHashX Very Senior Member

    Joined:
    Jul 6, 2012
    Messages:
    952
    Location:
    Europe
    Optware or Entware?
     
  5. Steini

    Steini Occasional Visitor

    Joined:
    Jan 29, 2016
    Messages:
    18
    Location:
    Norway
    New Generation Optware.
     
  6. TeHashX

    TeHashX Very Senior Member

    Joined:
    Jul 6, 2012
    Messages:
    952
    Location:
    Europe
  7. Steini

    Steini Occasional Visitor

    Joined:
    Jan 29, 2016
    Messages:
    18
    Location:
    Norway
    Thanks. That is the guide I have followed. I can't see any answer there to the questions of this thread. Am I missing something?
     
  8. TeHashX

    TeHashX Very Senior Member

    Joined:
    Jul 6, 2012
    Messages:
    952
    Location:
    Europe
    You have to stop transmission for editing settings.json
    Code:
    /opt/etc/init.d/S95transmission stop
    Remove bad json file
    Code:
    rm /opt/etc/transmission-daemon/settings.json
    Create default one
    Code:
    cat >> /opt/etc/transmission-daemon/settings.json << 'EOF'
    {
        "alt-speed-down": 50,
        "alt-speed-enabled": false,
        "alt-speed-time-begin": 540,
        "alt-speed-time-day": 127,
        "alt-speed-time-enabled": false,
        "alt-speed-time-end": 1020,
        "alt-speed-up": 50,
        "bind-address-ipv4": "0.0.0.0",
        "bind-address-ipv6": "::",
        "blocklist-enabled": true,
        "blocklist-url": "http://list.iblocklist.com/?list=bt_level1",
        "cache-size-mb": 2,
        "dht-enabled": true,
        "download-dir": "/tmp/mnt/sda1/Transmission",
        "download-queue-enabled": true,
        "download-queue-size": 3,
        "encryption": 0,
        "idle-seeding-limit": 180,
        "idle-seeding-limit-enabled": true,
        "incomplete-dir": "/tmp/mnt/sda1/Transmission/Incomplete",
        "incomplete-dir-enabled": false,
        "lazy-bitfield-enabled": true,
        "lpd-enabled": false,
        "message-level": 2,
        "open-file-limit": 5,
        "peer-congestion-algorithm": "",
        "peer-id-ttl-hours": 6,
        "peer-limit-global": 80,
        "peer-limit-per-torrent": 30,
        "peer-port": 51413,
        "peer-port-random-high": 65535,
        "peer-port-random-low": 49152,
        "peer-port-random-on-start": false,
        "peer-socket-tos": "default",
        "pex-enabled": true,
        "pidfile": "/var/run/transmission-daemon.pid",
        "port-forwarding-enabled": true,
        "preallocation": 1,
        "prefetch-enabled": 1,
        "proxy": "",
        "proxy-auth-enabled": false,
        "proxy-auth-password": "",
        "proxy-auth-username": "",
        "proxy-enabled": false,
        "proxy-port": 80,
        "proxy-type": 0,
        "queue-stalled-enabled": true,
        "queue-stalled-minutes": 300,
        "ratio-limit": 7,
        "ratio-limit-enabled": true,
        "rename-partial-files": true,
        "rpc-authentication-required": true,
        "rpc-bind-address": "0.0.0.0",
        "rpc-enabled": true,
        "rpc-password": "admin",
        "rpc-port": 9091,
        "rpc-url": "/transmission/",
        "rpc-username": "admin",
        "rpc-whitelist": "*.*.*.*",
        "rpc-whitelist-enabled": false,
        "scrape-paused-torrents-enabled": true,
        "script-torrent-done-enabled": false,
        "script-torrent-done-filename": "",
        "seed-queue-enabled": false,
        "seed-queue-size": 10,
        "speed-limit-down": 100,
        "speed-limit-down-enabled": false,
        "speed-limit-up": 100,
        "speed-limit-up-enabled": false,
        "start-added-torrents": true,
        "trash-original-torrent-files": false,
        "umask": 0,
        "upload-slots-per-torrent": 10,
        "utp-enabled": false,
        "watch-dir": "/opt/etc/transmission/watchdir",
        "watch-dir-enabled": true
    }
    EOF
    Press ENTER

    To modify settings, open with nano editor
    Code:
    nano /opt/etc/transmission-daemon/settings.json
    Move with keyboard directions keys, do any changes, then save with "CTRL-O" (O from Omega not zero), Press ENTER, Exit nano with CTRL-X
    Start transmission again
    Code:
    /opt/etc/init.d/S95transmission start
     
  9. Steini

    Steini Occasional Visitor

    Joined:
    Jan 29, 2016
    Messages:
    18
    Location:
    Norway
    Thank you so much! I'll try that first thing when I come back home from work. I'll post here when I'm done.
    :)
     
  10. Steini

    Steini Occasional Visitor

    Joined:
    Jan 29, 2016
    Messages:
    18
    Location:
    Norway
    Now its working again! Thank you for the instructions.

    Thats the good thing and the bad thing is that I'm still struggeling with opening the port. If you look at the pictures you can see that: https://ipleak.net/ is seeing the right port open.
    2016-08-05 (1).png
    On the other hand is: http://www.canyouseeme.org/
    giving me an error.
    2016-08-05.png

    Also the private tracker I'm currently on for my torrents is also telling me I'm not connectable.

    Could there be some settings on the router that needs to be enabled?
    2016-08-05 (4).png

    Any ideas?
     

    Attached Files:

    Last edited: Aug 5, 2016
  11. TeHashX

    TeHashX Very Senior Member

    Joined:
    Jul 6, 2012
    Messages:
    952
    Location:
    Europe
    Did you created firewall rule? At the end of tutorial: ACCESS FROM WAN
     
  12. Steini

    Steini Occasional Visitor

    Joined:
    Jan 29, 2016
    Messages:
    18
    Location:
    Norway
    Yes, I did that when I installed the first time.
     
  13. TeHashX

    TeHashX Very Senior Member

    Joined:
    Jul 6, 2012
    Messages:
    952
    Location:
    Europe
    Post output from:
    ls - l /jffs/scripts
    cat /jffs/scripts/firewall-start
     
  14. Steini

    Steini Occasional Visitor

    Joined:
    Jan 29, 2016
    Messages:
    18
    Location:
    Norway
    Here is the output.
     

    Attached Files:

  15. TeHashX

    TeHashX Very Senior Member

    Joined:
    Jul 6, 2012
    Messages:
    952
    Location:
    Europe
    Didn't posted
    ls - l /jffs/scripts
     
  16. Steini

    Steini Occasional Visitor

    Joined:
    Jan 29, 2016
    Messages:
    18
    Location:
    Norway
    What does that mean?
    Nothing happens.
    2016-08-05 (5).png
     
  17. TeHashX

    TeHashX Very Senior Member

    Joined:
    Jul 6, 2012
    Messages:
    952
    Location:
    Europe
    Sorry, was a space before "l"
    ls -l /jffs/scripts
     
  18. Steini

    Steini Occasional Visitor

    Joined:
    Jan 29, 2016
    Messages:
    18
    Location:
    Norway
    2016-08-05 (6).png I posted the output in this area and got banned! :)
    But now I'm back again. :)

    Here is the output but I had to take a screenshot. It didnt upload as txt.
     
  19. TeHashX

    TeHashX Very Senior Member

    Joined:
    Jul 6, 2012
    Messages:
    952
    Location:
    Europe
    I just want to check permissions, are ok :)
    Now reboot router or apply firewall rule and should be ok
    sh /jffs/scripts/firewall-start
     
  20. Steini

    Steini Occasional Visitor

    Joined:
    Jan 29, 2016
    Messages:
    18
    Location:
    Norway
    I rebooted and applyed the firewall rule.
    Finally! Success. :-D
    2016-08-05 (7).png

    Thank you for helping me out. You made me a happy man. :-D