Fetching data from GRID4

Hi,

To start things off, I’m quite new to the ZeroMQ Library.
And I’ve been trying to wrap my head around how to fetch data from the GRID 4 API.
I know how to send data to set certain parameters such as sessionName and DownloadPath.
And I’ve figured out how to get data from the cameras, which is from the smartshooter module.

For example:

    ctx = smartshooter.Context()
    cameras = ctx.get_camera_list()
    for cam in cameras:
        ev = ctx.get_camera_info(cam)
        val = ev["CameraPropertyInfo"]["FocusMode"]["CameraPropertyValue"]

But how do I fetch sessionName and DownloadPath from GRID 4, or properties that are not related to cameras?

Can’t seem to find anything in the documentation. Unless I subscribe to an event. But for that to work I need something to trigger the event to be able to get the data.

Thank you in advance,
Best regards,
Daniel

But how do I fetch sessionName and DownloadPath from GRID 4, or properties that are not related to cameras?

The information published out from the API event socket relates just to camera and photo status.
So actually, changes to session name and download path do not get sent out of the event stream.

For the session name, this info is included in the “Synchronise” reply message.
So if you send a “Synchronise” request to the API, the reply message will include a section named “OptionsInfo”.
But for the download path, this is not included.

If needed, I can add this…

Hi,
Thank you for the information.
It would be nice to be able to access download path too.
And while we’re on that track. Is it possible to get access to the status (ready / busy) from top right corner.
and also the progressbar for the download status when downloading pictures from the cameras?

I’ve tried to get the download status by checking the cameras “CameraNumPhotosTaken” and “CameraNumDownloadsComplete”. But that seems to be returning 0.

And right now i’m getting the ready / busy status from the cameras using “CameraStatus”. But that has caused some problem with it saying that it is ready while GRID4 is still stating that it is busy. Usually happens when downloading pictures for the cameras.

It would be nice to be able to access download path too.

OK, I’ll try to add this for the next update.
So with that, the app will send out an “OptionsUpdated” event whenever the download path (or other options) change.

I’ve tried to get the download status by checking the cameras “CameraNumPhotosTaken” and “CameraNumDownloadsComplete”. But that seems to be returning 0.

This sounds like a bug, I’ll check into this…

And right now i’m getting the ready / busy status from the cameras using “CameraStatus”. But that has caused some problem with it saying that it is ready while GRID4 is still stating that it is busy. Usually happens when downloading pictures for the cameras.

Yes this is expected. When the app is showing a busy status here, it relates to the network transfers between each node. So actually, at that time, none of the cameras themselves are busy. The API “CameraUpdated” event only contains info on the state of each camera.

So for you usecase, you want to monitor the status of the network transfers, and wait for them to complete?
I’ll think about a way to expose that info to the API.

Hi Francis!

I’ll jump in and reply for my colleague Ziarra.

  1. Your suggestion for the download path sounds perfect :slight_smile:

  2. Checking cameras, ler us know if you find something (bug)?

  3. Yes we are trying to get the network transfer (download status) on our master, the same nice “Fuel scope” you have down on the Network tab. So if we can read out the same status you present, maybe a value 0-100 or something if possible?

Thanks in advance! :slight_smile:

// Roger

Quick update on this request;

The latest version v4.11 now has the new “OptionsUpdated” message.
This is sent out when the app’s options are updated, and includes a field for “DownloadPath”.
Also note, the “Synchronisation” reply message also now includes “DownloadPath” as one of the fields.

The bug with the “CameraNumDownloadsComplete” and “CameraNumDownloadsFailed”, yes these fields are always 0. This will be fixed in the next release v4.12.

Thanks Francis for several nice features in v4.11 !! :slight_smile:
Like “Clear” function of download folder on the slaves, reached from network tab list (much needed), love it!

One thing I noticed in the Network tab, we only see disk space on the last slave in that list, not disk space on the slaves above in the list?!

We’ll start testing the rest of the features you mentioned asap.

Keep up the good work! :slight_smile:

Thanks Roger!
I still have that list of feature requests from my onsite visit, working through them slowly :slight_smile:

One thing I noticed in the Network tab, we only see disk space on the last slave in that list, not disk space on the slaves above in the list?!

This is probably because the slaves are not yet updated to v4.11, can you check that?

The slaves are all Linux, and all new 4.11. But I’ll double check more to see if I missed something…
// Roger

@francis
How possible setup direct transfer from cameras connected to rpi4 and/or windows CaptureGrid to network file server without load images to nodes first and later to master?
With windows it not so hard to control disk usage but linux version not so clear where capturegrid storing images on small SD card. And direct to NAS transfer more faster and safer for SD cards.

How possible setup direct transfer from cameras connected to rpi4 and/or windows CaptureGrid to network file server without load images to nodes first and later to master?

Basically, the nodes will have to use the network share as their “Photo Download Directory”.
To do that, you need to change the app options on the node itself. So yes, its a manual process. But also, you will need to manually set up the network share on each node anyway.

Its not really something that kind be handled remotely by the CaptureGRID master node.

An quick update to my mentioned problem with Disk space not showing up under the Network tab- It got solved after reinstalling the ubuntu and then Grid4, now all diskspace values shows up just fine! :slight_smile:

Hi Francis
I have a question about this options because snap is enforcing apparmore and Capturegrid4 can’t set Photo Download Directory to mounter dir. Is there some workaround how to move photos from other Slaves nodes on linux directly to cifs shared folder ?
Thank you
Martin

I’m not an expert on linux and apparmor, but is there a way to disable apparmor on your system? I think thats probably the first thing to investigate.