Page 1 of 2 12 LastLast
Results 1 to 20 of 22

Thread: Raspberry Pi Mobile: Part 2 - Pi as a TNC Terminal

  1. #1
    Super Moderator Board Member - 4x4 Ham
    Premium Member
    KE7KUS's Avatar
    Join Date
    Aug 2009
    Location
    High Rolls, NM
    Posts
    687
    Downloads
    20
    Uploads
    19

    Default Raspberry Pi Mobile: Part 2 - Pi as a TNC Terminal

    INTRODUCTION

    In Part 1 of this series we looked at piecing together the hardware required to get the Raspberry Pi computer in a small form-factor mobile setup. In this part, we will look at utilizing the Raspberry Pi as a TNC front-end for my Kenwood D710 radio. This part assumes that you have the hardware described in Part 1, or its working equivalent. It is also assumed that you have a working Raspberry Pi complete with a copy of the Raspbian OS. This article was written based on Raspian Wheezy & updates current as of 1/27/13; however, due to the simplistic nature of terminal operations, any OS complete with a terminal emulator will suffice for this test. As with Part 1, click on the thumbnail pictures in this writeup for their full-size version.

    EQUIPMENT REQUIRED

    In addition to the equipment described in Part 1, you will need:

    1) A cable to connect from the COM port on the rear of the TM-D710A control head to a standard DB9 serial connector
    2) A USB-serial adapter. I used one with a PL2303 chipset, which is well supported under Raspbian, but others may also suffice.
    3) A Kenwood TM-D710 radio. Obviously, you can substitute another packet-capable radio such as an FTM-350 or a TS-2000, or any radio connected to an external TNC like a KPC-3+; however, this writeup will use the D710 as the example configuration.

    BOOTING THE PI

    Once you have the Pi configured, you'll want to power it on (it only takes a cell phone charger with a micro-USB connector to power the Pi). Once it boots, you should see the desktop looking something like this:You obviously won't have fldigi, xastir, and VLC on your desktop when you boot up initially. I installed those from the Raspbian repository after I got the Pi running. The LXTerminal is the icon you care about. Right click on it, then "Open". If the LXTerminal icon is not on your desktop, you can find it in the Accessories menu:
    Once the terminal opens, you'll want to get about the business of installing a terminal emulator on the Pi. I prefer minicom as my terminal emulator under Linux...you may have a different favorite. To install minicom on the Pi, you'll simply want to install it from the Raspbian repository by typing the following at the command line prompt:
    Code:
    sudo apt-get install minicom
    You may get a prompt asking you if you want to install the software and its dependencies. Simply type "y" and hit enter and the software will download and install. (This assumes you have a working internet connection on the Pi before you begin.)

    Once you have minicom installed, you will need to configure it to use your USB-serial adapter. Before you begin this process, connect the cable to the rear COM port on the D710 control head, then to the USB-serial adapter. Plug that USB cable into the Pi somewhere and proceed to configure minicom. When you initially run minicom, you'll want to use the "-s" tag, which simply tells minicom to enter the "setup" mode prior to launching:
    Code:
    sudo minicom -s
    Once minicom opens, you should see the following screen (or something like it):Scroll down to the "Serial port setup" line with the keyboard arrow keys and hit enter. The next screen should pop up:
    From here type "A" to move the cursor to the Serial Device line. You will want to set this to whatever your USB-serial converter device is on your Raspbian system. You can find this by opening another tab in LXTerminal and typing:
    Code:
    dmesg|tail -n 30
    Read through the text that scrolls after you hit enter and you will see something like this:
    Code:
    pl2303 converter now attached to ttyUSB0
    This means that your USB device is "/dev/ttyUSB0"...go back to the minicom setup and type that into where you selected "A" on the serial device setup. Once you have done that, hit ESC until you are back at the main minicom setup menu. Scroll down to "Save setup as dfl" and select that. This will save the configuration change you just made as your default configuration so it will automatically come up next time you start minicom. Next simply select "Exit" which will take you out of the minicom setup menu and into the main minicom program.

    If all worked out the way it was "Just Supposed To Work" you should see the following screen:
    The "cmd:" prompt is your TNC command prompt from the D710 (in this case) and that means you are in business!

    The first thing you will want to do is configure your TNC to get it on the air. The most common mistake made is to fail to set the TNC MYCALL parameter, which will keep you from connecting to any other nodes. Reference your specific TNC manual to see what commands are specific to your TNC setup, but for the D710 simply type (where you replace N0LID with your own callsign/SSID):
    Code:
    MYCALL N0LID
    The TNC should accept this command. You can check that it took by simply typing "MYCALL" and the TNC will return the MYCALL setting. You may want to setup other parameters on your TNC (turn on your mailbox, enable digipeating, handle UI packets, etc.). That is beyond the scope of this discussion, but there is plenty of information on the net available to get you headed in the right direction.

    I set up the D710 for the 2m packet repeater:

    Once I got my TNC configured the way I wanted, it was time to connect to the White Tanks 145.71 packet repeater. The node's callsign is W7MOT-6 and its alias is WHTNKS. You can connect by typing either:
    Code:
    C W7MOT-6
    or
    Code:
    C WHTNKS
    at the "cmd:" prompt of your TNC.

    Using minicom I was easily able to log into the WHTNKS node, and from there jump up to UNION2, UNION, HUMBBS, and even ELDEN nodes. This is a snapshot of me rooting around in the WHTNKS node:
    Nothing to it. The only thing that disappointed me is that I couldn't find out how to start "Global Thermonuclear War" while I was in there.

    Feeling adventurous, I reconfigured the D710 TNC to 9600 baud packet mode:
    On the White Tanks, 438.975 is the 9600 baud packet repeater, callsign W7MOT-13 and alias #WHTNK. I attempted to connect to the 9600 baud machine using the same method I had with 1200 baud and met with success! This is a snapshot of me rooting around in the 9600 baud machine:
    You obviously can't see it from the photo, but it's amazing how much faster 9600 baud packet is than 1200 baud! I forget sometimes until I go from one to the other...for text-based computing, 9600 baud is FB! Doesn't look like the 9600 machine on WT gets too much use these days...might be a great meeting place for 4x4Hams in the Phoenix metro area...

    CONCLUSION

    My test of the Pi as a mobile computer TNC front-end was a resounding success. Granted, the test wasn't really that difficult, but I validated the Pi supports USB-serial adapters (at least with the pl2303 chipset), minicom terminal emulator works when compiled for Pi, and the computer is capable of handling the workload (minimal though it may be.)

    Of note, I had to re-configure the display on the Pi terminal to allow me to more easily read the text on the 3.5" screen. I boosted the font size in the terminal from 12 to 16 point font and it seems to work OK for my eyes, although max viewing distance at that size is still only about 3 feet. For longer planned packet operations, I would definitely take the time to get a larger & higher resolution display to avoid eye strain.

    Also of note, the touchpad on the keyboard I purchased seems to have a glitch where it gets the cursor stuck in the menu bar at the bottom of the screen. I had to add another regular USB mouse to the Pi to get the cursor in the GUI to work properly. I will troubleshoot this matter and report back when I solve the stuck cursor issue.

    Stay tuned for Part 3 where we test the Pi as a software packet TNC using the Linux soundmodem package.

    Until next time...

    73,
    Kurt
    KE7KUS

  2. #2
    4x4 Ham Member
    Join Date
    Jul 2011
    Location
    Southern California
    Posts
    90
    Downloads
    12
    Uploads
    0

    Default

    Really nice write-up.

    I have been thinking of doing the same thing. Unfortunately still just thinking.

    Could you post links to sources for the wardware?

    Thanks!
    Dave, W6DPS

  3. #3
    Super Moderator Board Member - 4x4 Ham
    Premium Member
    KE7KUS's Avatar
    Join Date
    Aug 2009
    Location
    High Rolls, NM
    Posts
    687
    Downloads
    20
    Uploads
    19

    Default

    D-Link Hub: http://www.amazon.com/D-Link-DUB-H4-High-Speed-4-Port/dp/B00006B7D
    802.11b/g/n dongle: http://www.amazon.com/Edimax-EW-7811...dp/B005CLMJLU/
    Case for Pi: http://www.amazon.com/SB-Transparent...dp/B008TCUXLW/
    Keyboard: http://www.amazon.com/FAVI-Entertain...dp/B003UE52ME/
    Monitor: http://www.amazon.com/3-5-Inch-TFT-M...dp/B0045IIZKU/
    Bluetooth Dongle: http://www.amazon.com/Bluetooth-USB-...dp/B001EBE1LI/

    If you search around you can find work-alikes for most of these...I just picked these because they were all available with Amazon Prime...free two-day shipping.

    73,
    Kurt
    KE7KUS

  4. #4
    4x4 Ham Member
    Join Date
    Jul 2011
    Location
    Southern California
    Posts
    90
    Downloads
    12
    Uploads
    0

    Default

    I just ordered a Raspberry Pi from Newark, which shows a 29 day lead time...

    Within the month or so until it gets here I should be able to assemble the other bits and pieces (and may have some suitable stuff on hand).

    Thanks for encouraging me to move out of the planning phase and actually get started.

    Dave, W6DPS

  5. #5
    4x4 Ham Member KF7IJB's Avatar
    Join Date
    Mar 2010
    Location
    Phoenix, Arizona
    Posts
    180
    Downloads
    1
    Uploads
    0

    Default

    Nice to see that others are using the Raspberry Pi in this capacity. I am in the process of putting together another mobile station based on the Pi so that I can torture test it during the summer. I'm a Gentoo guy, but Rasbian is another Debian based distro, so no qualms there.

    The Pi has two downsides compared to the Pico-SAM9G45 that I use for my mobile APRS station. First, it only accepts 5V input. Secondly, it uses poly-fuses for the USB. The 5V limitation means that you will need to build a power supply that is capable of supplying 5V at 2Amps without self-destructing in the Arizona summer heat. Second, the poly-fuses trip more easily when they get hot, so you may end up tripping them if you run USB devices such as a serial converter when the setup is left in a closed vehicle cabin and the temperature soars to 140F or more. I found that I had to use a powered USB hub to drive some devices such as WiFi since the Pi cannot source that much current from the USB ports. I guess we will both end up finding out how the Pi performs with respect to temperature once summer rolls around.

    The video output is nice though, and the Pi will be useful for APRS in the field, as well as a little digital mode station. I get around a lack of video by doing everything on my Android tablet. I'm running an APRS server on my board and I just point APRSdroid at the server and route the packets out through my TNC. I disable beacons on APRSdroid since my embedded machine does smart-beaconing, and I just use APRSdroid to send/receive messages and view the map. Currently I am working on getting a 3G modem hooked up so that I can have the station act as a mobile i-gate while doing my cross-country drives.

    That's a pretty slick radio setup. Now you have me eye-balling one of those fancy Kenwoods. I am running a TNC-X over USB. I spoke with the creator of the TNC-X recently regarding an issue that I had, and he is going to be putting out a newer model that attaches directly to the raspberry pi and has the same form-factor. The photos that I saw were pretty awesome, so I am looking forward to the release. If anyone is looking to go down the Raspberry Pi route for APRS work and needs a TNC, it might be worth while to wait for that product to come out.

    One issue with the Linux soundmodem is that it uses a boatload of CPU. The Raspberry Pi also lacks audio input, so you will need an external device. For APRS though, I think that using a hardware TNC is the way to go due to the limited resources of the Pi. I do have information on making a super-cheap working TNC based on the Arduino that will couple nicely with the Pi if anyone is interested.

    Luckily I have used the SignaLink over USB with great success for other digital modes via flDigi, and it has the added benefit of being able to key your radio and eliminating the need for a VOX switch. flDigi seems to be fine in most digital modes, but some USB audio devices cause grief when used with the linux sound modem driver when doing APRS work.

  6. #6
    4x4 Ham Member
    Join Date
    Jul 2011
    Location
    Southern California
    Posts
    90
    Downloads
    12
    Uploads
    0

    Default

    My Raspberry Pi has arrived--Newark was much faster than their estimate of shipping on 2/27.

    I have a KPC-3 and a SignalLink USB, but haven't had a chance to try either with the Pi. The KPC-3 looks like it should be much easier, since all it requires is a com program. I will be setting up with an HT for packet and APRS.

    I have heard that the SignalLink is difficult to use with Linux due to driver issues for most distros, but I would love to get it working for HF digital modes.

    Other bits and pieces to be determined...

    Dave, W6DPS

  7. #7
    4x4 Ham Member W5WI's Avatar
    Join Date
    Feb 2013
    Location
    RIchland, Missouri and Buffalo Gap, TX
    Posts
    26
    Downloads
    0
    Uploads
    0

    Default

    Great write up! I'm thinking of purchasing a similar set up! I wonder if it will run APRS???

    73,

    dale de W5WI

  8. #8
    New 4x4 Ham Member
    Join Date
    Mar 2013
    Location
    United States
    Posts
    3
    Downloads
    1
    Uploads
    0

    Default

    I loved this article. Excellent work!

  9. #9

    Default

    Quote Originally Posted by W5WI View Post
    Great write up! I'm thinking of purchasing a similar set up! I wonder if it will run APRS???

    73,

    dale de W5WI
    Short answer: Yes.

    You can run APRS connected to a TNC and use the Linux application XASTIR.
    Virgil - K7VZ
    Offroad and on the air.

  10. #10
    4x4 Ham Member
    Join Date
    Jul 2011
    Location
    Southern California
    Posts
    90
    Downloads
    12
    Uploads
    0

    Default

    Any Raspbian compatible programs for full AX.25 packet?

    Or possibly a DOS emulator, that would let me run my old Kantronics software?

    Using a com program like minicom works, but is not as convenient as a real packet program.

    Also, what kind of hardware are you using FLDigi with>

    I am pretty experienced with Unix and similar operting sytems, but just started playing with Linux. In some ways it is incredibly easy compared to a decade ago, but I am still on the steep part of the learning curve and struggling like a noob.

    Thanks for the patience...

    Dave, W6DPS

  11. #11

    Default

    Quote Originally Posted by W6DPS View Post
    Any Raspbian compatible programs for full AX.25 packet?

    Or possibly a DOS emulator, that would let me run my old Kantronics software?

    Dave, W6DPS
    I just saw this on the RasPi forums. I wonder if it will work for you.

    sudo apt-get update
    sudo apt-get install dosbox

    Reference: http://www.raspberrypi.org/phpBB3/vi...p?f=78&t=36695
    Virgil - K7VZ
    Offroad and on the air.

  12. #12
    Super Moderator Board Member - 4x4 Ham
    Premium Member
    KE7KUS's Avatar
    Join Date
    Aug 2009
    Location
    High Rolls, NM
    Posts
    687
    Downloads
    20
    Uploads
    19

    Default

    I've used dosbox to run old Kenwood commercial radio programming software and it worked quite well. I'm sure it would do fine for your application.

    Regarding native OS software, I use JNOS 2.0 on my Pi: http://www.langelaar.net/projects/jn...wnloads/linux/

    There is a definite learning curve to getting the autoexec.nos set up correctly, but plenty of copyable versions available if you're looking on Google. If you are Unix-familiar I think you'll pick it up in no time at all.

    You can also use the native AX.25 support built into the Linux kernel. I don't think it's quite as user-friendly, but here's an abbreviated starter guide: https://docs.google.com/viewer?url=h...HowTO_v0.4.pdf

    Go to Section 4 and look at the instructions under using a KISS device. You might have to use minicom to put the TNC into KISS mode...then start with the KISS instructions.

    73,
    Kurt
    KE7KUS

  13. #13

    Default

    Here's someone else running DOS emulation on a Raspberry Pi. http://rpix86.patrickaalto.com/index.html
    Virgil - K7VZ
    Offroad and on the air.

  14. #14
    4x4 Ham Member
    Join Date
    Mar 2010
    Location
    Broken Arrow, Oklahoma, United States
    Posts
    21
    Downloads
    0
    Uploads
    0

    Default

    Got to the part where I was loading settings into Minicom.
    But I can't save my settings. Get an error instead.
    Sure it's a linux Newbie thing like directory permissions, or not running as root or something.

    Will get my cables ready anyway and just add the parameters on the command line for now.

    Thanks for the post !

    Scott
    KD5NJR

  15. #15
    Super Moderator Board Member - 4x4 Ham
    Premium Member
    KE7KUS's Avatar
    Join Date
    Aug 2009
    Location
    High Rolls, NM
    Posts
    687
    Downloads
    20
    Uploads
    19

    Default

    Quote Originally Posted by KD5NJR View Post
    Got to the part where I was loading settings into Minicom.
    But I can't save my settings. Get an error instead.
    Sure it's a linux Newbie thing like directory permissions, or not running as root or something.
    Try this:

    Code:
    sudo minicom -s
    Then change your params and try to save. Minicom's default config file is in the /etc directory, which requires root permissions to change.

    73,
    Kurt
    KE7KUS

  16. #16
    4x4 Ham Member
    Join Date
    Jul 2011
    Location
    Southern California
    Posts
    90
    Downloads
    12
    Uploads
    0

    Default

    I should have the rest of my Raspberry Pi related toys in hand tomorrow. I went with a 7 inch monitor, due to the hope that I can see it without my reading glasses:

    http://www.amazon.com/gp/product/B00...?ie=UTF8&psc=1

    I am expecting to install DosBox and try using my Kantronics software. Without it I should be able to use Minicom. I use a USB to serial adapter with Prolific 2303 chipset. (The chipset also found in three of my radio programming cables.)

    First order of business will be getting my KPC-3 up and running on AX25 and APRS.
    Second will be getting my SignalLink USB going for HF digital (plus little details like picking an antenna, etc.).


    From there I will be playing it by ear. Amaxing that you can get this much computing power in such a small and inexpensive package. It looks like I will have about $160 in the whole set up.

    Thanks again for the push toward doing this! And thanks to everyone for all the advice and help!

    Dave, W6DPS

  17. #17
    4x4 Ham Member KF7IJB's Avatar
    Join Date
    Mar 2010
    Location
    Phoenix, Arizona
    Posts
    180
    Downloads
    1
    Uploads
    0

    Default

    Instead of a monitor, you can also use a tablet, like Android or iPad to connect to the rPi via ssh or VNC. This has an added bonus of allowing you to mount the rPi permanently inside your vehicle, but take the "monitor" and possibly a bluetooth keyboard outside your vehicle while at a campsite, etc.

  18. #18
    4x4 Ham Member KF7IJB's Avatar
    Join Date
    Mar 2010
    Location
    Phoenix, Arizona
    Posts
    180
    Downloads
    1
    Uploads
    0

    Default

    BTW, for those who don't have X11 installed on their rPi, I have a copy of omxplayer that I built from source. It will allow you to play videos from the commandline, assuming that your kernel has framebuffer support. Not really amateur radio related unless you are playing amateur radio instructional videos, etc, but it may be useful for someone that wants to have some entertainment rolled into their mobile radio computer. I played video up to 1080P and it works fine without framedrops.

  19. #19
    4x4 Ham Member
    Join Date
    Jul 2011
    Location
    Southern California
    Posts
    90
    Downloads
    12
    Uploads
    0

    Default

    Quote Originally Posted by KF7IJB View Post
    Instead of a monitor, you can also use a tablet, like Android or iPad to connect to the rPi via ssh or VNC.....
    I have enabled SSH on my Pi, and was thinking this would be a way to go using my notebook over wifi.

    Set it up in the vehicle, and be able to run APRS messages or AX.25 packet from nearby. I have been setting up for portable operation, with a mast and base that can get an antenna up 25 feet. I can put a VHF antenna at the top and rig a dipole for HF. Since I live in the People's Republic of Kalifornia, the restrictions on antennas at my house make this a very attractive option. When I set up my HF gobox on the tailgate and use my notebook for logging and PSK, i can also SSH to the Pi for packet. Or, hopefully, set the Pi up for packet, PSK, and logging.

    I haven't tried any multi-tasking with the Pi, but running either FLDigi and a logging program, or minicom and a logging program seem like viable options. The incredibly low power consumption of the Pi would be great when on battery, with or without solar charging.

    I am amazed at how much computing power I get from the Pi, with very low cost, very small size, and very low power consumption (about 1.25 amps at 13.8, including the Pi, monitor, and powered USB hub with bluetooth for the keyboard, wifi dongle, and usb-serial adapter). My notebook with AC adapter draws close to 4 amps from the DC! The laptop cost about $700, and I can get the required functions frm the Pi for a total investment of well under $200. Not to mention that it fits in the pocket on the back of the driver's seat.

    Dave, W6DPS

  20. #20

    Default

    I hadn't tested until now, but the latest Raspian distributions have SSH enabled by default. I rebuilt my SD card last night and here's how you connect without a monitor.

    Build SD card and boot RasPi.
    Remote into your router or network scan and find the IP address it pulls from DHCP.
    SSH into Pi.
    command: sudo apt-get install tightvncserver
    command: tightvncserver (set password)
    From that point, you can VNC into the RasPi without a monitor.
    Virgil - K7VZ
    Offroad and on the air.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •