Computer Serial Port Configuration

From MobileRobots Research and Academic Customer Support

Jump to: navigation, search

The serial ports of a robot's onboard computer are preconfigured when the robot is assembled. However, if you are using your own laptop or reinstalled the operating system, and the serial port stops working and you have problems with serial devices such as the robot platform or a SICK laser, you can check that it is configured correctly.

Contents

Symptoms of IRQ conflicts in ARIA

If ARIA encounters errors communicating with the robot or SICK laser, it will print messages similar to the following:

ArRobotPacketReceiver::receivePacket: bad packet, bad checksum

Or

ArSickPacketReceiver::receivePacket: bad packet, bad checksum
ArSickPacketReceiver::receivePacket: wrong address (0x9 instead of 0x80)

Or

ArLMS2xxPacketReceiver::receivePacket: bad packet, bad checksum
ArLMS2xxPacketReceiver::receivePacket: wrong address (0x9 instead of 0x80)

Or it may simply be unable to connect to the device, with message such as:

ArSick: waiting for laser to power on.
ArSickPacketReceiver::receivePacket: wrong address (0x0 instead of 0x80)
ArSick: Failed to connect to laser, no poweron received.

Or

ArLMS2xx: waiting for laser to power on.
ArLMS2xxPacketReceiver::receivePacket: wrong address (0x0 instead of 0x80)
ArLMS2xx: Failed to connect to laser, no poweron received.

You may also receive similar messages if there is an unreliable physical connection between the computer and the robot or device, or if a USB Serial Port Adapter is not transmitting all data correctly.

Configuring Computer BIOS

On a Cobra EBX-12 onboard computer, the computer BIOS must be configured properly to assure serial-port functionality.

On a Mamba EBX-37 onboard computer, the BIOS defaults work fine, if COM3 and COM4 are enabled.


Serial Port Linux Device Name Windows Device Name Typical attachment Cobra EBX-12 recommended IRQ Mamba EBX-37 default IRQ
1 /dev/ttyS0 COM1 robot microcontroller 4 4
2 /dev/ttyS1 COM2 Arm, Pan/tilt unit (PTU), Pan/tilt/zoom (PTZ) control of PTZ camera, touchscreen, others 3 3
3 /dev/ttyS2 COM3 LMS-200 Laser 10 7
4 /dev/ttyS3 COM4 GPS, PTU, PTZ camera, compass, touchscreen, others 5 5


Setting BIOS settings on a Cobra EBX-12 Computer

  1. Connect a keyboard and monitor to the side or top console panel.
  2. Turn on or reset the onboard computer, and enter the computer's BIOS configuration (Press the DELETE or DEL key before OS boot)
  3. disable IRQ-sharing, if configurable
  4. verify that the serial IRQ settings match the default settings listed above and are unique. Typical device-attachments are also listed, but be sure to verify your own device-connections since they vary widely.
  5. Try to avoid PCI-Slot IRQs that overlap with serial-port IRQs, changing or disabling any if necessary or unused.
    • for Redhats: IRQ 9 (use 10 if 9 is unavailable/already used)
    • for Debian 3/Windows XP: IRQ 10

Setting BIOS settings on a Mamba EBX-37 Computer

  1. Connect a keyboard and monitor to the side or top console panel.
  2. Turn on or reset the onboard computer, and enter the computer's BIOS configuration (Press your DEL or DELETE key before OS boot)
  3. Use left/right arrow keys to select the SIO section
  4. verify that the serial IRQ settings match the default settings listed above and are unique. Typical device-attachments are also listed, but be sure to verify your own device-connections since they vary widely. Enable COM3 and COM4 of they are disabled. (Use the up and down arrow keys to select a field, and use +/- to change.)
  5. Use left/right arrow keys to select the Exit section, select the option to save and exit, and press enter.

Configure serial port settings in Linux

After booting Linux, verify the setserial setting is equivalent to the BIOS setting. Check each serial port device. In Linux, /dev/ttyS0 refers to the port named COM1 in the BIOS settings, /dev/ttyS1 is COM2, /dev/ttyS2 is COM3, /dev/ttyS3 is COM4, etc. The setserial command, given the serial port device, prints its current settings:

setserial /dev/ttyS0
setserial /dev/ttyS1
setserial /dev/ttyS2
setserial /dev/ttyS3

If incorrect, set manually by adding the irq keyword followed by the IRQ number:

 setserial /dev/ttyS2 irq X 

Where X is the same value as the BIOS setting. These settings will be temporary.

If you do not have the setserial command installed, it can be installed with the following command if the robot is connected to the Internet:

apt-get install setserial

You can test that connections to serial devices work using the ARIA 'demo' example and other example and test programs.

To save these settings:

  • Redhat 7: add the appropriate setserial commands to /etc/rc.d/rc.local
  • In Debian 3.1, edit the file /var/lib/setserial/autoserial.conf. It should look something like this for a Cobra EBX-12 computer:
 /dev/ttyS0 uart 16550A port 0x03f8 irq 4 baud_base 115200 spd_normal skip_test
 /dev/ttyS1 uart 16550A port 0x02f8 irq 3 baud_base 115200 spd_normal skip_test
 /dev/ttyS2 uart 16550A port 0x03e8 irq 10 baud_base 115200 spd_normal skip_test
 /dev/ttyS3 uart 16550A port 0x02e8 irq 5 baud_base 115200 spd_normal skip_test
  • In Debian 5 on a Mamba EBX-37 computer, settings should be automatically saved on system shutdown. You can change it to only autosave once or to be manually set in /var/lib/setserial/autoserial.conf by running dpkg-reconfigure setserial and choosing the desired option.

If you have an arm connected to /dev/ttyS1, you may need to change the baud_base number to 9600. This will make it impossible to connect with the port to the robot controller and some other devices.

Disabling APIC

If issue persists, try the above while booting with the noapic kernel option provided. (Edit the Linux kernel entry at the boot loader menu on startup, and append noapic).

Personal tools