Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Manufacturing Technology >> Industrial Technology

Secure Remote gRPC Access with grpcurl on PLCnext Devices

WARNING: The procedure described in this blog uses features of the PLCnext Runtime that are currently not supported. Use these features at your own risk, and definitely do not use these features in production applications.

From the gRPCurl github project:

In recent firmware versions, it has been possible to access the gRPC server on PLCnext Control devices, but only using gRPC clients running on the local device. Previous Makers Blog posts have given examples of gRPC clients written in C# and Python.

In future firmware versions, it will also be possible to access the gRPC server on PLCnext Control devices from remote devices. In fact this feature is already included in firmware version 2022.6, but this is still under development and is not currently supported. This article describes how to activate this feature for testing and development purposes, using an open-source gRPC client called gRPCurl.

Please note that the gRPC server should NOT currently be accessed remotely in production applications.

Procedure

On the PLCnext Control device (with firmware 2022.6)

In the future, this setting will be made through the Web Based Management "System Services" page.

On the remote device

grpcurl -insecure -import-path Documents/plcnext-grpc/protobuf -proto Device/Interface/IDeviceStatusService.proto -d '{"identifier":"Status.Board.Temperature.Centigrade"}' 192.168.1.10:50051 Arp.Device.Interface.Services.Grpc.IDeviceStatusService/GetItem

... where -import-path is the path to the protobuf directory, and the IP address is the address of the PLCnext Control device.

The reply should be a JSON object containing the board temperature in degrees Celsius:

{
  "ReturnValue": {
    "TypeCode": "CT_Int8",
    "Int8Value": 43
  }
}

FAQ

This might be possible, but grpcurl would need to be built from source for the target platform, and given the number of dependencies that probably won't be simple.

For more help ...

Use grpcurl -help to get more information on available options.

For questions about the gRPC Server in the PLCnext Runtime, please use the PLCnext Community Forum.


Industrial Technology

  1. Remote Weather Monitoring with Raspberry Pi 3 and PubNub
  2. Capturing IR Remote Commands on Raspberry Pi without LIRC: A Python UART Approach
  3. Secure Remote gRPC Access with grpcurl on PLCnext Devices
  4. Connect Node-RED to PLCnext Controllers with the New REST API Connector
  5. Create a C# Client for PLCnext Control gRPC Server: Step-by-Step Guide
  6. Effortless Remote RS232/RS485 Connectivity for PLCnext PLCs Using Pseudo TTY
  7. Seamlessly Connect PLCnext Controllers to Home Assistant for Smart Home Control
  8. Mastering Simple and Complex Data Types in C++ with PLCnext Engineer
  9. Installing the APT Package Manager on PLCnext Linux: A Step‑by‑Step Guide
  10. Prevent Unplanned Downtime with Remote Conveyor Monitoring Solutions