Hardware Reference
In-Depth Information
As you can see from Listing 9-2, ser2net will listen on port 2001 and 2002 by using the Telnet protocol for both
connections. The next sections (0 and 60) are timeout values; if you use 0 as a timeout the timeout function will be
disabled. Then I give it the device node name followed by the port speed and lastly I set a banner for each connection.
In Listing 9-2 I used some special escape codes in the banner. I will explain them now:
\p is the TCP port you are connected to
\d is the physical device you're connecting to
\r\n is a new line and a carriage return
You can find all supported escape codes in the man page, but you knew that already as you have read the man
page, right? Now that your configuration file is complete it is time to connect the remote devices to your serial port
and start ser2net. To start ser2net on Fedora, type the following command:
# service start ser2net
If you want ser2net to start on boot, ensure that you run the following command:
# chkconfig ser2net on
Give it a try! From another machine on your network, connect to the Raspberry Pi on one of the ports. I will
connect to port 2001. Take a look at Figure 9-14 to see this in action.
Figure 9-14. A remote ser2net connection working!
To exit the session, hit Ctrl+] and then just type “quit” to exit the Telnet application. Congratulations! You now
have a serial port presented over a TCP connection.
Summary
In this chapter you found out all about how a serial port works and why having a UART will not always mean you
can use a serial connection. You then found out the disappointment of UART1 on the Raspberry Pi. This was an
unfortunate surprise that you only have one real active UART on the Raspberry Pi. After learning this fact, I talked
about the history of a very common logic-level shifter and then showed you how to construct your own logic-level
shifter based on the MAX3232. Even with all your hard work, you still could not log in to the Raspberry Pi and then
I explained the process of how a getty works and where the name originally came from. Then you set up a getty
process to respawn on the console port.
After all that, I showed you how to disable the getty process so that you could set up a favorite application of mine
called ser2net. I showed you how to write a basic ser2net config file and then showed you what ser2net looks like in
action by connecting to my Mini210S ARM board.
 
Search WWH ::




Custom Search