Hardware Reference
In-Depth Information
Unfortunately the Raspberry Pi only has one usable UART at a time. This is not the end of the world but it will
make things more difficult. Recall in Chapter 1 when I said you have two UARTs? Well, now you can clearly see they
are wired to the same pins. By doing this you won't be able to have the serial console and share out the serial port with
another device. At this point you're going to need to choose between the serial console and ser2net. You can see how
the Raspberry Pi can sometimes be a little limited.
Originally I had planned to use a little chip from Maxim called MAX3100. This little fellow connects via the fast
SPI bus and provides a single additional UART. You can easily have two of these on the SPI bus on the Raspberry Pi.
There is also a kernel module for the MAX3100. Unfortunately, I could not get this to work and it would have required
me to rebuild the Linux kernel to include the MAX3100 kernel module. A kernel rebuild has been something I had
been avoiding doing for the entire book. With that in mind I will be using some USB-to-serial adapters. I'd much
rather use the MAX3100 if I had a choice.
there are also i2C Uart chips but sadly many of them are not supported by kernel modules. You're just going
to need to make do with the USB and your freshly made serial port.
Note
I need to be able to connect to one of the many serial devices or console ports on devices in my home network.
Attaching a console cable would be a very annoying process; in addition to that I would not be able to change a cable
remotely. This is where the need came for a serial port as a TCP port. I had looked at many applications to do this and
ended up with ser2net.
Ser2net gives you the ability to set the speed, protocol, banner, and a whole host of other neat settings for making
your serial ports available over TCP. You can even use ser2net to present a line print terminal (LPT) port out over TCP
so ser2net is not just for serial. Just make sure your LPT port won't catch on fire.
ON FIre?
During the 1950s high-speed printers used a very hot and longish fusing oven. a fusing oven was used to bond the
ink to the paper. it was often the case that the printer would jam as they do to this day. Back then there was a large
potential for the printer to catch on fire. So the early Unix developers made an error code called “lp0 on fire.” While
the error did not mean the printer was on fire, it served as a warning that the printer was not in a healthy state and
was potentially dangerous.
Connect to your Raspberry Pi and install ser2net with the following command:
# yum install -y ser2net
You also may want to install Telnet to help you out:
# yum install -y telnet
As soon as you have ser2net installed I would recommend that you take a look though the man page (I bet
you saw that coming). There are two main files you need to be concerned with. The first and most important is
the configuration file at /etc/ser2net.conf . I normally make a copy of this file and start afresh. The file has a lot
of helpful information and examples but it's far too crowded for me to work in. Make a copy of it now with the
following command:
# cp /etc/ser2net.conf /etc/ser2net.conf.org
 
 
Search WWH ::




Custom Search