3
\$\begingroup\$

I'm trying to use a RS-232 cape in a python script. A TU-S9 USB-to-Serial converter works just fine with same code I just change the port. So I don't think it is my code. The only thing I can think of is that I am missing something setup wise. The Cape doesn't come with any documentation (that I have found). I've tried UART 1,2,4 same result. the port will open but it never gets a response from the device. The device is a DirectLogic 05 PLC. I'm using ModBus RTU.

Edit: from what I can tell the UART ports for the beaglebone are listed as /dev/ttyO0, /dev/ttyO1,/dev/ttyO2,/dev/ttyO3,/dev/ttyO4. /dev/ttyO0 is used by the OS though.

\$\endgroup\$
5
  • 2
    \$\begingroup\$ I disagree with the close vote saying this is off-topic because it is a question about the use of an electronic device. Rather, this is about the firmware programming of a peripheral for an embedded system, which is certainly on-topic on this site. If you went by this person's logic, then practically every firmware question on this site would be off-topic. \$\endgroup\$
    – tcrosley
    Sep 16, 2014 at 4:06
  • \$\begingroup\$ If someone would like to susgest a better SE site for this im all ears. But this doesnt fit any stack exchange site well. \$\endgroup\$ Sep 16, 2014 at 4:13
  • \$\begingroup\$ No, just stay here, you're fine. We have lots of BeagleBone Black questions here already as you can see from the RELATED column to the right. I've got a BBB myself; sorry I can't help you out on this question. \$\endgroup\$
    – tcrosley
    Sep 16, 2014 at 5:08
  • \$\begingroup\$ Can you probe the signals on the board with a scope? See which UARTs you have available? The UARTs should also show up in the /dev directory, probably named /dev/ttyACMxx (ACM may vary) or similar. That way you can investigate which ports you have available. \$\endgroup\$
    – jippie
    Sep 16, 2014 at 5:33
  • \$\begingroup\$ It's not a great SE question. The right place would be the support site for the RS232 cape. \$\endgroup\$ Sep 16, 2014 at 14:55

1 Answer 1

1
\$\begingroup\$

Using the version 3.8 or higher of the Linux Kernel, you can set a Device Tree Overlay.

By this method, at runtime, you can incorporate the system device drivers.

Personally, I implemented the necessary hardware to operate with a RS-485 interface and Modbus protocol. This basically is the hardware for Bus transceiver and its associated components. When I wanted to start the operation, I could see that the ttyO4 port was not enabled.
I found the solution here, where the code is presented to compile an Overlay to enable the port ttyO4. Once implemented this, everything worked properly.

Attention

In Beaglebone board I used, the operating system installed was Ubuntu. When compiling the file with the Overlay, compilation tool threw an error concerning did not recognize the option "@". This is solved, and here's how to apply the patch for the Overlay compiler. Therefore, I recommend the Overlay compiler what you obtain source code instead of using a repository.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.