2

I have two PC Engines Alix 2d2 which I've been given and I'm trying to install an (BSD or Linux based) OS on. Currently one has a version of openWRT (the other had openWRT until I formatted the CF card and put on a version of FreeDOS (I don't know if this works because no console)). Both boards were in working order before I began, allbeit working as openWRT systems. I did not test either of their serial ports before I started (although i have changed nothing about the second system so...)

In addition to the alix boards I have:

  1. a Windows desktop without a built in serial port
  2. a USB to serial adapter which I have been using with the Windows desktop
  3. a Linux box which has a serial port on the motherboard
  4. one serial cable (Startech branded, described as straight through)

I have connected each alix board to both computers 1 at a time trying to get, well, anything to come though the serial connection. I've read several articles and how-tos on the internet about the alix boards noting that the speeds mentioned either seem to be 9600 or 38400 so I've tried both.

On Windows I was using PuTTY's serial mode to connect (I double checked which com port I was using) and on Linux I was using minicom with the -D 9600/38400 -p /dev/ttyS0 (I also have ttyS1-3 but minicom would not connect to them).

I'm at a loss as to what I should try next.

5
  • Hmmm, last time I used a USB serial adapter on Linux, it was /dev/ttyUSB or something like that. /dev/ttyS0 is probably the on-board serial chip (even if you don't have ports).
    – derobert
    Commented Aug 27, 2012 at 20:00
  • Yea, sorry if i wasn't clear, my windows desktop doesn't have onboard serial so is using the usb adapter, the linux desktop does have onboard serial so isn't using the usb adaptor
    – m3z
    Commented Aug 27, 2012 at 20:03
  • Maybe, you just need to be sure to pick the right port in Minicom. Or use the on-board ports.
    – derobert
    Commented Aug 27, 2012 at 21:05
  • 1
    I recommend a little program called statserial to inspect the state of the serial port pins. Run it on /dev/ttyS0 with the serial cable initially unplugged and watch for changes when the cable is connected. Also, thinking about the serial port pins brings this to mind: are you using a null modem cable or a straight-through cable? Whichever kind of cable you are using, have you tried the other one?
    – Alan Curry
    Commented Aug 27, 2012 at 23:12
  • @Gilles: Promoted comment to an answer. Commented Aug 28, 2012 at 4:56

2 Answers 2

2

Under Linux, /dev/ttyS0 refers to the first built-in PC UART. Some PCI serial ports appear here, too.

Most serial to USB adapters present themselves to Linux as /dev/ttyUSB* instead. If you have only one plugged in, it will be /dev/ttyUSB0.

There's an alternative naming scheme, ttyACM*. These devices are using the Abstract Communications Model interface. ACM devices are most often modem-like devices, but I've used USB to serial adapters that presented themselves this way instead of as ttyUSB*.

Beware, sometimes you will be using a given device that presents one way, then they'll make a design change so that its successor device is the other way. Arduinos swing both ways, for example, and I've used USB analog telephone modems that changed between product versions that way, too.

Bottom line, in today's modern dynamic /dev world, you can be pretty sure if either exists, it's the right one to use, because neither will show up if the OS doesn't recognize the adapter.

Because these /dev nodes appear only on demand, one way to chase this is to plug the adapter in, then simply say ls -tr /dev | tail -20 or something like that to get a list of the 20 most recently-added /dev nodes. The last line is probably your device, and if not, it's probably close to the end of the list.

Another method is to say dmesg | tail. The last few lines should tell you about the new device, and it may give the /dev node it was assigned.

5
  • Thanks for taking the time to explain that, but I wasn't using the USB adaptor on the Linux box. I have now tried it, and as you say, it shows as ttyUSB0 - still no joy though.
    – m3z
    Commented Aug 28, 2012 at 8:11
  • I've tried connecting the Linux machine to the Windows machine via the serial cable and sending messages from console to console which hasn't worked. I'm starting to think I've got the wrong type of serial cable. What I don't understand is whether I need a null modem cable or not.
    – m3z
    Commented Aug 28, 2012 at 9:51
  • I've done some more research and I think I do actually need a null modem cable. I've ordered one now because they don't cost much. I'll let you know if that's all I was doing wrong.
    – m3z
    Commented Aug 28, 2012 at 10:08
  • Yes, that's a fairly likely explanation. Another way you could get the same result is to get a null modem adapter. That's a better way for temporary connections, since it means you have fewer cables to keep straight. Commented Aug 28, 2012 at 15:04
  • Again, thank-you for explaining that, it's going to be helpful I think because I am intending to experiment with some Arduinos soon.
    – m3z
    Commented Aug 29, 2012 at 8:32
1

You need a null modem cable (or a null modem adapter attached to your serial cable) if both ends of the connection are implementing the DTE side of the RS-232 protocol.

Typically computers are DTE and peripherals like modems are DCE. Your embedded board is halfway is kind of a hybrid (runs OSes that also run on PCs, but intended for use as a peripheral possibly) so it's hard to be sure what kind of serial port they'd put on it.

The gender of the connectors would be a strong indicator. If you had to use a gender-changing adapter to get your cable plugged in, chances are good that what you really needed was a null modem. DCE ports are usually female, and DTE ports are usually male, so a straight-through cable will have one of each connector and a null-modem cable will have 2 female ends.

If RJ-45 connectors are involved, things get tougher. There are more cable configurations to choose from, and gender is no longer a guide.

2
  • Thanks, That has really clarified what's going on. The alix board does have a male connector and is meant to be a stand alone system (if you want it to be) so I guess it's probably DTE. The cable I have is a straight through but with two female ends - I checked the order to confirm. So I guess I'll wait for a null modem cable which by the sounds of things is going to work just fine.
    – m3z
    Commented Aug 28, 2012 at 11:40
  • This was the answer for me. plugged it in with a null modem cable and instantly got garbage. of course the baudrate was set wrong, so changed to 38400 and got a memory check. Brilliant. Thanks for all your help everyone. Now on to PXE booting
    – m3z
    Commented Aug 29, 2012 at 8:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .