Skip to content

[Q]: Help with Feeding Live Sensor Data into MockService Container #273

@mahreenn16

Description

@mahreenn16

Question

Hello,

I've been working with the MockService container and have been injecting data using the mock.py file (by copying it into the container and then running the local runtime). This setup has worked fine for basic testing.

Now, I want to feed in real sensor data - ideally from a Raspberry Pi. My current idea is to have the MockService read from a JSON file that the Pi continuously updates with sensor readings.

So far, I’ve tried modifying mock.py to read from that JSON file, but I've hit a few roadblocks:

Using docker cp to copy the JSON file into the container only works once; I can't continuously update or overwrite it dynamically.

Restarting the local runtime clears the container, and with it, the JSON file gets removed.

I also attempted to use a volume mount so that updates to the JSON file (from the host or Raspberry Pi) would be visible inside the container, but this led to some errors I haven’t been able to resolve yet.

I tried switching to a different version of the Kuksa broker, hoping it might help with data integration, but that didn’t resolve the issue either.

I’m wondering: what’s the recommended approach to feed in live/updating data into a container like this? Is using a volume mount the right way, or should I be taking a different route entirely?

Thanks in advance for any advice or suggestions!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions