P44-DSB-X with RS485/GPIO Shield module

69 views
Skip to first unread message

Franco Guida

unread,
Jun 14, 2016, 3:32:20 PM6/14/16
to plan44_vdcd

At time I try to install an RS485/GPIO Shield module on a Raspberry Pi 2. On the Raspberry Pi is an P44-DSB-X image installed. Has anyone from you ever tested or installed something similar?

 

Below you find the Link to the used module:

http://linksprite.com/wiki/index.php5?title=RS485/GPIO_Shield_for_Raspberry_Pi_V3.0

 

 

My plan is to connect a weather station and the PI via the RS485 interface and last to communicate with the weather station over IP.

 

I am happy to receive any hints which help me to realize my plan.

 

Many Thanks.

Franco

Lukas Zeller

unread,
Jun 14, 2016, 4:25:44 PM6/14/16
to Franco Guida, plan44_vdcd
Hi Franco,

> On 14.06.2016, at 21:32, Franco Guida <franco...@invisia.ch> wrote:
>
> At time I try to install an RS485/GPIO Shield module on a Raspberry Pi 2. On the Raspberry Pi is an P44-DSB-X image installed. Has anyone from you ever tested or installed something similar?

I haven't used that particular shield, but I've been using RS485 on the RPi. As far as I can see, the shield just uses the RPi UART, and shifts the levels to RS485.

> Below you find the Link to the used module:
> http://linksprite.com/wiki/index.php5?title=RS485/GPIO_Shield_for_Raspberry_Pi_V3.0
>
> My plan is to connect a weather station and the PI via the RS485 interface and last to communicate with the weather station over IP.

What kind of weather station? In case it's a Elsner P03, there's already a complete example in https://github.com/plan44/vdcd/tree/master/external_devices_samples/p44utils_based_C%2B%2B :-)

Even if your weather station is a different one, that example could be a starting point. It uses the "external device API" (see https://github.com/plan44/vdcd/blob/master/docs/plan44%20vdcd%20external%20device%20API.pdf)

Note you don't need to activate the UART on the P44-DSB-X, it's already done. Just use --serialport /dev/ttyAMA0 with the p44utilsdevice sample code.

Lukas

Franco Guida

unread,
Jun 15, 2016, 4:02:44 AM6/15/16
to plan44_vdcd
Hi Lukas

First of all, many thanks for your quick answer, this is very helpful for me. This is my first project with Raspberry, so I`m happy to receive support from an expert :-).

I have more questions.

What do you mean with “but I've been using RS485 on the RPi“? Are there Pins on the board that can been used for RS485?

The weather station that I use is an Elsener PS8. Are there also example for a PS8? or can I use the example from the P03?

Thank you.
Franco

Lukas Zeller

unread,
Jun 15, 2016, 10:24:56 AM6/15/16
to Franco Guida, plan44_vdcd
Hi Franco,

> On 15.06.2016, at 10:02, Franco Guida <franco...@invisia.ch> wrote:
>
> [...]
> What do you mean with “but I've been using RS485 on the RPi“? Are there Pins on the board that can been used for RS485?

In my project I used a USB to RS485 adapter (because that's what I had already lying around), which then appears as /dev/ttyUSBx in Linux.

But yes, there are two serial interface (UART) pins on the Rpi connector (RXD pin 10, TXD pin 8), which are connected to the /dev/ttyAMA0 linux device. These pins have the correct serial signal, but with logic voltage levels (0..3.3V), not real RS422 or RS485 levels.

The shield you mentioned just adds the needed RS485 level shifter to these pins, so you can use /dev/ttyAMA0 as a real RS485 device on the DB9 connector.

> The weather station that I use is an Elsener PS8. Are there also example for a PS8? or can I use the example from the P03?

I had a look at the data sheet of the PS8, the protocol is very similar, but not 100% the same.

So the example code provides a nearly complete solution, except for the actual decoding of the PS8 message, which is a bit different.
Have a look at:

- main.cpp line 48: numTelegramBytes - for the PS8 this must be 57, not 40 (PS8 has longer message)

- main.cpp line 162ff: this is where the sensors are set-up. The PS8 does have a similar, but not exactly the same set of sensors. You might need to adapt these definitions (but you can probably leave it as-is for the first tests).

- main.cpp line 336ff: this is where the telegram bytes are decoded and reported into the dS system. These lines need to be adapted for the PS8 telegram format (as documented in the datasheet of the PS8)

hope this helps!

Best Regards,

Lukas
Reply all
Reply to author
Forward
0 new messages