Practical Guide to Getting Started with the TS-7400-V2

Introduction

This guide aims to get you through the basic steps of getting your TS-7400-V2 up and running so you can begin development. It’s mostly an extrapolation of the official TS-7400-V2 Manual, but provides a more practical and casual approach in setting up connections, networking, and general environment.

Upgrading from the Original TS-7400

Yes, the “V2” in TS-7400-V2 does stand for “version 2”, and it’s the upgrade path for users of the old TS-7400, which is pictured below for comparison. If you’re coming from the old TS-7400, you should find yourself comfortable with the TS-7400-V2 as we tried to keep things as similar as possible. You’ll still want to take a look at the “TS-7400-V2 Migration” section of the TS-7400-V2 manual for any pinout changes.

 

Connections

Let’s get our TS-7400-V2 hooked up! This includes our very basic connections we’ll need for most any development or project: power, serial console, Ethernet, and WiFi.

Jumpers

There isn’t much to be said for jumpers on the TS-7400-V2 other than to note there is a SD Boot jumper that determines whether or not the TS-7400-V2 will boot from the microSD card or the 2 GB onboard eMMC flash. For this guide, we’ll be booting to the microSD card. If we were further in our development, and ready for production deployment, we might think about loading our application to the eMMC flash and boot from it instead.

Serial Console

