Metadata.file to connect Edge and Backend

Hello,
I’m new to OpenEMS, but I have been trying to connect my OpenEms edge instance hosted with raspberry pi with my OpenEMS backend instance hosted on a linux VM.
For this I use the “Metadata.File” configuration in the backend instance, where I add an edge with its apikey in a metadata.json file.Then I use the “Controller Api Backend” configuration in the edge instance, where the URI is ws://BACKEND_IP:8081 (edge websocket port) and the api key is the api key set in the metadata file.
Now from the edge instance perspective, the edge UI looks fine, the backend is connected and from the logs edge seems that it’s sending data to backend.
But when I navigate the backend’s UI I cannot see any edges in the overview page with the admin user.
I only see a message “You have not added any OpenEMS yet”.

I would really appreciate some guidance with this topic,
Thank you in advance

Hi Rezar Dalipaj,

and welcome to the OpenEMS Community. I was able to identify the problem and will fix it in this PR, that is going to be included in the next release 2024.8.0:

I am hardly ever using Metadata.File myself, but when looking through this rather old code, I had the idea to refactor it.

For your use-case do you require an external JSON file or would it also work for you if you could edit this JSON via Apache Felix Web Console? (Internally this config is then also written in a file, but it would make certain tasks much easier and faster if it was refactored)

Regards,
Stefan

Hi Stefan, thank you for your reply,
I replied in this thread: You have not added any OpenEMS yet - #3 by stefan.feilmeier

Thank you,
Rezar Dalipaj

Now the UI is working.
But I’m getting another error in the history tab of the UI of backend.
I get “Error while fetching data. Please try again later”, even though I can see very recent data coming in to influx db and it’s configured correctly in apache felix.
But in the UI I see the message I mentioned.

Looking forward to hearing from you @stefan.feilmeier.
Thank you,
Rezar Dalipaj