Skip to main content
1-Visitor
May 5, 2021
Solved

Kepware and Raspberry pi4

  • May 5, 2021
  • 3 replies
  • 4668 views

Hallo,

 

is it possible to connect Raspberry Pi 4 to Kepware Server and read data in Thingworx? I have already connected vie Microserver. I just ask it is possible that another way

Thnx

BR

Vladimir

Best answer by sam_kepware

Hi Vladimir, 

Yes, this is possible. Many protocol interfaces are possible when building custom code on Raspberry Pi micro computers. If you're familiar with Python, a library called PyModbus can be used to create a Modbus Server interface, at which point you can read data via Kepware's Modbus Ethernet driver. Here is a tutorial I found on the web (can't comment on quality, but hopefully it is helpful to get you started):

Setup of Modbus TCP on Raspberry Pi (wixsite.com)

Otherwise, in your custom code on the RPI, you coudl:

- obtain an MQTT library and publish JSON to an MQTT broker, consuming the data with Kepware MQTT Client driver

- build a simple HTTP server or client interface and pass the data to Kepware's Universal Device Driver

- build a simple TCP interface and pass custom payloads over TCP to either Universal Device Driver or UCON

I've heard of others using Siemens Industrial Ethernet libraries on RPI and a few other "fieldbus" protocols, but I'd suggest starting with simple protocols like those I've mentioned above.

 

Please feel free to reach out to the Kepware Apps Engineering team for more help: presales.support@kepware.com

 

Thanks!
Sam

3 replies

12-Amethyst
May 11, 2021

Hi Vladimir, 

Yes, this is possible. Many protocol interfaces are possible when building custom code on Raspberry Pi micro computers. If you're familiar with Python, a library called PyModbus can be used to create a Modbus Server interface, at which point you can read data via Kepware's Modbus Ethernet driver. Here is a tutorial I found on the web (can't comment on quality, but hopefully it is helpful to get you started):

Setup of Modbus TCP on Raspberry Pi (wixsite.com)

Otherwise, in your custom code on the RPI, you coudl:

- obtain an MQTT library and publish JSON to an MQTT broker, consuming the data with Kepware MQTT Client driver

- build a simple HTTP server or client interface and pass the data to Kepware's Universal Device Driver

- build a simple TCP interface and pass custom payloads over TCP to either Universal Device Driver or UCON

I've heard of others using Siemens Industrial Ethernet libraries on RPI and a few other "fieldbus" protocols, but I'd suggest starting with simple protocols like those I've mentioned above.

 

Please feel free to reach out to the Kepware Apps Engineering team for more help: presales.support@kepware.com

 

Thanks!
Sam

15-Moonstone
May 19, 2021

Adding to Sam's ideas - you can also look for and run a soft PLC on the RPi 4 which itself would expose a certain number of TCP industrial protocols.  I've worked with CoDeSys before, but if I recall correctly there are full open source ones that you could use for dev/test/demos.

Community Manager
June 3, 2021

Hi @vcavic

 

If you feel your question was answered, please mark the appropriate response as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon