Code Monkey home page Code Monkey logo

someipy's Introduction

someipy - A Python Library for the SOME/IP Protocol

Get in Contact ๐Ÿ“ฎ

If you want to connect, have a feature request, bug report or need support, send me an email or connect on LinkedIn:

๐Ÿ“ง [email protected]
๐Ÿ”Œ LinkedIn

Documentation โœ๏ธ

๐Ÿ”— https://chrizog.github.io/someipy/

What is someipy?

someipy is a Python library implementing the SOME/IP protocol, including the SOME/IP SD (Service Discovery) in Python. It's perfectly suited for fast prototyping of applications that need to provide (server) or use (client) SOME/IP services from other ECUs.

someipy also supports serialization and deserialization of SOME/IP payloads, which is a unique feature compared to other libraries.

someipy is still under development; therefore, it does not yet support all features of the SOME/IP and SOME/IP Service Discovery protocol specification.

someipy is based on the specification version of R22-11:

The library is currently developed and tested under Ubuntu 22.04 and Python 3.8.

Typical Use Cases

someipy excels in scenarios where a full-scale Autosar (Adaptive or Classic) integration would be excessive:

  • ๐Ÿงช Develop Test Applications: Easily create test applications to stimulate the SOME/IP interfaces of your system under test. Whether running on a PC in a SIL environment or on an ECU, someipy allows you to efficiently send and receive SOME/IP events or utilize/provide SOME/IP services. Test data can be seamlessly generated or imported in Python, from sources such as .csv files or ROS bag files. Explore the example applications for more details.

  • ๐Ÿ”‹ Prototype Sensor Integration: Quickly integrate new sensors into your project using SOME/IP, ideal for evaluating the sensor's potential impact without significant effort. Define the message/parameter layout in Python and create a server service instance in minutes. Check out the example application send_events_udp.py for a practical demonstration.

  • ๐Ÿ”ฌ Data Recording: Set up a SOME/IP recording application in just a few minutes and store data in your preferred format, such as ROS bags, .csv files, or databases. Simply dump the received data within your callback function. The example application receive_events_udp.py illustrates this process.

Installation

The package can be installed from PyPi.

pip3 install someipy

Example Applications

In the directory example_apps, examples including explanations, can be found for using the someipy library. In temperature_msg.py, a payload interface "TemperatureMsg" is defined, which can be serialized and deserialized. In send_events.py, the service discovery and two services are instantiated. The "TemperatureMsg" is serialized and used as the payload for sending events.

Supported Features, Limitations and Deviations

The library is still under development. The current major limitations and deviations from the protocol specifications are listed below.

SOME/IP

  • Calling methods via TCP is not supported yet. Only method calls via UDP are supported.
  • Only unicast services are supported.
  • SOME/IP-TP is not supported.
  • IPv6 endpoints are not supported.
  • Session handling is supported only for SOME/IP-SD and not for SOME/IP messages transporting events.

Service Discovery

  • Configuration and load balancing options in SOME/IP SD messages are not supported.
  • TTL of Service Discovery entries is not checked yet.
  • The Initial Wait Phase and Repetition Phase of the Service Discovery specification are skipped. For simplification, the Main Phase is directly entered, i.e. SD Offer Entries are immediately sent cyclically.
  • Multiple Service Discovery entries are not packed together in a single SD message, which is sent via UDP.

De-/Serialization

  • Only fixed size arrays are supported. Dynamically sized arrays are not supported.
  • Optional length fields for SOME/IP arrays are not supported.
  • Strings are not supported yet.
  • Configuration of padding is not supported yet.

someipy's People

Contributors

chrizog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

someipy's Issues

Issue with imports

Hi, I wanted to give a try to this library, but when trying to run the example code from examples/call_method_udp.py i get an error:

...
   from someipy import TransportLayerProtocol
ImportError: cannot import name 'TransportLayerProtocol' from partially initialized module 'someipy' (most likely due to a circular import)

I tried to remove this particular import, since construct_client_service_instance by default chooses UDP, then i get error on the next import statement

...
    from someipy.client_service_instance import MethodResult, construct_client_service_instance
ModuleNotFoundError: No module named 'someipy.client_service_instance'; 'someipy' is not a package

Environemt:

  • python 3.8.19
  • Ubuntu 18.04

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.