Knowledge Base

Everything you need to know and understand to develop V2X applications.

denm-generator.py
msg = self.generate_denm()
future = self.send_request(msg)
future.add_done_callback(self.request_completed)

Remote Procedure Calls

The cube:radio API runs on the cube itself. To control the V2X radio from a laptop, cloud server, or remote test bench, use the RPC service.

Remote Procedure Calls (RPC) expose the cube's link-layer capabilities over an IP network. The radio appears as a remote resource that can be called like a local function. When V2X radios are configured with cube-v2xconfig, the cube-radio-rpc service launches automatically and listens on TCP port 23057.

Why RPC?

cube-radio-rpc is built on Cap'n Proto, an RPC framework, and provides:

  • Language flexibility: clients in C++, Python, Go, Rust, and others
  • Network transparency: control the radio from anywhere on the network
  • Type safety: the schema file defines the contract between server and client
  • Zero-copy serialization: low overhead

Recent versions of Vanetza's socktap include a built-in RPC link layer that connects directly to cube-radio-rpc, supporting remote development and testing.

Quick Start: Is It Running?

Verify that cube-radio-rpc is listening on your cube:evk:

cube:~$ sudo netstat -tlnp | grep 23057
tcp6 0 0 :::23057 :::* LISTEN 567/cube-radio-rpc

Try it remotely with socktap! Assuming your cube is at 192.168.8.201, you can use both its GNSS and V2X radio from your host computer:

host:~$ socktap -l rpc --rpc-host 192.168.8.201 --gpsd-host 192.168.8.201
Starting runtime at 2025-Nov-07 10:36:01.881303
Enable application 'ca'...
Connected to RPC server id=0 version=1
RPC server's info: cube-radio=dsrc

The laptop now transmits and receives V2X messages through the cube's radio, as if the V2X hardware were attached directly.


Next Steps

Schema – Understanding the Contract

The Cap'n Proto schema defines the frames, parameters, and methods available in cube-radio-rpc. Covers frame structures, transmit and receive parameters for ITS-G5 and C-V2X, listener interfaces for async callbacks, and error handling. Reference for building RPC clients in any language.

Recommended for all RPC client developers.

Python Example – Working Code

A Python tutorial using pycapnp to build an RPC client. Covers connecting to the cube, device identification, transmitting V2X frames with custom parameters, and subscribing to incoming messages, with ready-to-run code examples.

Suitable for prototyping and quick starts.

Previous
ITS Time