Saturday, August 01, 2020

Raspberry Pi 4 and WSJT-X and GPS - time sync install


1. INSTALL WSJT-X
a. Install the latest Raspbian, and make sure you have a working internet connection.
  sudo apt-get update 
  sudo apt-get upgrade

b. Visit the WSJT-X homepage and download the latest release for Raspbian.
c. Install wsjt-x
 
cd Downloads sudo dpkg -i wsjtx_2.2.2_armhf.deb sudo apt --fix-broken install


2. SET-UP: Sound / AUDIO

a. Prepare a USB Sound device such as Logitech USB headset
b.  run lsusb
   At this point, nothing should be plugged in aside from your normal peripherals.
   nothing attached to your radio and no USB sound interfaces or CAT interfaces

c. plug-in the USB audio device (ie. Logitech headset),  run lsusb again.
d. and check dmesg -H

then found this
======
pi@RPI4B:~ $ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 045e:0800 Microsoft Corp. 
Bus 001 Device 006: ID 046d:0a02 Logitech, Inc. Premium Stereo USB Headset 350
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
===
pi@RPI4B:~ $ dmesg -H
........
[Aug 1 08:59] usb 1-1.3: new full-speed USB device number 4 using xhci_hcd
[  +0.147608] usb 1-1.3: New USB device found, idVendor=046d, idProduct=0a02, bc
[  +0.000018] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=
[  +0.000016] usb 1-1.3: Product: Logitech USB Headset
[  +0.000015] usb 1-1.3: Manufacturer: Logitech
.......
=====

e. Set at  Soundcard input and output at FILE / Settings / [Audio]   as shown below




3. Set-up CAT  (ICOM CI-V with USB-serial dongle case)

a. Prepare USB serial for CI-V  connection
b. run lsusb 
c. plug-in the USB serial  device (ie. CP2101 shown below),  run lsusb again.
d. Check dmesg -H
  - It has been assigned to the device /dev/ttyUSB0 and that its serial number is 0001
e. Check  ls /dev/serial/by-id/ 
f. Set correct device at  at FILE / Settings / [Radio]  at wsjt-x



====
pi@RPI4B:~ $ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 1546:01a7 U-Blox AG [u-blox 7]
Bus 001 Device 003: ID 046d:0a02 Logitech, Inc. Premium Stereo USB Headset 350
Bus 001 Device 006: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP2102/CP2109 UART Bridge Controller [CP210x family]
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

====

[  +8.970094] usb 1-1.1: new full-speed USB device number 6 using xhci_hcd
[  +0.164422] usb 1-1.1: New USB device found, idVendor=10c4, idProduct=ea60, bcdDevice= 1.00
[  +0.000009] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  +0.000007] usb 1-1.1: Product: CP2102 USB to UART Bridge Controller
[  +0.000006] usb 1-1.1: Manufacturer: Silicon Labs
[  +0.000006] usb 1-1.1: SerialNumber: 0001
[  +0.049068] usbcore: registered new interface driver usbserial_generic
[  +0.000030] usbserial: USB Serial support registered for generic
[  +0.003063] usbcore: registered new interface driver cp210x
[  +0.000033] usbserial: USB Serial support registered for cp210x
[  +0.000101] cp210x 1-1.1:1.0: cp210x converter detected
[  +0.006001] usb 1-1.1: cp210x converter now attached to ttyUSB0
====
pi@RPI4B:~ $ ls /dev/serial/by-id/
usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0
usb-u-blox_AG_-_www.u-blox.com_u-blox_7_-_GPS_GNSS_Receiver-if00
pi@RPI4B:~ $ 
====


3A. The CP2102 USB serial board conversion to a  CI-V converter
a. Connect RXD to the tip of 3.5mm Plug
b. To make open collector connection for CI-V,  Use a Diode(1N4148) to connect the TXD.
  - Connect the Cathode to TXD and anode to RXD (tip)




3B. ICOM IC-7100 USB direct connection case
a. Unplug unused USB dongles, Reboot RPi4
b. Connect a USB cable to IC-7100
c. Check USB connection by run lsusb .
d. Configure WSJT-X as shown below


or


====
pi@RPI4B:~ $ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 007: ID 1546:01a7 U-Blox AG [u-blox 7]
Bus 001 Device 020: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP2102/CP2109 UART Bridge Controller [CP210x family]
Bus 001 Device 019: ID 08bb:2901 Texas Instruments PCM2901 Audio Codec
Bus 001 Device 018: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP2102/CP2109 UART Bridge Controller [CP210x family]
Bus 001 Device 017: ID 0451:2046 Texas Instruments, Inc. TUSB2046 Hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
====



