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