Malta images pv-ctrl usage

Hello,

I am in need some some guidance for my test qemu-malta image.

I noticed that the malta image does not offer a pantabox ncurses frontend which is fine and i would need to interact with pantavisor via cli to fully understand programatic access anyway.

Inside the running image, i can see /pantavisor/ location with the pv-ctrl binary.
From what i have learned so far is that this is the local http call socket which uses callback as documented here: Pantavisor Control Socket - Docs

I have also learned that the pv-ctrl socket can be interacted with using the pvcontrol tool in pvr-sdk-container however i can see that the mips binaries are not available and i haven’t attempted to build from source as i wanted to see if there was a solution for this before i over-complicate my approach. Is there a way to (if available) of possibility to add pvr-sdk container to the malta fw or perhaps there is a lan accessible “pvr” way to interact with the machine bypassing pantahub.

In my test qemu-malta image i was able to add curl for ease. Using suggested endpoint command examples:

curl -X GET --unix-socket /pantavisor/pv-ctrl "http://localhost/user-meta"
curl -X GET --unix-socket /pantavisor/pv-ctrl "http://localhost/buildinfo"

However each request is returning the same response which leads me to believe that my usage/application of these commands may be incorrect or i am missing some per-requisite steps/understanding

root@(none):/# curl -X GET --unix-socket /pantavisor/pv-ctrl “http://localhost/b
uildinfo”
curl: (48) Error
root@(none):/# curl -X GET --unix-socket /pantavisor/pv-ctrl “http://localhost/d
evice-meta”
curl: (48) Error

much appreciate any/all input and help.

Yes you are spot on. pvr-sdk is not in the qemu-malta example image simply because pvr-sdk is not made for low spec devices with only 16MB storage.

That said one could extract a useful subset of convenience with reasonable size. pvcontrol. JSON.sh and curl is all that should be necessary … for basics and while at it I would also add pvtx and the cgi-bin script that we run with busybox based webserver if enough space is available to make a local pvr post to local device experience.

Might be that 16M is really too scarce though for all of those. Maybe 128M oer 256M would be more realisitic these days for you?

Now on your curl issues: i suspect that your curl is not good talking --unix-domain sockets… can you try to find a different (static?) binary to see if you get a better results?

To confirm this i googled a bit and found that error 48 is really about “unknown option” … so yeah needs a curl spin with more features…

There is an small example of application built in go, that reads information from the /pantavisor/pv-ctrl socket and expose that information as a web app, this application is built for MIPS and all the other platforms supported.

That maybe could help to try applications in MIPS, here is the source code Pantacor / Pantavisor Web Status · GitLab and you can test it just by downloading from this repository registry.gitlab.com/pantacor/pantavisor-web-status:master

Hope that give at little bit of information and opportunity to test the system inside malta

1 Like