Portenta X8 RPC Communication Issue: Python<->Arduino Data Exchange Not Working Even By Following the Official Tutorial

I'm using latest firmware version (861) on my Portenta X8 with direct USB C connection without any breakout board.

I followed this tutorial to establish a simple RPC between my Python code running on Linux and Arduino sketch stuff (in other words between iMX8 processor and STM32H747 microcontroller), as intended in the tutorial: https://docs.arduino.cc/tutorials/portenta-x8/python-arduino-data-exchange/

I tried all the steps, but I couldn't get it to work at all.

I basically cloned this simple repo and modified it a bit, and here is a simple code on my arduino side:

#include <RPC.h>
#include <SerialRPC.h>

int DELAY_LEN = 1000;
int COUNT = 0;
int LED_STATE = HIGH;

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  Serial.begin(115200);
  Serial.println("Blink test on M4");

  RPC.bind("count", []{ return COUNT; });
  RPC.bind("led", []{ return LED_STATE; });
  
  Serial.println("Starting");

}

void loop() {
  toggleLED();
  countUp();
  delay(DELAY_LEN);
}

void toggleLED() {
  LED_STATE = (LED_STATE==HIGH)? LOW:HIGH;
  digitalWrite(LED_BUILTIN, LED_STATE);
}

void countUp() {
  COUNT++;
}

Here is the Dockerfile on Python side:

FROM python:3.10.6-alpine

WORKDIR /usr/src/app

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

COPY src/ .

ENTRYPOINT [ "python", "blink-rpc.py" ]

Here is the output of sudo docker compose build --progress=plain --no-cache:

#1 [python-blink-rpc internal] load .dockerignore
#1 transferring context: 4.71kB done
#1 DONE 0.1s

#2 [python-blink-rpc internal] load build definition from Dockerfile
#2 transferring dockerfile: 610B done
#2 DONE 0.0s

#3 [python-blink-rpc internal] load metadata for docker.io/library/python:3.10.6-alpine
#3 DONE 1.5s

#4 [python-blink-rpc internal] load build context
#4 transferring context: 9.14kB 0.1s done
#4 DONE 0.1s

