Practical Guide to Getting Started with the TS-7600

This practical guide gives us an opportunity to take a relaxed approach to getting started with the TS-7600 single board computer paired with the TS-ENC750 enclosure with TS-752 baseboard. We’re going to take a look at how to make our first connections, talk about the Linux environment, and setup the network. These are usually the first things we do before starting development. In the grand scheme of things, this is just a friendlier extrapolation from the official TS-7600 manual, so be sure to keep it handy for more advanced topics and specific details. The only assumption being made is that you’ve purchased the TS-7600 with a development kit, including the pre-programmed microSD card and TS-ENC750 and TS-752 baseboard. Right then, let’s get started!

Connections and Jumpers

Let’s take a look at the most basic of connections: serial console, power, and Ethernet. Follow along in order and we’ll be ready for the next section when we actually apply power and start using the TS-7600. Take note, we are going to use the TS-ENC750 enclosure with TS-752 baseboard which is responsible for bringing out a RS-232 level serial console from the 40-pin header of the TS-7600. In your final product, this enclosure and baseboard might not be necessary, but for early development, it’s a must have.

Pro Tip: Technically, you should also be able to cheat and use something like this FTDI Serial TTL-232 USB Cable, but we can’t fully endorse everything will operate as smoothly for you as the TS-752 will.

Jumpers

There are two jumpers on the TS-752 baseboard that set the board to boot from either the microSD card(s), the TS-7600’s onboard 8 MB SPI flash, or the TS-752’s onboard 8 MB SPI flash. Out of the box, they are set to boot from the microSD card(s). If you were to unset JP1, you’d boot to the TS-7600’s SPI flash. If you were to set JP2, you’d boot to the TS-752’s SPI flash. We’ll talk more about the bootup environments later in “About the Embedded Linux Environment” section.

Serial Console

Nothing beats a good ‘ol serial console for direct access to an embedded system. Where others like telnet and SSH might fail due to bad startup scripts or network snafus, a direct serial console connection will always be there to bail you out. For this, you’ll need a NULL modem cable and a DB9 Serial to USB adapter (and the TS-ENC750 with TS-752 baseboard, as mentioned earlier). Technologic Systems has the NULL modem cable available for sale, as you probably seen when ordering it, but they do not sell a serial to USB adapter. You can get them from many places, and, having learned from experience, it seems that the ones with the Prolific PL2303 chipset are easiest and most compatible, like this one from Amazon.com. If you go this route, you’ll want to be sure to download and install the Prolific PL2303 drivers here. Note, if you’re on a Linux machine you shouldn’t have to install any drivers, as they come preloaded in the Linux kernel, otherwise, for Windows or Mac users, you’ll need to download the drivers. If you need a NULL modem cable, they have them available on Amazon.com, like this one.

Pro Tip: If you’re in the market, another engineer here pointed out this little gem of a USB to serial adapter. With it, you wouldn’t even need the extra NULL modem cable.

Prolific PL2303 Serial to USB Adapter
Prolific PL2303 Serial to USB Adapter

Connect the NULL modem cable directly to the RS-232 port on the TS-7600 and the serial to USB adapter. After installing the Prolific PL2303 drivers on your computer (a restart may be required), plugin the serial to USB adapter into your computer. Fire up your favorite serial console program, beit minicom, screen, picocom, PuTTY, etc., and set the serial device to use 115200 baud, 8n1 (8 data bits 1 stop bit), and no flow control. Complete instructions can be found in the “Serial Console” section of the TS-7600 manual. For reference, here’s a screenshot from Mac OSX using minicom:

As for now, that’s all there is to getting the serial console setup. We’ll actually use the serial console in the next section or after power is applied. Let’s move on to talking about the power connections.

Power

There are a couple different ways to power the TS-7600. One is with a 5 VDC power regulator, like the PS-5VDC-REG-8PG that comes with the development kit or sold separately. The other is with a A/B USB cable plugged into a computer. For this guide, we’re going to opt for the USB cable for the slight convenience it provides. If you go with the PS-5VDC-REG-8PG, you’ll need to remove the connector already in place directly below the USB ports and plug in the 8-pin adapter connected to the power supply. Whichever option you choose, simply plug one end into the TS-7600 and the other into a computer (for USB) or wall (for power regulator), and you’ll see status LEDs start blinking. If you have your console setup properly, you should see the bootup process pictured below.

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-7600, designated eth0 in Linux. You can read more about it in the “Configuring the Network” section of the TS-7600 manual. So, plug in a standard Ethernet cable connected to your router or switch, and we should be good to proceed to the next section!

USB Wireless Adapter (Optional)

The TS-7600 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.

Featuring DoubleStore Solution

The TS-7600 comes with a resilient data storage solution we call DoubleStore. You can think of it as a RAID-like setup using two microSD cards so that if one goes bad, you can recover from the other. Embedded systems are usually installed into power-tricky environments where power can unexpectedly be pulled. Like pulling a rug from underneath your younger sibling, the filesystem on the microSD card can end up in a corrupted state. DoubleStore is a preventative measure for that situation. Take a look at our DoubleStore Whitepaper and Preventing Filesystem Corruption Whitepaper for more information. For development purposes, a single microSD card will suffice. Perhaps, when we’re ready to move into production, a second microSD card can be used to take advantage of DoubleStore.

About the Embedded Linux Environment

Before we explore too much further, we should get the lay of the land. The TS-7600 has two different storage mediums from which to boot from: 1.) the onboard 8 MB SPI flash and 2.) the dual microSD card. Furthermore, there’s another SPI flash on the TS-752 baseboard that you can boot from as well, although it’s mostly just used as a recovery mechanism, see the “Host Board Recovery” section in the TS-752 Manual.

There are two different Linux environments: 1.) a fast-booting (4 seconds) initramfs with Busybox shell, and 2.) a full Debian distribution. The initramfs with Busybox is a minimalistic, ready only environment which can be booted quickly 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 on the microSD card, 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.

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-7600 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:

Default Boot to Debian

Assuming you’ve applied power, setup a serial console, and are now looking at a shell terminal, awaiting our commands, let’s configure the TS-7600 to skip the initramfs and boot directly to Debian. For this, we’ll need to set the soft jumper, JP1 as documented in the “Initramfs” section of the TS-7600 manual. For this, we use the tshwctl  command followed by a reboot:

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.

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 eth0 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-7600, 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-7600 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-7600 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 could replace the TS-752 baseboard with a board of your own design, or not, the TS-752 is a production-ready and handy baseboard as is!

If you’re looking for some inspiration, take a look at this temperature server project titled “The Weather Outside is Frightful (Or is it)?“, which used a TS-7500 (TS-7600’s older twin brother).

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

Author: Derek Hildreth

eBusiness Manager for Technologic Systems