4. Set-up a GPS dongle and Time Sync

a. Prepare USB connected GPS device
b. Install the following software:
  sudo apt -y install gpsd gpsd-clients python-gps chrony python-gi-cairo

c. Make changes to the gpsd configuration file as follows:
  sudo nano /etc/default/gpsd

d. In the file that opens, add or amend lines to make sure the following is present:

  START_DAEMON=”true”
  USBAUTO=”true”
  DEVICES=”/dev/ttyACM0″
  GPSD_OPTIONS=”-n”

  Hit ctrl-x followed by y to close and save the file.

e. Reboot the Pi and check that the following services are active:

  systemctl is-active gpsd

  systemctl is-active chronyd

f. Use any of the following three commands to check that the GPS is visible and delivering NMEA words. 

  cgps – s   or   
  gpsmon -n  or   
  xgps

g. Next, make a change to the chrony configuration file:

  sudo nano /etc/chrony/chrony.conf

Add the following line to the end of the file:

  refclock SHM 0 offset 0.5 delay 0.2 refid NMEA

  Hit ctrl-x followed by y to close and save the file.

h. Check chrony’s sources with the command:
  chronyc sources -v

 - You will see a list of available time servers plus the GPS source which will be shown as NMEA. Without the network connection, you will just see the NMEA source listed. 
 Symbols in MS "#*"  where # means the GPS is recognized as a local clock, * means that it’s being used to synchronize the Pi system time.

i. use chronyc to provide a more detailed view using the command:
  sudo chronyc tracking


====
[  +0.299750] usb 1-1.4: new full-speed USB device number 4 using xhci_hcd
[  +0.134447] usb 1-1.4: New USB device found, idVendor=1546, idProduct=01a7, bcdDevice= 1.00
[  +0.000020] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  +0.000016] usb 1-1.4: Product: u-blox 7 - GPS/GNSS Receiver
[  +0.000015] usb 1-1.4: Manufacturer: u-blox AG - www.u-blox.com

=====
pi@RPI4B:~ $ chronyc sources -v
210 Number of sources = 5

  .-- Source mode  '^' = server, '=' = peer, '#' = local clock.
 / .- Source state '*' = current synced, '+' = combined , '-' = not combined,
| /   '?' = unreachable, 'x' = time may be in error, '~' = time too variable.
||                                                 .- xxxx [ yyyy ] +/- zzzz
||      Reachability register (octal) -.           |  xxxx = adjusted offset,
||      Log2(Polling interval) --.      |          |  yyyy = measured offset,
||                                \     |          |  zzzz = estimated error.
||                                 |    |           \
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
#x NMEA                          0   4     0   29m   -437ms[ -437ms] +/-  100ms
^+ 210.183.236.141               2  10   377   670  -1141us[-1396us] +/-   60ms
^* 106.247.248.106               2  10   337   262  +1198us[ +929us] +/-   41ms
^+ dadns.cdnetworks.co.kr        2   9   377   524  -4922us[-5182us] +/-   91ms
^+ send.mx.cdnetworks.com        2  10   277   409  +3143us[+2879us] +/-   53ms
pi@RPI4B:~ $ 
=====






====
pi@RPI4B:~/Downloads $ sudo dpkg -i wsjtx_2.2.2_armhf.deb
(Reading database ... 154667 files and directories currently installed.)
Preparing to unpack wsjtx_2.2.2_armhf.deb ...
Unpacking wsjtx (2.2.2) over (2.2.2) ...
Setting up wsjtx (2.2.2) ...
Processing triggers for gnome-menus (3.31.4-3) ...
Processing triggers for desktop-file-utils (0.23-4) ...
Processing triggers for mime-support (3.62) ...
pi@RPI4B:~/Downloads $ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  rpi-eeprom-images
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@RPI4B:~/Downloads $ sudo apt autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  rpi-eeprom-images
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 14.3 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 154667 files and directories currently installed.)
Removing rpi-eeprom-images (7.8-1) ...
pi@RPI4B:~/Downloads $ wsjtx
qt5ct: using qt5ct plugin
PulseAudioService: pa_context_connect() failed
ALSA lib pcm_dsnoop.c:575:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dsnoop.c:575:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
qt5ct: D-Bus global menu: no

=====