Introduction
This page describes how to monitor and adjust the software used in the modular Preamplifier v2.0. An overview of the project and description of the hardware can be be found the Preamplifier v2.0 project page. Updating the firmware is described on the Preamp v2.0 firmware update page. The connection to the PreampController UART connector can be done using a Raspberry Pi or a USB-serial converter.
USB-serial connection
A USB-serial converter with 4 pins is needed: GND, +3V3, RX, TX. Connect GND and +3V3 to the corresponding pins on the PreampController UART connector. The RX and TX pin on the USB-serial converter and PreampController need to be cross-wired (USB-serial TX to PreampController RX and so on). Continue at the PreampController terminal connection section.
Raspberry Pi connection
The hardware connection between the PreampController and Raspberry Pi can be achieved in the following way:
The Raspberry and PreampController RX and TX are cross-wired. The PreampController contains an integrated level converter to match the Raspberry 3.3V levels with the PreampController 5V levels. The 3.3V supply from the Raspberry PI needs to be connected to the PreampController for this.
Preparations
On the SD card of the Raspberry Pi a choice of operating systems can be installed: Raspbian operating system (see http://www.raspberrypi.org) or the Volumio media player (see volumio.org).
Raspbian
Follow the instructions on www.raspberrypi.org to install the firmware on the SD card. Put the SD card in the Raspberry Pi and boot it.
Volumio
Follow the instructions on volumio.org to install the firmware on the SD card. Put the SD card in the Raspberry Pi and boot it.
By default, the serial connection of the Pi is used to output the linux console data. This needs to be switched off by removing the parts containing ttyAMA0 (for older Volumio versions) and serial0 (for recent Volumio versions) in 'boot/cmdline.txt':
nano /boot/cmdline.txt
Remove the parts, save the file and reboot the Pi.
In more recent versions of the Raspberry Pi (3 and 4) the UART connection is connected to bluetooth by default, which needs to be disabled first to use it as indicated on:
https://www.raspberrypi.org/documentation/configuration/uart.md
Login to Raspberry Pi
Logging into the Raspberry Pi can be done locally using a monitor and keyboard connected to the Raspberry Pi USB and HDMI connectors or remotely over the network using SSH.
Local connection
After the Raspberry Pi boots it will finish with a terminal screen (applies to both Raspbian and Volumio)
Remote connection
To login remotely to the Raspberry Pi it needs to be connected over ethernet and have obtained a valid ip-adress (i.e. through a DHCP server on the network).The default username/password are:
Raspbian
username: pi
password: raspberry
Volumio
username: root
password: volumio
from Linux using SSH
Login from a Linux command prompt can be done with the command:
ssh Dit e-mailadres is beschermd tegen spambots. U heeft JavaScript nodig om het te kunnen zien. (for Raspbian)
ssh Dit e-mailadres is beschermd tegen spambots. U heeft JavaScript nodig om het te kunnen zien. (for Volumio)
The Raspberry Pi asks for the password and after correctly entering the connection should be obtained.
Remote connection from Windows using PuTTY
From Windows, the connection can be achieved using the PuTTY program (http://www.putty.org). Install the program and connect to the Raspberry Pi ip-address with username and password.
PreampController terminal connection
Using a terminal program (like minicom on the Raspberry Pi or gtkterm) the PreampController output can be seen and commands can be given to change its behaviour. From a linux terminal (on the Raspberry Pi or using USB-serial) can be connected to the PreampController. If not installed, first install minicom using
sudo apt-get install minicom
Then configure minicom once. Setup serial device, switch off flow control and save settings:
sudo minicom -s
The UART connection settings are:
baudrate=115200, 8N1
Connect to the PreampController (/dev/ttyAMA0 is the Raspberry Pi UART device, with USB-serial it is something like /dev/ttyUSB0):
minicom -b 115200 -o -D /dev/ttyAMA0
From the terminal connection many commands are available, an overview can be obtained with:
> help
Available Commands:
help - Display this help
ver - Show version info
db - Change debug info
button - Emulate buttons
settings - Change eeprom settings
reboot - Reboots the preamp
mute - Mute/unmute
channel - Channel functions
input - Input functions
volume - Volume functions
par - Parameter functions
show - Show status
The preamp can be rebooted using
> reboot
[I] lcd-delay=0
[I] lcd-width=20
[I] Djuke PreAmplifier
[I] v0.8 27 dec 2014
[I] Settings loaded!
Which shows some information during the startup process.
The preamp can be switched on by emulating the power button with:
> button power
[I] power on...
[I] DAC detected
[I] VolumeControl detected
[I] InputSelect detected
Additional debug info can be switched on using:
> db 2
Debug level set to: 2
which is very useful to check if events are correctly coming in. To test for example the buttons, press the right button and you should see:
[D] Right event
or pressing a button on your infrared controller gives something like:
[D] Infrared event
[D] IR=RC5 A:0 C:1 S:0
[D] Received=1
Note: to exit from minicom use CTRL-A, then press x.
Linux direct device file control
Instead of using a terminal program from linux there is an even simpler way to send and receive info over UART directly using the UART device file (in Linux devices are also accessible as a file). First set the device in raw mode, without echoing characters back and with the correct baud rate:
stty -F /dev/ttyAMA0 raw -echo speed 115200
Then show received information from the UART device using:
cat < /dev/ttyAMA0
This command will not return as it is supposed to continue outputting to the screen, so you have to open a second linux terminal connection in order to send commands, as an example power on the preamp using:
echo "power on" > /dev/ttyAMA0
This is a very powerful feature that opens the way to integrate the Preamp with other applications. As an example, you can install the Volumio mediaplayer on the Raspberry Pi and use a simple Python program that powers on the Preamp and set the correct input channel when playback on the Volumio mediaplayer is started. More on that on the Preamp v2.0 volumio integration page.