Skip to main content

Client for EdgePi RPC Server

Project description

Image

EdgePi RPC Client

The RPC client exposes functionality of the EdgePi Python SDK to be used over either a network connection or on local sockets, allowing for potential remote control of the EdgePi.

Since the client directly mirrors the SDK, you can take advantage of the user-friendly SDK functionality with the flexibility of different connection protocols depending on your specific use case.

You can learn more about the Python SDK here.

Using the RPC Client

Install the RPC client through the terminal:

$ python3 -m pip install edgepi-rpc-client

Once installed, you can control the modules of the EdgePi directly through the SDK's wide functionality.

For example, from a remote connection with address localhost and port 5555, initialize a client module as:

from edgepi_rpc_client.services.adc.client_adc_service import ClientAdcService
from edgepi_rpc_client.services.adc.adc_pb_enums import ADCChannel, ConvMode

# initialize ADC Client
adc_client = ClientAdcService('tcp://localhost:5555')

# configure ADC to sample input pin 4 (the input pins are 0-indexed)
adc_client.set_config(adc_1_analog_in=ADCChannel.AIN3, conversion_mode=ConvMode.CONTINUOUS)

# send command to start automatic conversions
adc_client.start_conversions()

# perform 10 voltage reads
for _ in range(10):
  out = adc_client.read_voltage()
  print(out)

# stop automatic conversions
adc_client.stop_conversions()

Once the client is initialized you can control the EdgePi exactly as you would through the SDK.

For details about available modules visit the SDK GitHub repository linked above.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

edgepi-rpc-client-0.0.14.tar.gz (20.1 kB view hashes)

Uploaded Source

Built Distribution

edgepi_rpc_client-0.0.14-py3-none-any.whl (31.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page