#5 [python-blink-rpc 1/5] FROM docker.io/library/python:3.10.6-alpine@sha256:0c46c7f15ee201a2e2dc3579dbc302f989a20b1283e67f884941e071372eb2cc
#5 resolve docker.io/library/python:3.10.6-alpine@sha256:0c46c7f15ee201a2e2dc3579dbc302f989a20b1283e67f884941e071372eb2cc 0.1s done
#5 sha256:15c815e333072bacd7c7112b5abfbe6eb4539549883f9d218a5f5aa00a267ef3 7.05kB / 7.05kB done
#5 sha256:9b18e9b68314027565b90ff6189d65942c0f7986da80df008b8431276885218e 0B / 2.71MB 0.1s
#5 sha256:588f86efd8c29ba77a66b93122eebbf205c99abcbe092432668d8c347cc3ce5e 0B / 682.30kB 0.1s
#5 sha256:2469a19a419ea65795a7fc2a5174afd6025075e4fc2eeb4d9036d7b97ab0f65c 0B / 12.58MB 0.1s
#5 sha256:0c46c7f15ee201a2e2dc3579dbc302f989a20b1283e67f884941e071372eb2cc 1.65kB / 1.65kB done
#5 sha256:a6977f16fa6e8d508470a463c2655bcdbb7c20016cf3ef1be35248efaf55fbe7 1.37kB / 1.37kB done
#5 sha256:588f86efd8c29ba77a66b93122eebbf205c99abcbe092432668d8c347cc3ce5e 682.30kB / 682.30kB 0.4s done
#5 sha256:c99d6253c87dfb276119a4d69a297fdf690c5105432f9a2b4557e8ceb19bc586 0B / 230B 0.5s
#5 sha256:9b18e9b68314027565b90ff6189d65942c0f7986da80df008b8431276885218e 1.05MB / 2.71MB 0.7s
#5 sha256:c99d6253c87dfb276119a4d69a297fdf690c5105432f9a2b4557e8ceb19bc586 230B / 230B 0.7s done
#5 sha256:87b426220d9f676978e4bafc0875b4a9c7da41a4ded4b0bd3248e8980cca8d1d 0B / 3.04MB 0.9s
#5 sha256:9b18e9b68314027565b90ff6189d65942c0f7986da80df008b8431276885218e 2.10MB / 2.71MB 1.1s
#5 sha256:2469a19a419ea65795a7fc2a5174afd6025075e4fc2eeb4d9036d7b97ab0f65c 1.05MB / 12.58MB 1.2s
#5 sha256:9b18e9b68314027565b90ff6189d65942c0f7986da80df008b8431276885218e 2.71MB / 2.71MB 1.2s done
#5 extracting sha256:9b18e9b68314027565b90ff6189d65942c0f7986da80df008b8431276885218e 0.1s
#5 sha256:2469a19a419ea65795a7fc2a5174afd6025075e4fc2eeb4d9036d7b97ab0f65c 2.10MB / 12.58MB 1.5s
#5 extracting sha256:9b18e9b68314027565b90ff6189d65942c0f7986da80df008b8431276885218e 0.3s done
#5 extracting sha256:588f86efd8c29ba77a66b93122eebbf205c99abcbe092432668d8c347cc3ce5e
#5 sha256:2469a19a419ea65795a7fc2a5174afd6025075e4fc2eeb4d9036d7b97ab0f65c 3.15MB / 12.58MB 1.8s
#5 sha256:2469a19a419ea65795a7fc2a5174afd6025075e4fc2eeb4d9036d7b97ab0f65c 4.19MB / 12.58MB 2.1s
#5 sha256:87b426220d9f676978e4bafc0875b4a9c7da41a4ded4b0bd3248e8980cca8d1d 1.05MB / 3.04MB 2.1s
#5 sha256:2469a19a419ea65795a7fc2a5174afd6025075e4fc2eeb4d9036d7b97ab0f65c 5.24MB / 12.58MB 2.5s
#5 sha256:87b426220d9f676978e4bafc0875b4a9c7da41a4ded4b0bd3248e8980cca8d1d 2.10MB / 3.04MB 2.6s
#5 sha256:2469a19a419ea65795a7fc2a5174afd6025075e4fc2eeb4d9036d7b97ab0f65c 6.29MB / 12.58MB 2.8s
#5 extracting sha256:588f86efd8c29ba77a66b93122eebbf205c99abcbe092432668d8c347cc3ce5e 1.0s done
#5 sha256:87b426220d9f676978e4bafc0875b4a9c7da41a4ded4b0bd3248e8980cca8d1d 3.04MB / 3.04MB 2.8s done
#5 sha256:2469a19a419ea65795a7fc2a5174afd6025075e4fc2eeb4d9036d7b97ab0f65c 7.34MB / 12.58MB 3.1s
#5 sha256:2469a19a419ea65795a7fc2a5174afd6025075e4fc2eeb4d9036d7b97ab0f65c 8.39MB / 12.58MB 3.2s
#5 sha256:2469a19a419ea65795a7fc2a5174afd6025075e4fc2eeb4d9036d7b97ab0f65c 9.44MB / 12.58MB 3.4s
#5 sha256:2469a19a419ea65795a7fc2a5174afd6025075e4fc2eeb4d9036d7b97ab0f65c 10.49MB / 12.58MB 3.7s
#5 sha256:2469a19a419ea65795a7fc2a5174afd6025075e4fc2eeb4d9036d7b97ab0f65c 11.53MB / 12.58MB 3.8s
#5 sha256:2469a19a419ea65795a7fc2a5174afd6025075e4fc2eeb4d9036d7b97ab0f65c 12.58MB / 12.58MB 4.0s
#5 sha256:2469a19a419ea65795a7fc2a5174afd6025075e4fc2eeb4d9036d7b97ab0f65c 12.58MB / 12.58MB 4.1s done
#5 extracting sha256:2469a19a419ea65795a7fc2a5174afd6025075e4fc2eeb4d9036d7b97ab0f65c 0.1s
#5 extracting sha256:2469a19a419ea65795a7fc2a5174afd6025075e4fc2eeb4d9036d7b97ab0f65c 1.5s done
#5 extracting sha256:c99d6253c87dfb276119a4d69a297fdf690c5105432f9a2b4557e8ceb19bc586 done
#5 extracting sha256:87b426220d9f676978e4bafc0875b4a9c7da41a4ded4b0bd3248e8980cca8d1d
#5 extracting sha256:87b426220d9f676978e4bafc0875b4a9c7da41a4ded4b0bd3248e8980cca8d1d 0.9s done
#5 DONE 7.0s

