Practical Guide to Getting Started With the TS-7553-V2

 

This practical guide gives us an opportunity to take a relaxed approach to getting started with the TS-7553-V2 single board computer. We’re going to take a look at how to make our first connections, 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-7553-V2 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-7553-V2 with a development kit, including the pre-programmed microSD card and enclosure with 128×64 px LCD and 4 button keypad. 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-7553-V2.

Most of these connections are available externally, but you’ll want to unscrew the four screws on the bottom of the enclosure to get to the jumper block, microSD card, and other guts.

Jumpers

There are several jumpers on the TS-7553-V2, but we’re only interested in “SD Boot” and “No Charge” jumpers for this getting started guide. These should be set properly out of the box, but we want to double check that the “SD Boot” jumper is set, so that we boot from the microSD card (more about the bootup environments later). Then, if your unit has the TS-SILO supercapacitors, we want to disable them while we’re in development and activate them later closer to production (it can get in the way when testing). To disable, set the “No Charge” jumper. The others we can leave in their factory settings. Your jumper block should end up looking like the picture above. Note that the “U-Boot” jumper is not set, it is only on one pin and is considered to be “hanging.”

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 simply need an A/B USB cable (included in development kit). No need to deal with NULL modem cables or USB to serial adapters in this case. Just a clean, single cable solution.

It’s recommended that you work from a Linux development machine. Not only are the serial port drivers already installed, but you’ll also need it if you plan on using our cross compile toolchains for a larger project later on. For now, if you’re on a Windows or Mac OSX machine, you can obtain the serial port drivers from the Silicon Labs USB-to-UART drivers page.

Next step is to connect the USB cable to your computer and follow the instructions given in the “Get a Console” section of the TS-7553-V2 manual. This author’s preference is minicom , a no-frills, cross-platform serial communications program. Basically, we’re setting the baud rate to be 115200 with 8N1 parity, no hardware or software flow control. Typically, your serial device name may be:

  • Linux, /dev/ttyUSB0
  • Mac OSX, /dev/tty.SLAB_USBtoUART
  • Windows, use device manager to discover COM port

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.

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

The main way to power the TS-7553-V2 is through the 5 – 12 VDC barrel power connector. The power supply that comes with the development kit is the PS-5VDC-REG-1AMP-BC, 5 VDC @ 1 A. Simply plug the barrel end of the power adapter into the TS-7553-V2 and the other into the wall outlet, and you’ll see status LEDs start blinking. If you have your console setup properly, you should see the bootup process pictured below.

You could also power the TS-7553-V2 using Power over Ethernet (PoE), available with the purchase of a daughter card.

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 device via SSH or booting to an NFS filesystem. There is only one Ethernet port on the TS-7553-V2, designated eth0 in Linux. You can read more about it in the “Configuring the Network” section of the TS-7553-V2 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!

Wireless Module (Optional)

If you purchased the optional soldered down wireless and Bluetooth module, you’ll see it on the board, but there’s nothing else you need to do. The wireless antenna is integrated into the wireless module, so this is the easiest step in this guide so far. It will be designated at wlan0 in Linux.

LCD Screen

There are two ribbon cables and a power cable that attaches the TS-7553-V2 to the 128×64 px LCD screen mounted on the enclosure. These should be already attached from the factory. The brown cable is attached by an FFC connector and is latched in place. The blue cable is a simple pin connector, but be sure to take note of the orientation. Some earlier revisions require a twist in the cable while later revisions don’t. The power cable is a simple push in with locking tab. A small screwdriver makes quick and easy work of disconnecting and reconnecting these cables should you need to separate the enclosure.

Setup Networking

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 (Optional)

Out of the box, the TS-7553-V2 will automatically attempt to obtain an IP address via DHCP on eth0. There isn’t anything you should have to do, but it’s good practice to know how it works. You can skip this if you’d like, but we’re going to manually go through the steps.
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.121:

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

