Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axis data available only as a string on influx - subsequently cannot be used in Grafana #113

Open
anagaraj2 opened this issue Aug 13, 2024 · 1 comment

Comments

@anagaraj2
Copy link

anagaraj2 commented Aug 13, 2024

Hello,

I am trying to collect axis data and display it on a real time grafana dashboard.

  1. If I use the config.system.yml file as it is, through dozzle I can see that the FANUC driver is collecting axis data but I don't see any of the axis data like position, load, power, etc. listed on the influxdb UI. To solve this issue, I followed the suggestion by another user (Issue production data appears on the command line but does not send to influx.Pls help #110 ) and put all the parameters in quotes. When all the axis.data parameters are in quotes in the config.system.yml file, the data is available on influx as a string. However, this works only when all the parameters are in quotes, not a selected few.

  2. Under the case when all the axis.data parameters are being collected as a string, I am able to see the data as a table on grafana - say my machine has 2 axes, the first column is time, the second column is the x axis data and the third column is the z axis data. I don't know the right way to query flux to plot only the second column data. An additional problem that arises here is due to the headers being parsed as strings and each word in the data header is within double quotes, I get syntax errors when trying to copy the header and query flux. I have tried many different ways to query flux but it does not seem to work.

Thank you!

@anagaraj2
Copy link
Author

I found a long and not the most optimal workaround for this problem...

  1. Keep the parameters within quotes so that all the data is collected and sent to influx.

  2. Link the data source to grafana.

  3. Use a flux query that converts the strings to float
    from(bucket: “fanuc”)
    |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
    |> filter(fn: (r) => r[“_measurement”] == “axis”)
    |> filter(fn: (r) => r[“_field”] == “load”)
    |> map(fn: (r) => ({
    r with
    _value: float(v: r._value),
    _time: time(v: r._time)
    }))

  4. At this stage, the grafana dashboard will plot all the data being collected on the same plot (X axis, Y axis, Z axis, etc.) but these can be selected by series name under the override options. Then the required data can be plotted by hiding every other series also available as an override option (hide in area).

P.S. I was not able to figure out the flux code to select the series directly and hence had to use the override option. There was an issue with the data headers having double quotes for each of the words (for example - load {axis=""X"", machine=""cnc1"", path=""1""}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant