Planning to implement a dynamic configuration feature in the firmware.
Does Notehub support sending an event/message/configuration file to the firmware through Notecard?
Hi @Srihari,
I would recommend using environment variables for this kind of task:
Thank you, good idea.
Hi Rob, I am using environment to read dynamic configuration using “env.get”, but I have to continuously check for new updates thus, wasting CPU cycles. Is there any option to get notification from the notehub to host?
I tried other option compare the time for response of following command “env.modified”, but it is giving empty result.
J *reqEnvupdate = NoteNewRequest(“env.modified”);
J *rsp = notecard.requestAndResponse(reqEnvupdate);
notecard.logDebug(JConvertToJSONString(rsp));
//JConvertToJSONString(rsp);
J *body = JGetObject(rsp, “body”);
if (body != NULL) {
Serial.print("Uodated time: ");
Serial.println(JGetString(body, “time”));
objNoteCardConnect.readConfig();
}
// int value = atoi(JGetString(body, “time”));
// Serial.print("Uodated time: ");
// Serial.println(value);
output:
16:58:40.380 → [INFO] {“req”:“env.modified”,“crc”:“002D:976A289C”}
16:58:40.502 → [INFO] {“time”:1737369172}
16:58:40.502 → {“time”:1737369172}
Hi @Srihari,
You could consider using the ATTN
pin on the Notecard and a GPIO interrupt on your host to provide an alert when there is an incoming message. For more information, check out the guide on the docs.
Thanks,
Alex