AG7GN / wecg

Scripts and notes for WECG managed Raspberry Pis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation Instructions for Making a Nexus DR-X Raspberry Pi Image Suitable for WECG Remote Access

VERSION 20201230

Prerequisites

  • A Raspberry Pi 3B, 3B+ or 4B running the Nexus DR-X image and connected to the Internet
  • A Kenwood TM-D710G or TM-V71A radio attached via serial cable to the Pi
  • The RMSGW or APRS (dw_aprs_gui.sh) apps are configured and operating normally.
  • You are a WECG administrator setting up the Pi for remote access by other WECG members

Installation

Scripts, Desktop Files and FLdigi RigCAT

If you've already run the install_wecg.sh script on the Pi, skip to step 3.

  1. Use the Updater in the Hamradio menu to update to the latest nexus-utilites.

  2. Open a Terminal and run this command:

     install_wecg.sh
    

    Run it without arguments for instructions, then run it again with the appropriate arguments. When that completes, a browser will open and bring you to this page.

  3. Open the Main Menu editor: Raspberry > Preferences > Main Menu editor and arrange the items in the Hamradio menu as desired. WARNING: Do not click Cancel even if you make no changes! Click OK instead. Clicking Cancel will restore the menu to default settings.

Before continuing proceeding to the Configure rigCAT in FLdigi step, please read the following warnings:

IMPORTANT! The 710.sh script will not work while Fldigi is running with rigCAT enabled because rigCAT has control of the serial port to the radio. Once Fldigi is stopped, you can again use 710.sh.

IMPORTANT! The 710.py GUI will not work while Fldigi is running with rigCAT enabled because rigCAT has control of the serial port to the radio. Once Fldigi is stopped, you can again use 710.py.

Now that you've read those warnings, you can decide whether or not to enable rigCAT in FLdigi. In other words, you have the choice of using rig control via rigCAT in FLdigi to control the radio's frequency or you can use 710.sh or 710.py to control the radio, but you cannot use either of these if rigCAT is enabled in FLdigi and FLdigi is running.

NOTE: If FLdigi is configured to use RigCAT and you run the Start script while 710.py is running, RigCAT will be temporarily disabled in FLDigi. When you stop FLdigi/FLmsg with the Stop script, RigCAT will be re-enabled in the FLdigi configuration.

  1. Configure rigCAT in FLdigi (Optional)

    • Start FLdigi: Raspberry > Hamradio > START FLdigi+FLmsg.

    • Select View > Rig/Log Controls > Full.

    • Click Configure > Config dialog > Rig Control > CAT (rigcat).

    • Click Open and go to .fldigi/rigs and select the TM-D710G.xml file. Click Open.

    • In the Device dropdown, select the serial port that starts with /dev/serial/by-id/....

    • Select Baud rate 57600 and make sure the radio is set the same. It should be if you use the 710.sh or 710.py scripts.

    • Uncheck CAT command for PTT.

    • Check RTS/CTS flow control and Restore UART Settings on Close.

    • Check the Use rigCAT box.

    • Leave other settings as-is.

      The configuration should look like this:

      rigcat configuration

    • Make sure the radio is on and it's serial cable is connected to the Pi.

    • Click Initialize. The radio's frequency should appear in the upper left corner of FLdigi.

    • Click Save, then Close to close the configuration screen.

    • You can change the frequency in FLdigi in a number of ways. The easiest is to click on the leftmost digit in the frequency display, then type your desired frequency in KHz, then press RETURN.

    If you decide to switch off RigCAT at a later time (for example, if you want to use either of the 710 scripts instead), simply uncheck the Use RigCAT box in Fldigi configuration window (Rig Control > CAT (rigcat))

  2. Test the START Fldigi+Flmsg and STOP Fldigi+Flmsg and KILL Fldigi+Flmsg menu items to make sure they work as desired.

Install dwagent

dwagent is the software that allows remote access to the Pi using DWService.

  1. Open a browser on any computer and log in to DWService as user w7ecg.wecg@gmail/com.

  2. Click Agents.

  3. Click + at the top of the screen.

  4. Select WECG Hosts in the Group dropdown.

  5. Enter the Pi's hostname in the Name field. This is usually the call sign. It does not have to exactly match the Pi's actual hostname and you can change the name later.

  6. Enter a description. Include the location and any other information that users might find helpful.

  7. Click Confirm.

  8. A new screen will appear containing a 9 digit number. Write this number down. It will look something like this:

    agent setup

  9. Back on the Pi, open the Chromium browser and go to the DWservice download page.

  10. Click the Raspberry ARM (Linux) icon.

  11. Click Download.

  12. Open a Terminal and run these commands:

     	cd Downloads
     	chmod +x dwagent.sh
     	./dwagent.sh
    
  13. Select 1. Install when prompted.

  14. Accept default for Path.

  15. Select 1. Yes for the "Do you want to install..." question.

  16. Select 1. Entering the installation code.

  17. Enter the install code you wrote down earlier.

  18. The script should finish the installation and start the DWAgent. Close the Chromium browser window.

Convert the dwagent from a system service to a user service for security reasons.

By default, the dwagent runs as root, so that when you start a shell in the DWService web interface, you get a root shell. That's not good. Here's how to run the dwagent as another user.

  1. Stop and disable the service:

     sudo systemctl stop dwagent.service
     sudo systemctl disable dwagent.service
    
  2. Make a folder for user level services and move the service file into it. Run these commands:

     cd ~
     mkdir -p .config/systemd/user
     cd .config/systemd/user/
     sudo mv /etc/systemd/system/dwagent.service .
     sudo chown pi:pi dwagent.service
    
  3. Open dwagent.service in an text editor and change this line:

     WantedBy=multi-user.target
    

    to:

     WantedBy=default.target
    
  4. Change the ownership of the /usr/share/dwagent folder and everything in it to user pi:

    cd /usr/share
    sudo chown -R pi:pi dwagent/
    
  5. Allow user pi to autostart services even if not logged in:

    sudo loginctl enable-linger pi
    
  6. Enable and start the user service as user pi (not as root):

     systemctl --user enable dwagent.service
     systemctl --user start dwagent.service
    

    If you get an error message that says Failed to connect to bus: No such file or directory, then run the above systemctl commands like this instead:

     XDG_RUNTIME_DIR=/run/user/$UID systemctl --user enable dwagent.service
     XDG_RUNTIME_DIR=/run/user/$UID systemctl --user start dwagent.service
    

    From now on, the dwagent.service will start as user pi at bootup.

(Optional) Remove avahi-daemon and libnss-mdns services

  1. If this Pi is being deployed on a network used by others (like WWU, BTECH), remove the avahi-daemon and libnss-mdns services so the Pi doesn't advertise itself on those networks:

     sudo apt -y remove pulseaudio-module-zeroconf avahi-daemon libnss-mdns
     sudo apt -y autoremove
     systemctl --user restart pulseaudio
    

About

Scripts and notes for WECG managed Raspberry Pis


Languages

Language:Shell 100.0%