Next time we bootup the system with the Ethernet cable plugged in, we should automatically be connected to our network via DHCP. For this, we rely on systemd. Let’s take a look really quick at how that works. First, let’s take a look at the file responsible for setting up our Ethernet device at /etc/systemd/network/eth.network.

What we’re saying here is any Ethernet device ( eth* ) will obtain an IP address via DHCP. We’ll want to change the [Network] section to enable static IP address, which we’ll talk about in the next section. For now, let’s take a look at the status of systemd-resolved.service.

If it doesn’t say loaded and active, then we’ll need to issue the commands below. Otherwise, skip this part.

Perfect. We should be good to go now. Give your system a reboot and make sure it comes back up with an DHCP assigned IP address.

Static IP

For this, we’ll create the /etc/systemd/network/eth0.network file and add the following text to it. Make sure to modify it to fit your specific network settings. Here, I want to assign the IP address of 192.168.1.122.

And so that we don’t confuse dynamic and static IP address settings, let’s remove or move the eth.network file.

Now, restart the system. Once we’ve logged back in, we’ll do a quick test by issuing the ifconfig eth0 command and double check that our IP address has now changed.

That’s it! You should now be good to go. Next, we’ll talk about wireless connections.

Wireless

The wireless module of the TS-7553-V2, the Microchip ATWILC3000, 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-7553-V2 manual.

We’ll need to repeat the step of creating the interface configuration file like we did in the wired section before this. So, create the file /etc/systemd/network/wlan0.network and populate it with the following:

Next, we’ll enable the interface, scan for an access point, and then associate with it. Enabling the wireless interface is a simple command:

Then, we’ll want to scan for access points using iw  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.

Connect 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 (you could also use iw dev wlan0 link ):

Finally, run dhclient wlan0 to get an IP address.

Connecting to a WEP Secured Network

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

iw dev wlan0 connect "default" key 0:"yourpassword"

Same as above, follow up with iwconfig wlan0  and dhclient wlan0 .

Connecting to a WPA Secured Network

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

wpa_passphrase the_essid the_password >> /etc/wpa_supplicant/wpa_supplicant-wlan0.conf

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 service which will run in the background. Create the file /lib/systemd/system/wpa_supplicant@.service with this content:

Then, we’re going to enable to service to start on boot:

Next, we’ll start the wpa_supplicant service for wlan0:

Finally, same as the other sections above, follow up with dhclient wlan0 .
As always, feel free to review the “WIFI Client” section of the TS-7600 manual for more information.

LCD Example Code

There are some very basic LCD demos available and preloaded on the board. For more information, please see the “LCD + Keypad” section of the TS-7553-V2 manual. For the sake of convenience, you can see the “Hello, World!” demo shown in the image above by issuing the following commands:

This will draw the “Hello, World!” screen above. If you want to play around with the keypad, issue the command:

Then, you’ll be able to press the keypad buttons and get instant feedback on the LCD screen.

TS-SILO Example Script

Quite possibly the neatest feature of the TS-7553-V2 is the TS-SILO on-board backup power solution. TS-SILO provides around 20 seconds of backup power, allowing a custom script to run in the case of a power failure.

A preloaded example script will issue the shutdown -r now  command upon power failure to gracefully reboot the system to prevent filesystem corruption. Then, a microcontroller responsible for power management will hold the TS-7553-V2 in a reset state until power is restored or until the TS-SILO completely drains, browning out the whole system. Once power is restored, the system will boot back up again.

Optionally, you can set a variable in the U-Boot environment to pause system startup until TS-SILO reaches a user defined charge percentage. For more information about TS-SILO, see the “SuperCaps” section of the TS-7553-V2 manual. For now, let’s take a look at the script located at /usr/local/bin/tssilomon:

Of course, you can insert your own code here if you’d like. It runs in the background as “TS SuperCap Monitor Daemon” as part of systemd services startup. You can see this by looking at /etc/systemd/system/tssilomon.service:

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, be sure to enable TS-SILO charging again and move your application into the eMMC flash storage for extra reliability in the field.

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

Author: Derek Hildreth

eBusiness Manager for Technologic Systems