Skip to content

File Transfer Tool used to transfer any file from my laptop to raspberry pi over CommonAPI-SOME/IP

Notifications You must be signed in to change notification settings

Abdelfattah225/ITI-CommonAPI-Bootlaoder-File-Transfer-Tool

Repository files navigation

SOME/IP Bootloader - Event-Driven Firmware Update

A SOME/IP-based firmware update system using CommonAPI. The server monitors a file and automatically notifies clients when it changes. Clients download the file with checksum verification.

Architecture

┌─────────────────┐          SOME/IP Event          ┌─────────────────┐
│   PC (Server)   │  ──────────────────────────────▶│  RPi (Client)   │
│  192.168.1.1    │        FirmwareAvailable        │  192.168.1.2    │
│                 │◀─────────────────────────────── │                 │
│  firmware.bin   │     RequestDownload/Data        │ received_fw.bin │
└─────────────────┘                                 └─────────────────┘

Quick Start

On PC (Server)

# Build
mkdir build && cd build && cmake .. && make

# Run
VSOMEIP_APPLICATION_NAME=routing_manager VSOMEIP_CONFIGURATION=config/vsomeip-server.json ./build/SomeIPBlServer

On RPi (Client)

cd ~/someip-client
LD_LIBRARY_PATH=./lib VSOMEIP_CONFIGURATION=config/vsomeip-client.json ./bin/SomeIPBlClient

Cross-Compile for RPi

Prerequisites

  • crosstool-NG with aarch64-rpi3-linux-gnu toolchain at /home/abdo/x-tools/
  • ARM sysroot with dependencies at /home/abdo/arm-sysroot/

Build

mkdir build-arm && cd build-arm
cmake .. \
  -DCMAKE_TOOLCHAIN_FILE=../aarch64-rpi3-toolchain.cmake \
  -DCMAKE_PREFIX_PATH=/home/abdo/arm-sysroot \
  -DCommonAPI_DIR=/home/abdo/arm-sysroot/lib/cmake/CommonAPI-3.2.0 \
  -DCommonAPI-SomeIP_DIR=/home/abdo/arm-sysroot/lib/cmake/CommonAPI-SomeIP-3.2.0 \
  -Dvsomeip3_DIR=/home/abdo/arm-sysroot/lib/cmake/vsomeip3
make

Deploy to RPi

scp -r rpi-package/ pi@192.168.1.2:~/someip-client/

Configuration

Network Setup (Before Running)

# PC
sudo ip addr add 192.168.1.1/24 dev enp8s0
sudo ip route add 224.0.0.0/4 dev enp8s0

# RPi
sudo ip addr add 192.168.1.2/24 dev eth0
sudo ip route add 224.0.0.0/4 dev eth0

What to Change for Your Setup

File Setting Description
config/vsomeip-server.json unicast Server IP address
config/vsomeip-client.json unicast Client IP address
src/server.cpp fileToTransfer File path to monitor
aarch64-rpi3-toolchain.cmake TOOLCHAIN_PATH Your crosstool-NG path

Project Structure

├── src/
│   ├── server.cpp          # Server with file monitoring
│   ├── client.cpp          # Client with event subscription
│   └── ServerStubImpl.hpp  # Service implementation
├── fidl/
│   ├── someipBL.fidl       # Interface definition
│   ├── someipBL.fdepl      # SOME/IP deployment
│   └── src-gen/            # Generated code
├── config/
│   ├── vsomeip-server.json
│   └── vsomeip-client.json
└── aarch64-rpi3-toolchain.cmake

How It Works

  1. Server monitors firmware.bin for changes (every 1 second)
  2. When file changes, server fires FirmwareAvailable event with file size and checksum
  3. Client receives event and calls RequestDownload()
  4. Client retrieves data in 256-byte chunks via RequestData()
  5. Client verifies checksum and saves to received_firmware.bin

About

File Transfer Tool used to transfer any file from my laptop to raspberry pi over CommonAPI-SOME/IP

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published