A good ‘ol serial console provides a reliable and consistent connection to the single board computer. Other methods like SSH or Telnet are nice too, but a serial console isn’t prone to failure because of botched startup scripts or network snafus. In order to get a serial console from the TS-7400-V2, we’ll need the following items:

  • TS-9441 Peripheral Board
  • DB9 to 10-Pin Header Adapter Cable (Part# RC-DB9)
  • NULL Modem Cable (Part# CB7-05)
  • Optional USB to Serial Adapter

These days, computers aren’t coming with a serial port, so the USB to serial adapter is handy to have. You can purchase them from computer stores or online, like this one from Amazon.com. We’ve had the best luck with those based on the Prolific PL2303 chipset, which has drivers for Windows and Mac easily available (Linux has these drivers pre-installed).

This is what you should have after connecting all of these adapters together:

The final piece to this puzzle is the TS-9441 peripheral board, which we need because there isn’t an RS-232 transceiver onboard the TS-7400-V2. This is different from other single board computers, but it helps to reduce costs in the production stage when larger quantities are being ordered. The TS-9441 board can also assist with recovering a board in case something goes horribly wrong.

So, with the TS-9441 board in hand, it’s fairly obvious how it needs to connect with the TS-7400-V2 header pins. The console comes out on the 10-pin header of the TS-9441 labeled “Console”. Make sure that the red wire of the 10-Pin to DB9 adapter cable matches up with the white dot on the Console header, as shown in the picture above.

After installing drivers for your USB to serial adapter, plug the serial to USB adapter into your computer and follow the instructions given in the “Get a Console” section of the TS-7400-V2 manual. Since I’m developing from a Mac OSX machine, I’ll be using minicom, a command line program for terminal emulation. Linux users can also use minicom. Windows users will reach for PuTTY, a GUI terminal emulator. At any rate, after setting up your console and applying power, which we’ll talk about next, you’ll see something similar to the screenshot below (Mac OSX Terminal running minicom, using /dev/tty.usbserial):

Pro-tip: Running minicom  alone will constrain the terminal row and column count to something pretty small that will never take up the whole terminal window. To take advantage of all the real estate your terminal window has to offer, run TERM=linux minicom  instead. Remember to setup an alias as a shortcut for yourself!

Power

To power the TS-7400-V2 , we’ll be using the 5 VDC, 1.5 A power adapter (Part# PS-5VDC-REG-1AMP-BC) with barrel connector which we purchased when ordering the board. If you’re looking for other methods to power the board, please consult the “Booting up the Board” section of the TS-7400-V2 manual. The connector is located next to the USB ports on the TS-7400-V2. Simply plug it in, and you’ll be up and running. There will be a green status LED lit on the TS-7400-V2 and TS-9441 peripheral board. If you’ve been following along and completed the serial console steps, you should also see bootup messages.

Ethernet

Naturally, we’ll want to be able to connect this to the network so we can get it to talk with the local network or Internet, or even accessing the board via SSH or booting to an NFS filesystem. There is only one Ethernet port on the TS-7400-V2 designated as eth0, which is next to the USB ports. So, plug in a standard Ethernet cable connected to your router, and we should be good to proceed to the next steps!

Pro Tip: If you’d like to see all of the network interfaces, simply execute the command ‘ifconfig -a’ to see all available interfaces, and ‘ifconfig’ to see all enabled interfaces.

USB Wireless Adapter (Optional)

The TS-7400-V2 can be ordered with an optional USB wireless adapter. As of this writing, it’s the TP-LINK TL-WN722N, which uses the Atheros AR9002U chipset. Simply take the cap off and plug it into one of the two USB ports. Once the wireless interface is enabled, which we’ll talk about soon, you’ll see a green status LED light up.

About the Embedded Linux Environments

There are two sources from which to boot on the TS-7400-V2: the onboard 2 GB eMMC flash and microSD card (sold as a separate option, included in development kit). Each of these boot sources, or boot drives, contain two Linux environments: 1.) fastboot, which boots to a minimalistic initial ramdisk using busybox shell in about 3 seconds, and 2.) a full Debian distribution, which is more familiar to most Linux users, which boots in about 45 seconds. More on both of these in the next section. We’ll be working in the Debian environment for this guide.

Pro Tip: For development, best practice is to boot to microSD card for ease of recovery should something go wrong. Just plug the microSD card into a Linux development machine and modify files directly.

Furthermore, there are some helpful user space utilities preloaded with the TS-7400-V2 which make it easy to do things like toggle DIO and LEDs called tshwctl (TS Hardware Control). A quick look at the –help menu gives you an idea of what it’s capable of:

 

For example, issuing the command tshwctl –redledon will turn on the red LED next to the Ethernet port.

Default Boot to Debian

At this point, we should be looking at a shell terminal, awaiting our commands. This shell is what we call an initial RAM disk, or initrd, with a Busybox shell. It’s a minimalistic, read-only environment which can be booted quickly (3.13 seconds) and begin executing your programs. Busybox is known as the “The Swiss Army Knife of Embedded Linux”, and you can accomplish quite a bit here. This is an excellent spot to put production-ready code because of the fast bootup and the read-only nature. For development, the Debian environment, which is pre-installed on the startup drive, is perhaps the easiest to work with, especially for those getting their feet wet in embedded Linux. So, we’re going to boot to the Debian environment, which gives us access to not only a more familiar Linux environment with tools like apt-get and compilers, but also an environment with more storage and debugging tools. We could type the command exit to begin booting to Debian, but we don’t want to do this every time. Instead, we’ll simply remove the file /ts/fastboot to boot to Debian by default as documented in the “Initramfs” section of the TS-7400-V2 manual. You should now see Debian startup sequence, followed by a login. For this, we’re just going to use ‘root’ as the user name. There is no password by default.

Pro Tip: If you’d like to use SSH after setting up your network connection, you’ll need to set a password. Run passwd to create a password followed by dpkg-reconfigure openssh-server. Also, refer to the “Setting up SSH” section of the TS-7400-V2 manual.

Pro Tip: If you’d like to run your application automatically upon boot, which is a very common request, take a look at the “Starting Automatically” section of the TS-7400-V2 manual.

Setup Networking

Next, let’s take a look at getting connected to the network and Internet through wired and wireless connections.

Wired

If you recall, we’re going to be setting up our eth1 network interface. For this, we’re going to follow the “Configuring the Network” section of the manual. First, we’ll enable the network interface, and then we’ll go about obtaining an IP address. The easiest way to get an IP address is dynamically using DHCP. For some applications, like a web server, a static IP address is better to use. We’ll take a look at both.

Dynamic IP

First, we need to enable the eth0 network interface by issuing the following command:

Then, in order to get an IP address, we issue the command:

Issuing the ifconfig command should show us our connection information, which in this case the board was assigned the IP address of 192.168.1.135:

 

Nothing to it! You should now be able to ping an external URL to test your connection:

Static IP

For this, we’ll edit the /etc/network/interfaces file to read like the following. The highlighted section is what we’re adding. Make sure to modify it to fit your specific network settings.

The next thing we need is to tell our network interface which DNS nameservers to use, so that we can ping by domain name, like debian.com. For this, we’ll edit /etc/resolv.conf and use the same gateway IP from above as the nameserver. You file should look like something like this:

After saving your changes, we simply need to enable the interface and then reload the service responsible for the network interfaces. To do this, we run the commands:

Then, you should be able to run ifconfig eth0 and see the settings applied.

You may want to test your connection at this point. Try pinging your gateway, aka router. You’ll know it’s successfully up and running when you see 0% packet loss in the report.

Wireless

The USB wireless dongle sold with the TS-7400-V2, the TP-LINK TL-WN722N, uses the Atheros ath9k_htc driver and is not only capable of connecting to a wireless access point, but it can also behave as an access point itself (aka master mode). We’ll concentrate on connecting to an access point in this guide. If you’d like to use it as an access point, you’ll want to review the “Host a WIFI Access Point” section of the TS-7400-V2 manual.

Since we’ve already completed the step of creating the interface configuration file in the wired section before this, we’ll just jump right into enabling the interface, scanning for an access point, and then associating with it.

Enabling the wireless interface is a simple command:

Then, we’ll want to scan for access points using iwlist like so:

The output can be overwhelming, so you may want to filter out just the essid names using the command:

Okay, so once you’ve identified an access point you want to connect to, you’ll need to associate with it. Now, there are open access points that don’t require any credentials to associate and there are protected ones using WEP or WPA security types.

Connecting to an Open Network

This is the easiest. You’ll be able to simply issue the following command to associate:

Now, make sure you’ve associated with the access point:

Finally, run udhcpc -i eth0 to get an IP address.

Connecting to a WEP Protected Access Point

Very similar to ‘Open Access Point’ section above except you’ll need to specify a password:

Same as above, follow up with iwconfig wlan0 and udhcpc -i wlan0.

Connecting to a WPA Protected Access Point

For this, we’re going to use the wpa_passphrase and wpa_supplicant utilities which make life easier. First, create the /etc/wpa_supplicant/ directory and generate a passphrase configuration file. Replace ‘the_essid’ and ‘the_password’ with the essid and password to connect to the access point.

You can take a look at this file, but essentially it contains information and a hashed password for the association. Next step is to start the wpa_supplicant daemon which will run in the background.

You should see output similar to this:

Then, same as the other sections above, follow up with iwconfig wlan0 and udhcpc -i wlan0.

Finally, if you want your connection to be there when you reboot, you’ll need to configure systemctl to automatically set everything for you.

As always, feel free to review the “WIFI Client” section of the TS-7400-V2 manual for more information.

Conclusion

In this getting started guide, we took a quick look at how to get everything connected, how to communicate with the board, and how to setup networking. You should be well on your way in developing your application. Once you’ve finished with development and are ready to move into production, you can take the TS-9441 peripheral board off and replace it with your own peripheral board. Also, be sure to take a look at the available rugged enclosure to protect your system.

Is there anything else you’d like to see added to this practical getting started guide for the TS-7400-V2? Be sure to comment below, and we’ll get it added!

Author: Derek Hildreth

eBusiness Manager for Technologic Systems