It’s 2015 and somehow I think that is a reason to simply have enough bandwidth for upload and download to help me with my digital life style. Cloud is in, and accessing files from everywhere is tempting. As cloud only means to be able to access data from any internet connection, I can host the data also at home. Only thing needed for this is a upload bandwidth that is not too slow. But what is the upload and download rate available in my data plan? I am a NET customer and after a few upgrades over the years I am not at 15 Mbps. This should give me 2 Mbps upload. How to measure this under Linux?
I found an easy tool to measure upload and download bandwidth: speedtest. It is not part of my Raspberry PI Debian Linux OS, so I had to install it first. After this I am able to check the upload rate and it comes close to the announced 2 Mbps.
Final step is to run the tool. It will automatically test the upload and download bandwidth.
Download bandwidth is reprted at 14.5 Mbit and upload at 1.86 Mbit.
Is this enough to stream for instance audio? Command bit rate for MP3 is 128, 192 or 256 Kbps. That is Kilobits per second. 2 Mbps is 2 Mbit == 2000 Kilobits. This is way above 192 Kbps. Streaming audio should not be a problem.
“Subsonic is an open source, web-based media server. It is written in Java, so it can run on any operating system with Java support. Subsonic supports streaming to multiple clients simultaneously, and supports any streamable media.” (Source: Wikipedia)
My first contact with Subsonic was several years ago. If memory serves me right, it was around 2008 when I was looking for a media software that can be accessed from remote. At that time, Subsonic and the internet didn’t serve me well enough in Rio de Janeiro to continue my endeavor with Subsonic. Only in 2015 I came back to it, thanks to Raspberry Pi. This combination gave me a new look at media access. Up to now the experience I have is good enough to make me want to share it with others. If you want to stream your private music collection without spending money on a cloud based server / service, this blog may be for you.
Install Java 8
Subsonic wants Java 8, and Java 8 is available for Raspberry Pi. You can also download it form the Oracle Java website. The version you need is the one compatible with the Raspberry Pi processor: jdk-8-oracle-arm-vfp-hflt. Or you install it using aptitude.
Command: sudo apt-get install oracle-java8-jdk
This downloads the required packages
Afterwards, Java 8 is configured.
To test if Java 8 is available and correctly installed, just call Java.
Command: java –version
The output shows that Java 8 is installed. Congratulations!
Java is installed, but for applications to know where to find it, an environment variable is used: JAVA_HOME. This variable points to the install dir of Java. To not have to configure this for each user, the configuration can be made global to all. The above command installed Java 8 at this location: /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt
In case the file wasn’t saved as subsonic-5.2.1.deb, rename it. You do not have to, but it makes things easier.
The file downloaded above is a deb file. These files are meant to be used by the debian package manager and contain the actual file to be installed and dependencies.
Command: sudo dpkg -i subsonic-5.2.1.deb
This installs and already starts subsonic. To see the output log:
Command: sudo tail /var/subsonic/subsonic_sh.log
Not exactly what we want, as now sSubsonic is already running, but not configured. To stop subsonic:
Command: sudo /etc/init.d/subsonic stop
Subsonic stores its data in default folders. By default, for Debian it is /var/subsonic. Because subsonic was already started, this folder is created and filled with content, using the default subsonic user: root (yep, BAD, very BAD!).
Subsonic will be run in the background at start as a service. For this to work, a subsonic user needs to be configured.
Command: sudo adduser subsonic
Add the user to the audio group, in caes you want subsonic to output audio.
Command: sudo adduser subsonic audio
How to make subsonic use that user and run under that user id and not as root? The user information is stored in the default subsonic configuration file: /etc/default/subsonic.
Command: more /etc/default/subsonic
The last line must be changed to: SUBSONIC_USER=subsonic
Subsonic can now be accessed, but I want to be able to access it through my standard web site (this one). I want to do that without having to do much port forwarding or virtual hosts. The easiest solution is to make use of Apache as a reverse proxy.
As subsonic will be run from behind a reverse proxy, the standard URL will be different: the URL used will be /subsonic. Therefore, the configuration of subsonic must be made aware of that. To find out the correct parameter, take a look at which parameters Subsonic supports.
Command: subsonic –help
The parameter is context-path. This parameter must be added to the config file.
Configure Apache Reverse Proxy
Add the following RP rules to the config file of the virtual server:
For reverse proxy to work, the module must be enabled.
Command: a2enmod proxy_http
Command: sudo apache2ctl restart
That’s it from the Apache as reverse proxy part. Subsonic is already configured to use the new URL and Apache is ready.
To be able to use Subsonic from the internet, just start it and check that everything is working correctly. Start subsonic:
Command: sudo /etc/init.d/subsonic start
Command: ls -alh /run/subsonic.pid
Created as user subsonic
Command: ps -ef | grep subsonic
Log on to Subsonic.
It may be useful to transcode some music files on the fly. For instance, when the consumed bandwidth is too high, FLAC is used or when the user is accessing Subsonic over a low bandwidth network like 4G in Brazil. Subsonic allows for automatic transcoding of files. This feature can be activated for each user and the sampling limit can also be specified. It is therefore possible to define a user for mobile client usage and specify a max bitrate of 128 Kbps for him. The max bandwidth is defined in the user section of the configuration settings.
The programs ffmpeg and lame are installed automatically when Subsonic was installed via Debian package manager.
Installing a SAP NetWeaver ABAP system is easy, keeping it up and running demands a little bit more. Don’t expect a NetWeaver ABAP system to just work, be prepared to do some additional configuration.
After starting the SAP NetWeaver ABAP instance, you are not able to connect to it. SAPGui tries to connect, but never finishes. This indicates that the message server accepts connections, but cannot process them. At the server, the startsap command executed successfully, it shows that ASCS and DI were started. But still, no connection is possible. What happened?
Taking a look into the dev_disp log reveals that really a problem is going on.
Log file: dev_disp
It is always a good idea to check the connection to the database (here: MaxDB).
To get more information about MaxDB database, dbmcli offers the info command: dmbcli info
Command: dbmcli -d GWD -u control,<password> info LOG
The above command reveals what is causing the problem. The log area is full:
Used size is 100%. MaxDB cannot write anything anoymore to the log area. The solution is to archive the log area so MaxDB gains more space for the log area and is able to save new entires to it. Another command that can be used to find out if the log area is full is:
Command: dbmcli -d GWD -u control,<password> show active
The solution is to create a backup medium that MaxDB uses to archive its log area to.
It happened. SAP NetWeaver ABAP instance won’t start anymore. The DB gets up, but the CS simply won’t start. The log file startsap_ASCS01.log show a 401 error.
What happened? SAPstartsrv will start the instance and to do so, it needs to communicate with sapcontrol. To make this communication work a stream is going to be used. For make this work, sapcontrol uses a file located at /tmp. If now this file was deleted while sapcontrol was running, or the owner changed, sapcontrol will have problems in using these file to communicate. A solution to the problem can be found at SAP Note 1565645 – SAP composite note: sapcontrol and and SCN Wiki.
The basic solution is simple: Stop the service, delete any stream file in /tmp and the start the service again. Issue the following commands:
Important: These files need to be owned by <sid>adm and have the super user bit set.
To see if these three simple commands solved the startup problem of ASCS, run startsap and check the output. In case everything is back to normal, the output will show that the instance is started without error.
Each SAP NetWeaver ABAP system comes with a built-in sample application that allows developers to learn how to use SAP technology. More information about flight sample can be found at SAP Help. Let see how to set up the flight sample and to test it. By default, the ABAP code is installed, but no data is provided. Therefore, the ABAP applications are of no use. First step is to set up the flight data!
Generate flight sample data
Execute the program: . Next screen: select data to be generated.
Execute: . A dialog will pop up, warning that old data will be deleted. Confirm with yes.
Check status at bottom of screen:
Test if data was created
Table name: SFLIGHT
Insert no criteria to get a list of all table entries.
Execute. The table entries are returned. If nothing is returned, something went wrong during the data generation step.
Function Module: BAPI_FLIGHT_GETLIST
Import parameter: Airline: LH
Execute. The result screen is shown.
The table FLIGHT_LIST needs to contain some values. Select the table to see the returned values.
In case the flight sample data was successfully generated and the user has the permission to execute the BAPI, both the table and the BAPI return valid data.
In case the BAPI is not returning any data, but an authorization error, check if the user has the permission to run the BAPI.
Table FLIGHT_LIST is empty and RETURN table contains two entries.
Value of table RETURN:
Check missing authorization with transaction SU53.
Missing authorization S_FLBOOK
Assign authorization S_FLBOOK to user.
Create a role with the authorization
Click on Single Role
Create role GUI is shown
Click on tab Authorizations
Click on Change Authorization Data
Add the missing role manually
The role is added, but marked yellow.
Click on the yellow icon. A dialog opens
Now everything is green
Generate the role:
A new dialog opens.
Nothing needs to be done here, just confirm the information.
Status in SAPGui:
Exit the transaction.
Back in PFCG, select tab user
Assign user to the newly created profile.
Click on User Comparison. A popup is shown, confirm by saving role.
Select complete comparison
Done. The user has now access to call the BAPI.
Let the world know