User Tools

Site Tools


doc:appunti:hardware:qnap_ts-120

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:appunti:hardware:qnap_ts-120 [2022/02/11 18:28] – [Real Time Clock rtc0] niccolodoc:appunti:hardware:qnap_ts-120 [2025/01/10 11:15] (current) – [USB audio dongle] niccolo
Line 95: Line 95:
 </code> </code>
  
-===== Console seriale =====+===== The Serial Console =====
  
-Vedere qui: [[http://www.cyrius.com/debian/kirkwood/qnap/ts-119/serial/]]+{{ .:qnap:qnap-ts-120-serial-console-jtag.jpg?direct&400|QNAP TS-120: Console connector}} 
 +{{ .:qnap:qnap-ts-120-serial-console-closeup.jpg?direct&160|Serial Console JTAG Connector}} 
 +On the circuit board of the QNAP TS-120 there is a JTAG connector for the serial console. I used an old CD-ROM audio cable because it had the right connector. I wired only the **GND**, **TX** and **RX** pins from to QNAP to a serial-to-USB adapter. The adapter was inserted intp a GNU/Linux computer running the **minicom** program. The speed of the serial line was set to **115200**. The connector pinout is documented in this page: [[http://www.cyrius.com/debian/kirkwood/qnap/ts-119/serial/|Serial console for QNAP TS-11x/TS-12x]].
  
-I connected only the **GND**, **TX** and **RX** pins from to QNAP to a serial-to-USB adapter. The adapter was inserted intp a GNU/Linux computer running the **minicom** program. The speed of the serial line was set to **115200**.+^ Console Pinout  ^^ 
 +^ 1  | TX        | 
 +^ 2  | VCC +3.3  | 
 +^ 3  | RX        | 
 +^ 4  | GND       |
  
 +This is the boot process captured from the serial line. At the end of the bootstrap you will get a **login prompt**.
  
 +<code>
 +         __  __                      _ _
 +        |  \/  | __ _ _ ____   _____| | |
 +        | |\/| |/ _` | '__\ \ / / _ \ | |
 +        | |  | | (_| | |   \ V /  __/ | |
 +        |_|  |_|\__,_|_|    \_/ \___|_|_|
 +       ____              _
 +| | | |   | __ )  ___   ___ | |_
 +| | | |___|  _ \ / _ \ / _ \| __|
 +| |_| |___| |_) | (_) | (_) | |_
 + \___/    |____/ \___/ \___/ \__|  ** LOADER **
 + ** MARVELL BOARD: DB-88F6282A-BP LE TS-120 ,PHY=1.8v
 +
 +U-Boot 1.1.4 (Nov  5 2012 - 17:39:47) Marvell version: 3.5.3
 +
 +U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CD5C0
 +
 +Soc: MV88F6282 Rev 1CPU running @ 1600Mhz L2 running @ 533Mhz
 +SysClock = 533Mhz , TClock = 200Mhz
 +</code>
 ===== Real Time Clock rtc0 ===== ===== Real Time Clock rtc0 =====
  
Line 225: Line 252:
  
 Now try to reboot. If the problem is fixed, you may remove the file **/etc/initramfs-tools/conf.d/root** and run **update-initramfs** again: now the proper rootfs will be autodetected. Now try to reboot. If the problem is fixed, you may remove the file **/etc/initramfs-tools/conf.d/root** and run **update-initramfs** again: now the proper rootfs will be autodetected.
 +
 +===== USB audio dongle =====
 +
 +I use the QNAP also as a **media player** because it stores all my audio files. I attached it to my HiFi amplifier through an **USB audio dongle** and an **audio cable** (3.5 mm jack - RCA stereo plugs).
 +
 +I faced a problem with that audio USB interface, because at every reboot the device is not working and it does not show in **lsusb** output. The manual workaround was to unplup and re-plug the device into the USB port.
 +
 +Fortunately it is possibile to force the re-initialization of the USB controller with the following script:
 +
 +<code bash>
 +#!/bin/sh
 +# If the USB audio device is missing, try to reset the USB controller.
 +# USB 2.0 devices may be under /sys/bus/pci/drivers/ehci_hcd instead.
 +PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
 +lsusb | grep -q 'JMTek, LLC. audio controller'
 +RET=$?
 +if [ "$RET" -ne "0" ]; then
 +    echo "USB audio device missing, trying to reset the bus."
 +    cd /sys/bus/pci/drivers/xhci_hcd
 +    echo -n "0000:02:00.0" > unbind
 +    sleep 1
 +    echo -n "0000:02:00.0" > bind
 +fi
 +</code>
 +
 +So I created a systemd service to be run when the host reaches the multi-user target. Create the file **/etc/systemd/system/usb-audio-dongle-reset.service**:
 +
 +<file>
 +# /etc/systemd/system/usb-audio-dongle-reset.service
 +#
 +# Service executed once the system has reached the multi-user status.
 +#
 +#  Type=oneshot         The unit is up after the main process exits.
 +#  RemainAfterExit=yes  The service shall be considered active even
 +#                       when all its processes exited.
 +#
 +# Eanble the service with:
 +#   systemctl enable my-startup.service
 +
 +[Service]
 +Type=oneshot
 +RemainAfterExit=yes
 +ExecStart=/usr/local/sbin/usb-audio-dongle-reset
 +
 +[Install]
 +WantedBy=multi-user.target
 +</file>
 +
 +Enable and start the service with:
 +
 +<code>
 +systemctl --now enable usb-audio-dongle-reset.service
 +</code>
  
doc/appunti/hardware/qnap_ts-120.1644600484.txt.gz · Last modified: 2022/02/11 18:28 by niccolo