#6 [python-blink-rpc 2/5] WORKDIR /usr/src/app
#6 DONE 0.8s

#7 [python-blink-rpc 3/5] COPY requirements.txt ./
#7 DONE 0.0s

#8 [python-blink-rpc 4/5] RUN pip install --no-cache-dir -r requirements.txt
#8 12.02 Collecting msgpack-rpc-python
#8 12.18   Downloading msgpack-rpc-python-0.4.1.tar.gz (7.7 kB)
#8 12.23   Preparing metadata (setup.py): started
#8 15.43   Preparing metadata (setup.py): finished with status 'done'
#8 15.59 Collecting msgpack-python
#8 15.64   Downloading msgpack-python-0.5.6.tar.gz (138 kB)
#8 15.69      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 139.0/139.0 kB 4.2 MB/s eta 0:00:00
#8 15.81   Preparing metadata (setup.py): started
#8 17.24   Preparing metadata (setup.py): finished with status 'done'
#8 17.56 Collecting tornado<5,>=3
#8 17.65   Downloading tornado-4.5.3.tar.gz (484 kB)
#8 17.74      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 484.2/484.2 kB 6.5 MB/s eta 0:00:00
#8 18.28   Preparing metadata (setup.py): started
#8 19.79   Preparing metadata (setup.py): finished with status 'done'
#8 19.82 Building wheels for collected packages: msgpack-rpc-python, tornado, msgpack-python
#8 19.82   Building wheel for msgpack-rpc-python (setup.py): started
#8 22.05   Building wheel for msgpack-rpc-python (setup.py): finished with status 'done'
#8 22.05   Created wheel for msgpack-rpc-python: filename=msgpack_rpc_python-0.4.1-py3-none-any.whl size=9315 sha256=bce557ff4ced5fe5185ae6b1421361ed3ab8b9b879771fb5e6c19b547ec09563
#8 22.05   Stored in directory: /tmp/pip-ephem-wheel-cache-s2hrveq3/wheels/1d/1f/c2/e15fd4164101b2b354cbb94dc43c762308d1038770d7bac846
#8 22.09   Building wheel for tornado (setup.py): started
#8 24.68   Building wheel for tornado (setup.py): finished with status 'done'
#8 24.68   Created wheel for tornado: filename=tornado-4.5.3-cp310-cp310-linux_aarch64.whl size=420772 sha256=79d452ab823fab2552ad4975135b37d5166771c11bc4ebdc3bc5ee3785f80cc3
#8 24.69   Stored in directory: /tmp/pip-ephem-wheel-cache-s2hrveq3/wheels/7a/fc/0f/8294151792cdc6cd7041df1467dbb536b4cff20d161d58501c
#8 24.71   Building wheel for msgpack-python (setup.py): started
#8 26.49   Building wheel for msgpack-python (setup.py): finished with status 'done'
#8 26.49   Created wheel for msgpack-python: filename=msgpack_python-0.5.6-cp310-cp310-linux_aarch64.whl size=10403 sha256=7ccbbb82a6ccd8dd72da8e186fb95859ca6026b9296efe696c96bd9893e9eacd
#8 26.49   Stored in directory: /tmp/pip-ephem-wheel-cache-s2hrveq3/wheels/36/15/c0/6abd0b35e76ca9d00823d197c98d947d45670fcfe9b7e7416a
#8 26.51 Successfully built msgpack-rpc-python tornado msgpack-python
#8 26.81 Installing collected packages: tornado, msgpack-python, msgpack-rpc-python
#8 28.94 Successfully installed msgpack-python-0.5.6 msgpack-rpc-python-0.4.1 tornado-4.5.3
#8 28.94 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
#8 29.43
#8 29.43 [notice] A new release of pip available: 22.2.1 -> 24.2
#8 29.43 [notice] To update, run: pip install --upgrade pip
#8 DONE 30.3s

#9 [python-blink-rpc 5/5] COPY src/ .
#9 DONE 0.0s

#10 [python-blink-rpc] exporting to image
#10 exporting layers
#10 exporting layers 0.7s done
#10 writing image sha256:dff489af7314de4656f3c667ff6df07a9e5f0e6bce522ddf5eb0e882fe08c90f done
#10 naming to docker.io/library/python-blink-rpc 0.0s done
#10 DONE 0.7s

