Beaglebone Black and RS485 Cape Interface

3,128 views
Skip to first unread message

sri...@faststreamtech.com

unread,
Sep 23, 2016, 9:10:14 AM9/23/16
to BeagleBoard
Hi,

 I got this Beaglebone Black RS485 Cape from amazon https://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=BeagleBone+Black+CAPE+RS485&pldnSite=1  I'm new to Beaglebone Black and RS485 Cape. I didn't any source for the communication between RS485 and BBB online. So I need help in software module and and how to communicate using RS485 via BBB. In the end I want to control Relay (3.3V / 5V) using RS485 Cape.

Travis Lytle

unread,
Oct 8, 2016, 9:30:23 PM10/8/16
to BeagleBoard
I've use the dts from waveshare website and have used the can portion of the board with no issue.

Firrel

unread,
Nov 4, 2016, 6:07:49 AM11/4/16
to BeagleBoard
Hi Travis,

I am trying to do the same thing as you. With the Waveshare RS485/CAN cape make the CAN portion working. Could you please specify the steps you made in order to make it working? Were you using the provided image from 2013 or a clean new image?

Best regards
Firrel

Dňa nedeľa, 9. októbra 2016 3:30:23 UTC+2 Travis Lytle napísal(-a):

Bouni

unread,
Nov 30, 2016, 2:41:05 PM11/30/16
to BeagleBoard
Hi,

I have almost the same situation. I have a Beaglebone Green and the Waveshare RS485 CAN CAPE mentioned in the first post.
In the near future I want to use RS485 to build a Modbus TCP to Modbus RTU Gateway to communicate with a central ventilation system in my house.

What i found out so far is that the Waveshare cape can by default only receive or transmit, but not both because it has no way to switch the /RE and DE pins of the MAX485.
But in my opinion the middle pin of the 485_RSE JMP Jumper header could be connected to a appropriate pin using a jumper wire.

My problem at the moment is that i have no idea if the kernel shipped with the BeagleBone Green (3.8 something) is able to handle RS485, especially direction switching.

I've read that I should use the omap-serial driver instead of the 8XXX-serial driver and that i have to apply some overlay stuff, but actually 'm completely lost.
It would be very helpful if somebody could point out what steps i need to do in order to get RS485 working.

William Hermans

unread,
Nov 30, 2016, 3:15:30 PM11/30/16
to beagl...@googlegroups.com
On Wed, Nov 30, 2016 at 11:45 AM, Bouni <bo...@owee.de> wrote:
Hi,

I have almost the same situation. I have a Beaglebone Green and the Waveshare RS485 CAN CAPE mentioned in the first post.
In the near future I want to use RS485 to build a Modbus TCP to Modbus RTU Gateway to communicate with a central ventilation system in my house.

What i found out so far is that the Waveshare cape can by default only receive or transmit, but not both because it has no way to switch the /RE and DE pins of the MAX485.
But in my opinion the middle pin of the 485_RSE JMP Jumper header could be connected to a appropriate pin using a jumper wire.

My problem at the moment is that i have no idea if the kernel shipped with the BeagleBone Green (3.8 something) is able to handle RS485, especially direction switching.

I've read that I should use the omap-serial driver instead of the 8XXX-serial driver and that i have to apply some overlay stuff, but actually 'm completely lost.
It would be very helpful if somebody could point out what steps i need to do in order to get RS485 working.


We bought a Logicsupply RS485 / CAN cape for a similar purpose. The CAN device we were trying to communicate with was actually a Schneider AC inverter, using a proprietary CANBUS protocol called "Xanbus"( Originally Xantrex ).

Anyway, for your case, I'm wondering why you need RS485 / Modbus at all. Considering the beaglebone has an ethernet port . . .I mean, you're probably going to want to use Cat5e, or Cat6 anyway, right ?

Bouni

unread,
Nov 30, 2016, 7:50:18 PM11/30/16
to beagl...@googlegroups.com
Hi,

indeed i want to go for Modbus TCP, but unfortunately my ventilation system has only Modbus RTU. The BB will act as a Gateway between Modbus TCP and Serial Modbus RTU.
--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

Firrel

unread,
Dec 1, 2016, 4:11:21 AM12/1/16
to BeagleBoard
Hi,

I managed to get the CAN portion working following this forum . It is about the same cape.
At this site, you have a document named getting started and there are indicated steps on how to configure and test UART on that cape.
I would suggest you to use codesys for your application as it has built in Modbus RTU, at least for the testing purposes. On their forum there are some interesting topics on beaglebone and raspberry, so you can try your luck there.
As I never tried the UART portion of that cape, I can't give you exact steps, but I hope this will help you.

Best regards
Firrel

Dňa štvrtok, 1. decembra 2016 1:50:18 UTC+1 Bouni napísal(-a):

William Hermans

