BubbleUPNP Install Guide

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • BubbleUPNP Install Guide

      Thanks to @shadowzero and his excellent Serviio Install Guide, I've been happily using Serviio for a couple years. However, I recently was given a ChromeCast, but was frustrated by it's inability to stream content from the local network. After some searching, I came across BubbleUPNP which does exactly what I needed, but was a bit of a pain to install. I documented all my steps and am sharing it here in case it may be of use to anyone else.

      BubbleUPNP Install Guide
      Requirements: a UPNP server (anything should work, I use Serviio) BubbleUPNP, Java 8.x, Android Phone
      Pre-Installaion:
      1. Check for Java

        Source Code

        1. java -version

        If it's installed you'll get output similar to below and can skip installing Java and go immediately to step 1
        [quote]java version "1.8.0_72"
        Java(TM) SE Runtime Environment (build 1.8.0_72-b15)
        Java HotSpot(TM) 64-Bit Server VM (build 25.72-b15, mixed mode)
        [/quote]
      2. add the Java 8 repository, then install the Java 8 runtime

        Source Code

        1. echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list
        2. echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
        3. apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
        4. apt-get update
        5. apt-get install oracle-java8-installer
      3. Set Oracle Java 8 as the default on the system:

        Source Code

        1. apt-get install oracle-java8-set-default
      Installation:
      1. The first step is to download BubbleUPNP:

        Source Code

        1. wget http://www.bubblesoftapps.com/bubbleupnpserver/BubbleUPnPServer-distrib.zip

        Then unzip it:

        Source Code

        1. unzip BubbleUPnPServer-distrib.zip -d bubbleupnp

        You'll also need ffmpeg in the BubbleUPNP directory for it to function properly:
      2. Source Code

        1. wget http://www.bubblesoftapps.com/bubbleupnpserver/core/ffmpeg_linux.zip

        ffmpeg needs to be unzipped as well:

        Source Code

        1. unzip ffmpeg_linux.zip -d bubbleupnp
      3. Move BubbleUPNP to a better location than your home directory:

        Source Code

        1. mv bubbleupnp /usr/local/bubbleupnp
      4. And make things executable:

        Source Code

        1. chmod +x /usr/local/bubbleupnp/ffmpeg
        2. chmod +x /usr/local/bubbleupnp/ffprobe
        3. chmod +x /usr/local/bubbleupnp/launch.sh
      5. You don't want services running as root (security risk!), so we'll create a new user that will only be responsible for running BubbleUPNP:

        Source Code

        1. useradd -s /usr/sbin/nologin -d /usr/local/bubbleupnp -r -M -U bubbleupnp
      6. our new user needs to own the folder in order to do it's job:

        Source Code

        1. chown -R bubbleupnp:bubbleupnp /usr/local/bubbleupnp
      7. It's time to create our startup script. Open nano (or the text editor of your choice):

        Source Code

        1. nano /etc/init.d/bubbleupnp

        and paste in the following:

        Shell-Script

        1. #!/bin/bash
        2. ### BEGIN INIT INFO
        3. # Provides: BubbleServer
        4. # Required-Start: $remote_fs $syslog
        5. # Required-Stop: $remote_fs $syslog
        6. # Default-Start: 2 3 4 5
        7. # Default-Stop: 0 1 6
        8. # Short-Description: BubbleUPnP Server Background Service Management
        9. # Description: Used to ensure BubbleUPnP starts/stops etc
        10. ### END INIT INFO
        11. . /lib/lsb/init-functions
        12. if [ -f /etc/default/rcS ]; then
        13. . /etc/default/rcS
        14. fi
        15. DAEMON="/usr/local/bubbleupnp/launch.sh"
        16. DAEMONOPTS=""
        17. NAME="bubbleupnp"
        18. DESC="Runs BubbleUPnPServer"
        19. PIDFILE=/var/run/$NAME.pid
        20. SCRIPTNAME=/etc/init.d/$NAME
        21. DAEMON_STOP=" -stop"
        22. SERVICE_ACCOUNT="bubbleupnp" ## DON'T RUN UNDER ROOT!
        23. TIMEOUT=3
        24. DAEMON_PATH="/usr/local/bubbleupnp/"
        25. case "$1" in
        26. start)
        27. printf "%-50s" "Starting $NAME..."
        28. cd $DAEMON_PATH
        29. PID=`sudo -u $SERVICE_ACCOUNT $DAEMON $DAEMONOPTS > /dev/null 2>&1 & echo $!`
        30. #echo "Saving PID" $PID " to " $PIDFILE
        31. if [ -z $PID ]; then
        32. printf "%sn" "Fail"
        33. else
        34. echo $PID > $PIDFILE
        35. printf "%sn" "Ok"
        36. fi
        37. ;;
        38. status)
        39. printf "%-50s" "Checking $NAME..."
        40. if [ -f $PIDFILE ]; then
        41. PID=`cat $PIDFILE`
        42. if [ -z "`ps axf | grep ${PID} | grep -v grep`" ]; then
        43. printf "%sn" "Process dead but pidfile exists"
        44. else
        45. echo "Running"
        46. fi
        47. else
        48. printf "%sn" "Service not running"
        49. fi
        50. ;;
        51. stop)
        52. printf "%-50s" "Stopping $NAME"
        53. PID=`cat $PIDFILE`
        54. cd $DAEMON_PATH
        55. if [ -f $PIDFILE ]; then
        56. kill -HUP $PID
        57. printf "%sn" "Ok"
        58. rm -f $PIDFILE
        59. else
        60. printf "%sn" "pidfile not found"
        61. fi
        62. ;;
        63. restart)
        64. $0 stop
        65. $0 start
        66. ;;
        67. *)
        68. echo "Usage: $0 {status|start|stop|restart}"
        69. exit 1
        70. esac
        Display All

        Save it (Ctrl-o) and exit (Ctrl-x) the‭ editor.
        If you've made any changes to usernames, directories, etc, please ensure you make the necessary changes in the script as well.
      8. This script needs to be executable:

        Source Code

        1. chmod a+rx /etc/init.d/bubbleupnp

        And root needs to own it:

        Source Code

        1. sudo chown bubbleupnp:bubbleupnp /etc/init.d/bubbleupnp

        It needs to be added to startup:

        Source Code

        1. sudo update-rc.d bubbleupnp defaults
      9. The moment of truth! Let's start the service:

        Source Code

        1. service bubbleupnp start
      10. Did it work? Let's make sure it's running:

        Source Code

        1. service bubbleupnp status
      11. Time to configure the server!
        http://<server>:58050

      The post was edited 3 times, last by MorgothQ: corrected an error in the init script. Thanks @Chickenbaum! ().