Here is my Python code:

import os
import time

from msgpackrpc import Address as RpcAddress, Client as RpcClient, error as RpcError
import sys

# how long to wait in seconds between loop cycles
LOOP_INTERVAL = int(os.getenv("LOOP_INTERVAL", 1))

# The M4 Proxy address needs to be mapped via Docker's extra hosts
M4_PROXY_ADDRESS = sys.argv[1] or 'm4-proxy'
M4_PROXY_PORT = int(sys.argv[2]) or 5000
RPC_ADDRESS = RpcAddress(M4_PROXY_ADDRESS, M4_PROXY_PORT)

# list of RPC calls to make
RPC_CALLS = ['count', 'led']


def main() -> None:
    print_banner()

    try:
        rpc_loop(RPC_CALLS, RPC_ADDRESS, LOOP_INTERVAL)

    except KeyboardInterrupt:
        print('Stopped.')
        exit(0)


def print_banner() -> None:
    print()
    print("============================================")
    print("==       Portenta X8 M4 output            ==")
    print("============================================")
    print()


def rpc_loop(calls: list, rpc_address: RpcAddress, interval: int = 1) -> None:
    print("Starting RPC loop...")

    """Print data retrieved from m4 in a constant loop"""
    if not calls:
        print("No RPC calls defined")
    else:
        print(f"RPC calls: {calls}")

    while True:
        print("Retrieving data from the M4...")
        for call in calls:
            value = get_data_from_m4(rpc_address, call)
            if value is not None:
                print(f"{call}: ", value)
            else:
                print(f"{call}: no data!")

        print("Waiting for the next cycle...")
        time.sleep(interval)
        print("---------------------------\n")


def get_data_from_m4(address: RpcAddress, key: str):
    """Send `key` value to RPC client and return received response"""
    try:
        print("Starting RPC client...")
        client = RpcClient(address)
        print("RPC client started.")
        return client.call(key)

    except RpcError.TimeoutError:
        print(f"Unable to retrieve {key} from the M4.")



if __name__ == '__main__':
    main()