unread,
Dec 1, 2016, 5:05:54 AM12/1/16
to beagl...@googlegroups.com
On Wed, Nov 30, 2016 at 1:21 PM, Bouni <bo...@owee.de> wrote:
Hi,

indeed i want to go for Modbus TCP, but unfortunately my ventilation system has only Modbus RTU. The BB will act as a Gateway between Modbus TCP and Serial Modbus RTU.

Does your ventilation system output Modbus over RS485, or is there pure CANBUS output ? What I was proposing, in the case of the later situation. Was to capture the CANBUS output, and directly send that data out over the ethernet port. There are several ways this can be done, and really depends on your programming experience level.

What I did for our case was "decode" the J1939 / Fastpacket 2000 PGN's in real time. Then parse the data out to an intermediary file. Using POSIX shared memory. Where the second half of the application, took that data, and sent it out via a web app / web socket. All this was done directly on the Beaglebone, in real-time, at 1Mbit frame rate. The application also only used around 1% CPU. Both sides. Anyway, I used the socketCAN library to do all this,

Another way you could save this data, if you do not need to communicate data back to your ventilation system. Would be to use the socketCAN candump utility. To dump( pipe ) the CANBUS packets directly into Netcat, and then out to a remote system for later parsing . . . The remote system would also have to be running Linux too in this case. As I believe that there is a netcat binary for Windows, but I think this would not be a very smart move.

However, if your output is Modbus RTU *only*. I'm not very familiar with Modbus, and what your options are. Except, as I recall there is a Linux Modbus development framework of some sort.

Bouni

unread,
Dec 1, 2016, 7:06:24 AM12/1/16
to BeagleBoard
Hi,

thanks for your answers!

I've searched the web yesterday in the evening for quite a long time and stumbled up on this page:


If I got it right, I can use the installed Kernel (Linux beaglebone 3.8.13-bone71.1) because as of  3.8.13-bone39 RS485 support is built into the kernel.

I just did a quick test:

- The beaglebone is connected via USB to my laptop, I ssh into it over said usb.
- I have a USB-RS485 adapter connected to my laptop as well
- both devices are connected with 2 wires (A&B)
- I've set the jumper to UART4, for both RX and TX
- I also connected the RSE pin to P9_15 which is GPIO48
- UART 4 was activated throug /boot/uEnv.txt (cape_enable=capemgr.enable_partno=BB-UART4) 

I'm able to communicate over RS485. In my opinion i should be able to complete my project with these preconditions.

@William: my ventilation system is completely passiva as far as i know. It features a Modbus RTU server from which i can request information or send new settings over Modbus RTU.
My Homeautomation system can only handle Modbus TCP. So my plan is to let the BB run a Modbus TCP server which translates the TCP requests to RTU and send them to the ventilation system.
The answers just go the other way round.

William Hermans

unread,
Dec 1, 2016, 8:39:53 AM12/1/16
to beagl...@googlegroups.com
On Thu, Dec 1, 2016 at 5:06 AM, Bouni <bo...@owee.de> wrote:
Hi,

thanks for your answers!

I've searched the web yesterday in the evening for quite a long time and stumbled up on this page:


If I got it right, I can use the installed Kernel (Linux beaglebone 3.8.13-bone71.1) because as of  3.8.13-bone39 RS485 support is built into the kernel.

I just did a quick test:

- The beaglebone is connected via USB to my laptop, I ssh into it over said usb.
- I have a USB-RS485 adapter connected to my laptop as well
- both devices are connected with 2 wires (A&B)
- I've set the jumper to UART4, for both RX and TX
- I also connected the RSE pin to P9_15 which is GPIO48
- UART 4 was activated throug /boot/uEnv.txt (cape_enable=capemgr.enable_partno=BB-UART4) 

I'm able to communicate over RS485. In my opinion i should be able to complete my project with these preconditions.

I was considering sending you that link yesterday, but figured you knew of it already.
 
@William: my ventilation system is completely passiva as far as i know. It features a Modbus RTU server from which i can request information or send new settings over Modbus RTU.
My Homeautomation system can only handle Modbus TCP. So my plan is to let the BB run a Modbus TCP server which translates the TCP requests to RTU and send them to the ventilation system.
The answers just go the other way round.

 Ah, ok  got it.

narravams...@gmail.com

unread,
Apr 20, 2017, 9:20:32 AM4/20/17
to BeagleBoard
hello hi Travis Lytle i am using same waveshare cape to interface with my begalbone black.here i have to read can data using begalbone black but i have some questions regarding this can u please help me out??

if i use this board with my begal bone black is it possible to read CAN messages ???

how to interface this with my begalbone black board?? i mean any circuit diagram??

is there 120ohm termination resistor on board?

har...@gmail.com

unread,
Apr 18, 2019, 12:45:58 PM4/18/19
to BeagleBoard
Hi
if you want to use RS485 on WAVESHARE BB CAPE just desolder CAN driver and everything should be fine.

br
harry
Reply all
Reply to author
Forward
0 new messages