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

From where Etag shall be retrived on nats events? #1207

Open
ipzago opened this issue Jan 29, 2024 · 3 comments
Open

From where Etag shall be retrived on nats events? #1207

ipzago opened this issue Jan 29, 2024 · 3 comments

Comments

@ipzago
Copy link

ipzago commented Jan 29, 2024

Hello guys,

I'm trying to retrieve the Etag from a nats resourceChanged event but I'm not sure if I'm doing it right. The only Etag attribute that I found is in github.com/plgd-dev/hub/v2/resource-aggregate/events.ResourceChanged object, but it is nil.
Am I looking in the wrong place?

I'm using the plgd bundle ghcr.io/plgd-dev/hub/bundle:2.16.3

image

@jkralik
Copy link
Member

jkralik commented Jan 29, 2024

You are looking good, but there are a few things that are required:

  • The device needs to be compiled with the CMake option OC_ETAG_ENABLED using the command cmake -DOC_ETAG_ENABLED=ON ..., as described here.

  • You also need to enable ETAG in the CoAP gateway via Helm using the configuration option .coapgateway.deviceTwin.useETags.

I realized that these two things were not described, so I have now added them to our documentation.

@ipzago
Copy link
Author

ipzago commented Jan 29, 2024

@jkralik many thanks for the answer

Just another thing... we're using plgd bundle and run the container directly with docker, we don't use Helm. How can we configure it without Helm?

@jkralik
Copy link
Member

jkralik commented Jan 29, 2024

Start by mounting a volume on the directory /data. After the initial run, update the property deviceTwin.useETags to true in the file /data/coap-gateway-secure.yaml, and then rerun the process using the same volume.

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

2 participants