Here is the docker-compose.yml (note that I use port 5000 instead of 5001 because the m4-proxy is running on 5000, not 5001:

services:
  python-blink-rpc:
    image: python-blink-rpc
    build: .
    restart: unless-stopped
    environment:
      - PYTHONUNBUFFERED=1
      - LOOP_INTERVAL=1 # seconds
    extra_hosts:
      - "m4-proxy:host-gateway"
    command: m4-proxy 5000

Here is the out put of my m4-proxy after sudo systemctl restart m4-proxy and sudo journalctl -u m4-proxy -f:

Jul 30 10:46:52 portenta-x8-200fc209dab6fad9 systemd[1]: Started M4 builtin led forwarder.

After I spin up the docker-compose using sudo docker compose up, I get the following output from my m4-proxy:

Jul 30 10:46:52 portenta-x8-200fc209dab6fad9 systemd[1]: Started M4 builtin led forwarder.
Jul 30 10:52:29 portenta-x8-200fc209dab6fad9 m4_proxy[3766]: panic: reflect: call of reflect.Value.Type on zero Value
Jul 30 10:52:29 portenta-x8-200fc209dab6fad9 m4_proxy[3766]: goroutine 39 [running]:
Jul 30 10:52:29 portenta-x8-200fc209dab6fad9 m4_proxy[3766]: reflect.Value.typeSlow({0x0?, 0x0?, 0x1?})
Jul 30 10:52:29 portenta-x8-200fc209dab6fad9 m4_proxy[3766]:         reflect/value.go:2610 +0x12c
Jul 30 10:52:29 portenta-x8-200fc209dab6fad9 m4_proxy[3766]: reflect.Value.Type(...)
Jul 30 10:52:29 portenta-x8-200fc209dab6fad9 m4_proxy[3766]:         reflect/value.go:2605
Jul 30 10:52:29 portenta-x8-200fc209dab6fad9 m4_proxy[3766]: github.com/msgpack-rpc/msgpack-rpc-go/rpc.(*Server).Run.func1.1()
Jul 30 10:52:29 portenta-x8-200fc209dab6fad9 m4_proxy[3766]:         github.com/msgpack-rpc/msgpack-rpc-go/rpc/server.go:78 +0x1c0
Jul 30 10:52:29 portenta-x8-200fc209dab6fad9 m4_proxy[3766]: created by github.com/msgpack-rpc/msgpack-rpc-go/rpc.(*Server).Run.func1
Jul 30 10:52:29 portenta-x8-200fc209dab6fad9 m4_proxy[3766]:         github.com/msgpack-rpc/msgpack-rpc-go/rpc/server.go:57 +0xec
Jul 30 10:52:29 portenta-x8-200fc209dab6fad9 systemd[1]: m4-proxy.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jul 30 10:52:29 portenta-x8-200fc209dab6fad9 systemd[1]: m4-proxy.service: Failed with result 'exit-code'.
Jul 30 10:52:31 portenta-x8-200fc209dab6fad9 systemd[1]: m4-proxy.service: Scheduled restart job, restart counter is at 22.
Jul 30 10:52:31 portenta-x8-200fc209dab6fad9 systemd[1]: Stopped M4 builtin led forwarder.
Jul 30 10:52:31 portenta-x8-200fc209dab6fad9 systemd[1]: Started M4 builtin led forwarder.
Jul 30 10:52:40 portenta-x8-200fc209dab6fad9 m4_proxy[4365]: panic: reflect: call of reflect.Value.Type on zero Value
Jul 30 10:52:40 portenta-x8-200fc209dab6fad9 m4_proxy[4365]: goroutine 4 [running]:
Jul 30 10:52:40 portenta-x8-200fc209dab6fad9 m4_proxy[4365]: reflect.Value.typeSlow({0x0?, 0x0?, 0x1?})
Jul 30 10:52:40 portenta-x8-200fc209dab6fad9 m4_proxy[4365]:         reflect/value.go:2610 +0x12c
Jul 30 10:52:40 portenta-x8-200fc209dab6fad9 m4_proxy[4365]: reflect.Value.Type(...)
Jul 30 10:52:40 portenta-x8-200fc209dab6fad9 m4_proxy[4365]:         reflect/value.go:2605
Jul 30 10:52:40 portenta-x8-200fc209dab6fad9 m4_proxy[4365]: github.com/msgpack-rpc/msgpack-rpc-go/rpc.(*Server).Run.func1.1()
Jul 30 10:52:40 portenta-x8-200fc209dab6fad9 m4_proxy[4365]:         github.com/msgpack-rpc/msgpack-rpc-go/rpc/server.go:78 +0x1c0
Jul 30 10:52:40 portenta-x8-200fc209dab6fad9 m4_proxy[4365]: created by github.com/msgpack-rpc/msgpack-rpc-go/rpc.(*Server).Run.func1
Jul 30 10:52:40 portenta-x8-200fc209dab6fad9 m4_proxy[4365]:         github.com/msgpack-rpc/msgpack-rpc-go/rpc/server.go:57 +0xec
Jul 30 10:52:40 portenta-x8-200fc209dab6fad9 systemd[1]: m4-proxy.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jul 30 10:52:40 portenta-x8-200fc209dab6fad9 systemd[1]: m4-proxy.service: Failed with result 'exit-code'.
Jul 30 10:52:42 portenta-x8-200fc209dab6fad9 systemd[1]: m4-proxy.service: Scheduled restart job, restart counter is at 23.
...

...and keep repeating.

My Python's output is as follows:

[+] Building 0.0s (0/0)
[+] Running 2/2
 ✔ Network python-blink-rpc_default               Created0.2s
 ✔ Container python-blink-rpc-python-blink-rpc-1  Created0.1s
Attaching to python-blink-rpc-python-blink-rpc-1
python-blink-rpc-python-blink-rpc-1  |
python-blink-rpc-python-blink-rpc-1  | ============================================
python-blink-rpc-python-blink-rpc-1  | ==       Portenta X8 M4 output            ==
python-blink-rpc-python-blink-rpc-1  | ============================================
python-blink-rpc-python-blink-rpc-1  |
python-blink-rpc-python-blink-rpc-1  | Starting RPC loop...
python-blink-rpc-python-blink-rpc-1  | RPC calls: ['count', 'led']
python-blink-rpc-python-blink-rpc-1  | Retrieving data from the M4...
python-blink-rpc-python-blink-rpc-1  | Starting RPC client...
python-blink-rpc-python-blink-rpc-1  | RPC client started.
python-blink-rpc-python-blink-rpc-1  | Unable to retrieve count from the M4.
python-blink-rpc-python-blink-rpc-1  | count: no data!
python-blink-rpc-python-blink-rpc-1  | Starting RPC client...
python-blink-rpc-python-blink-rpc-1  | RPC client started.
python-blink-rpc-python-blink-rpc-1  | Unable to retrieve led from the M4.
python-blink-rpc-python-blink-rpc-1  | led: no data!
python-blink-rpc-python-blink-rpc-1  | Waiting for the next cycle...
python-blink-rpc-python-blink-rpc-1  | ---------------------------
python-blink-rpc-python-blink-rpc-1  |
python-blink-rpc-python-blink-rpc-1  | Retrieving data from the M4...
python-blink-rpc-python-blink-rpc-1  | Starting RPC client...
python-blink-rpc-python-blink-rpc-1  | RPC client started.
python-blink-rpc-python-blink-rpc-1  | Unable to retrieve count from the M4.
python-blink-rpc-python-blink-rpc-1  | count: no data!
python-blink-rpc-python-blink-rpc-1  | Starting RPC client...
python-blink-rpc-python-blink-rpc-1  | RPC client started.
python-blink-rpc-python-blink-rpc-1  | Unable to retrieve led from the M4.
python-blink-rpc-python-blink-rpc-1  | led: no data!
python-blink-rpc-python-blink-rpc-1  | Waiting for the next cycle...
python-blink-rpc-python-blink-rpc-1  | ---------------------------
python-blink-rpc-python-blink-rpc-1  |
python-blink-rpc-python-blink-rpc-1  | Retrieving data from the M4...
python-blink-rpc-python-blink-rpc-1  | Starting RPC client...
python-blink-rpc-python-blink-rpc-1  | RPC client started.
python-blink-rpc-python-blink-rpc-1  | Unable to retrieve count from the M4.
python-blink-rpc-python-blink-rpc-1  | count: no data!
python-blink-rpc-python-blink-rpc-1  | Starting RPC client...
python-blink-rpc-python-blink-rpc-1  | RPC client started.
python-blink-rpc-python-blink-rpc-1  | Unable to retrieve led from the M4.
python-blink-rpc-python-blink-rpc-1  | led: no data!
python-blink-rpc-python-blink-rpc-1  | Waiting for the next cycle...
python-blink-rpc-python-blink-rpc-1  | ---------------------------
python-blink-rpc-python-blink-rpc-1  |
python-blink-rpc-python-blink-rpc-1  | Retrieving data from the M4...
python-blink-rpc-python-blink-rpc-1  | Starting RPC client...
python-blink-rpc-python-blink-rpc-1  | RPC client started.
...

...and keep repeating!

I don't know exctly how to solve this, except for fixing the issue in the original msgpack-rpc, which has not been maintained for the past decade!! --> GitHub - msgpack-rpc/msgpack-rpc: MessagePack-RPC is an inter-process messaging library that uses MessagePack for object serialization.

Is there any solution to this? The error shows something is wrong with some of the .go files in the msgpack-rpc, but I'm not exactly sure if I have to go on and fix those and recompile everything from scratch :confused:

Any solution? Also wondering if you have any other alternative solution beside using this outdated msgpack-rpc-python package --> this one also stopped maintenance 7 years ago and no one answers issues or take care of pull requests...

Please note that I get the exact same error by following the official tutorial. Here is the output of python-sensor-rpc package (only changed port 5001 to 5000):

python-sensor-rpc-python-sensor-rpc-1  |
python-sensor-rpc-python-sensor-rpc-1  | ============================================
python-sensor-rpc-python-sensor-rpc-1  | ==       Portenta X8 Sensor reading       ==
python-sensor-rpc-python-sensor-rpc-1  | ============================================
python-sensor-rpc-python-sensor-rpc-1  |
python-sensor-rpc-python-sensor-rpc-1  | Unable to retrive data from the M4.
python-sensor-rpc-python-sensor-rpc-1  | Unable to retrive data from the M4.
python-sensor-rpc-python-sensor-rpc-1  | Unable to retrive data from the M4.
python-sensor-rpc-python-sensor-rpc-1  | Unable to retrive data from the M4.

...and identical output for the m4-proxy:

Jul 30 11:38:17 portenta-x8-200fc209dab6fad9 systemd[1]: Started M4 builtin led forwarder.
Jul 30 11:38:30 portenta-x8-200fc209dab6fad9 m4_proxy[9626]: panic: reflect: call of reflect.Value.Type on zero Value
Jul 30 11:38:30 portenta-x8-200fc209dab6fad9 m4_proxy[9626]: goroutine 4 [running]:
Jul 30 11:38:31 portenta-x8-200fc209dab6fad9 m4_proxy[9626]: reflect.Value.typeSlow({0x0?, 0x0?, 0x1?})
Jul 30 11:38:31 portenta-x8-200fc209dab6fad9 m4_proxy[9626]:         reflect/value.go:2610 +0x12c
Jul 30 11:38:31 portenta-x8-200fc209dab6fad9 m4_proxy[9626]: reflect.Value.Type(...)
Jul 30 11:38:31 portenta-x8-200fc209dab6fad9 m4_proxy[9626]:         reflect/value.go:2605
Jul 30 11:38:31 portenta-x8-200fc209dab6fad9 m4_proxy[9626]: github.com/msgpack-rpc/msgpack-rpc-go/rpc.(*Server).Run.func1.1()
Jul 30 11:38:31 portenta-x8-200fc209dab6fad9 m4_proxy[9626]:         github.com/msgpack-rpc/msgpack-rpc-go/rpc/server.go:78 +0x1c0
Jul 30 11:38:31 portenta-x8-200fc209dab6fad9 m4_proxy[9626]: created by github.com/msgpack-rpc/msgpack-rpc-go/rpc.(*Server).Run.func1
Jul 30 11:38:31 portenta-x8-200fc209dab6fad9 m4_proxy[9626]:         github.com/msgpack-rpc/msgpack-rpc-go/rpc/server.go:57 +0xec
Jul 30 11:38:31 portenta-x8-200fc209dab6fad9 systemd[1]: m4-proxy.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jul 30 11:38:31 portenta-x8-200fc209dab6fad9 systemd[1]: m4-proxy.service: Failed with result 'exit-code'.
Jul 30 11:38:33 portenta-x8-200fc209dab6fad9 systemd[1]: m4-proxy.service: Scheduled restart job, restart counter is at 31.
Jul 30 11:38:33 portenta-x8-200fc209dab6fad9 systemd[1]: Stopped M4 builtin led forwarder.
Jul 30 11:38:33 portenta-x8-200fc209dab6fad9 systemd[1]: Started M4 builtin led forwarder.
Jul 30 11:38:47 portenta-x8-200fc209dab6fad9 m4_proxy[9635]: panic: reflect: call of reflect.Value.Type on zero Value
Jul 30 11:38:47 portenta-x8-200fc209dab6fad9 m4_proxy[9635]: goroutine 21 [running]:
Jul 30 11:38:47 portenta-x8-200fc209dab6fad9 m4_proxy[9635]: reflect.Value.typeSlow({0x0?, 0x0?, 0x4000130001?})
Jul 30 11:38:47 portenta-x8-200fc209dab6fad9 m4_proxy[9635]:         reflect/value.go:2610 +0x12c
Jul 30 11:38:47 portenta-x8-200fc209dab6fad9 m4_proxy[9635]: reflect.Value.Type(...)
Jul 30 11:38:47 portenta-x8-200fc209dab6fad9 m4_proxy[9635]:         reflect/value.go:2605
Jul 30 11:38:47 portenta-x8-200fc209dab6fad9 m4_proxy[9635]: github.com/msgpack-rpc/msgpack-rpc-go/rpc.(*Server).Run.func1.1()
Jul 30 11:38:47 portenta-x8-200fc209dab6fad9 m4_proxy[9635]:         github.com/msgpack-rpc/msgpack-rpc-go/rpc/server.go:78 +0x1c0
Jul 30 11:38:47 portenta-x8-200fc209dab6fad9 m4_proxy[9635]: created by github.com/msgpack-rpc/msgpack-rpc-go/rpc.(*Server).Run.func1
Jul 30 11:38:47 portenta-x8-200fc209dab6fad9 m4_proxy[9635]:         github.com/msgpack-rpc/msgpack-rpc-go/rpc/server.go:57 +0xec
Jul 30 11:38:47 portenta-x8-200fc209dab6fad9 systemd[1]: m4-proxy.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jul 30 11:38:47 portenta-x8-200fc209dab6fad9 systemd[1]: m4-proxy.service: Failed with result 'exit-code'.