Beaglebone Black and RS485 Cape Interface

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.

I’ve use the dts from waveshare website and have used the can portion of the board with no issue.

http://www.waveshare.com/wiki/RS485_CAN_CAPE

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):

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 ?

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.

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):

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.

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:

http://inspire.logicsupply.com/2014/09/beaglebone-rs-485-communication.html

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)

Using this python script https://gist.github.com/Bouni/49a292798e88a7a0956c308b3c9d1190 (inspired by http://inspire.logicsupply.com/2014/09/beaglebone-rs-485-communication.html),
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.

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:

http://inspire.logicsupply.com/2014/09/beaglebone-rs-485-
communication.html

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)

Using this python script Bouni’s gists · GitHub
49a292798e88a7a0956c308b3c9d1190 (inspired by http://inspire.logicsupply.
com/2014/09/beaglebone-rs-485-communication.html),
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.

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?

Hi
if you want to use RS485 on WAVESHARE BB CAPE just desolder CAN driver and everything should be fine.

br
harry