Re: [beagleboard] Re: Beaglebone Black and RS485 Cape Interface

2016-11-30 Thread William Hermans
On Wed, Nov 30, 2016 at 11:45 AM, Bouni  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 ?

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CALHSORqgRgUOqaPcOj%3DJ-4akOG2co35d-GGqB%2B4btLYuQNLM%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Re: Beaglebone Black and RS485 Cape Interface

2016-11-30 Thread Bouni
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.

Am 30. November 2016 21:15:14 MEZ, schrieb William Hermans :
>On Wed, Nov 30, 2016 at 11:45 AM, Bouni  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 ?
>
>-- 
>For more options, visit http://beagleboard.org/discuss
>--- 
>You received this message because you are subscribed to a topic in the
>Google Groups "BeagleBoard" group.
>To unsubscribe from this topic, visit
>https://groups.google.com/d/topic/beagleboard/kuEDsK_7YWE/unsubscribe.
>To unsubscribe from this group and all its topics, send an email to
>beagleboard+unsubscr...@googlegroups.com.
>To view this discussion on the web visit
>https://groups.google.com/d/msgid/beagleboard/CALHSORqgRgUOqaPcOj%3DJ-4akOG2co35d-GGqB%2B4btLYuQNLM%3Dw%40mail.gmail.com.
>For more options, visit https://groups.google.com/d/optout.

-- 
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/76377B55-1666-4E2B-8A05-37C7515F3307%40owee.de.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Re: Beaglebone Black and RS485 Cape Interface

2016-12-01 Thread Firrel
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):
>
> 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.
>
> Am 30. November 2016 21:15:14 MEZ, schrieb William Hermans <
> yyr...@gmail.com >:
>>
>> On Wed, Nov 30, 2016 at 11:45 AM, Bouni > 
>> 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 ?
>>
>>
> -- 
> Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail 
> gesendet.
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/1c460120-8d8a-49dc-b0b3-d5c21366a5ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Re: Beaglebone Black and RS485 Cape Interface

2016-12-01 Thread William Hermans
On Wed, Nov 30, 2016 at 1:21 PM, Bouni  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.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CALHSORobdkiD3ndpLEeczS-FZic-W0Nut73%2B4UQoU5ggwSZEiA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Re: Beaglebone Black and RS485 Cape Interface

2016-12-01 Thread Bouni
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.

On Thursday, December 1, 2016 at 11:05:54 AM UTC+1, William Hermans wrote:
>
>
>
> On Wed, Nov 30, 2016 at 1:21 PM, Bouni > 
> 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. 
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/9ba7093f-d5a7-4eab-9b96-6e22b6423595%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Re: Beaglebone Black and RS485 Cape Interface

2016-12-01 Thread William Hermans
On Thu, Dec 1, 2016 at 5:06 AM, Bouni  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:
>
> 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.
>
> 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.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CALHSORra_1c7COF13fdhe6Ar7ZP2Qkvnf%3DbMEDh8JHaiimdnwg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.