Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 9 of 9
  1. #1
    Senior Member
    Join Date
    Aug 2010
    Posts
    154

    SB Touch Auto Reboot

    To keep my Raspberry Pi servers and players working smoothly, I use the cronjob command to make the units automatically reboot nightly or weekly, as appropriate. I'm convinced that this would also help with my various SB Touch players, which are on all the time but played infrequently and often suffer network problems until rebooted. Does anyone know a simple way to achieve this automatically?

    I've done numerous searches but haven't found anything which just does this as sweetly as with the RasPis.

    Thanks in advance.

    Chip

  2. #2
    Junior Member
    Join Date
    Mar 2012
    Posts
    14
    Quote Originally Posted by ChipMonk View Post
    To keep my Raspberry Pi servers and players working smoothly, I use the cronjob command to make the units automatically reboot nightly or weekly, as appropriate. I'm convinced that this would also help with my various SB Touch players, which are on all the time but played infrequently and often suffer network problems until rebooted. Does anyone know a simple way to achieve this automatically?

    I've done numerous searches but haven't found anything which just does this as sweetly as with the RasPis.

    Thanks in advance.

    Chip
    I made this from my phone with tasker and ssh plugin...
    How do you made with raspberry?

  3. #3
    Senior Member
    Join Date
    Aug 2010
    Posts
    154
    Quote Originally Posted by dettofatto View Post
    How do you made with raspberry?
    SSH into RasPi
    execute this command:
    crontab -e

    The file is opened in nano

    And add this as the last line:
    0 3 * * * sudo /sbin/shutdown -r now

    To exit press CTRL-X and save the file.

    The job is then active and the raspberry will perform a reboot at 3 oĺclock at night.

  4. #4
    Junior Member
    Join Date
    Mar 2012
    Posts
    14
    Quote Originally Posted by ChipMonk View Post
    SSH into RasPi
    execute this command:
    crontab -e

    The file is opened in nano

    And add this as the last line:
    0 3 * * * sudo /sbin/shutdown -r now

    To exit press CTRL-X and save the file.

    The job is then active and the raspberry will perform a reboot at 3 oĺclock at night.
    Thanks!

  5. #5
    Junior Member
    Join Date
    Mar 2012
    Posts
    14

    I've done...

    I've rebooted my touch with raspberry with cron job.

    i've done with this file, and you can run via cronjob

    Code:
    #!/usr/bin/expect
    # Script to start our application
    spawn ssh root@ip of your touch
    sleep 1
    expect ":"
    sleep 1
    expect ":"
    send "yes\r"
    sleep 1
    send "1234\r"
    sleep 1
    expect "*#"
    sleep 1
    send "reboot\r"
    sleep 1
    send "reboot\r"
    You must install before expect:
    sudo apt-get install expect
    Last edited by dettofatto; 2015-08-10 at 04:54.

  6. #6
    Senior Member
    Join Date
    Aug 2010
    Posts
    154
    Quote Originally Posted by dettofatto View Post
    I've rebooted my touch with raspberry with cron job.

    i've done with this file, and you can run via cronjob

    You must install before expect:
    sudo apt-get install expect
    That's very interesting dettofatto. May I just run through that again so I'm quite sure what you're suggesting (my linux knowledge is very limited).

    You're using the RasPi to interrogate the Touch via SSH?

    And the "expect" program is installed on the RasPi?

    And the script you've provided is input into "expect"? I haven't come across "expect" so not sure of its capabilities.

    And "expect" is triggered by cronjob on the RasPi

    Somehow I thought that, since the SB Touch uses a linux OS that it should be possible to add something within the Touch software so it would be able to reboot without any external interaction. That would still be my preferred solution, provided it didn't compromise the Touch in any way, but your suggestion certainly gives me an option I hadn't considered.

    Many thanks

  7. #7
    Junior Member
    Join Date
    Mar 2012
    Posts
    14
    You must install expect on your raspberry with
    sudo apt-get install expect

    After you must create that file
    mkdir ./bin
    cd ./bin

    Create the script using the nano text editor

    sudo nano reboot1

    In the nano editor, type the script:

    Paste my code
    Modify with yours touch's ip

    Ctrl+o
    Ctrl+x

    sudo chmod 755 reboot1

    Insert in your cronjob, that must execute your new file
    0 3 * * * sudo /home/pi/bin/reboot1

    And yes I reboot my touch via ssh and I must install except because we must send some inputs, only when we except some words or symbol.
    Also my knowledge of Linux (like my fake english) is very poor, but Google helps me!
    Last edited by dettofatto; 2015-08-10 at 17:19.

  8. #8
    Senior Member
    Join Date
    Aug 2010
    Posts
    154
    Quote Originally Posted by dettofatto View Post
    Also my knowledge of Linux (like my fake english) is very poor, but Google helps me!
    Thanks again dettofatto - you're not alone with limited Linux. I haven't a clue what all that script is doing but I'll give it a go in the next week or so, when I have more time.

    Cheers

  9. #9
    Junior Member
    Join Date
    Mar 2012
    Posts
    14
    Quote Originally Posted by dettofatto View Post
    You must install expect on your raspberry with
    sudo apt-get install expect

    After you must create that file
    mkdir ./bin
    cd ./bin

    Create the script using the nano text editor

    sudo nano reboot1

    In the nano editor, type the script:

    Paste my code
    Modify with yours touch's ip

    Ctrl+o
    Ctrl+x

    sudo chmod 755 reboot1

    Insert in your cronjob, that must execute your new file
    0 3 * * * sudo /home/pi/bin/reboot1

    And yes I reboot my touch via ssh and I must install except because we must send some inputs, only when we except some words or symbol.
    Also my knowledge of Linux (like my fake english) is very poor, but Google helps me!
    Now for some news on openssh, we must connect to our squeezebox with " spawn ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -c 3des-cbc root@iptouch "

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •