@janjongboom I tried to create a CBOR file by using the ingestion-sdk from : https://github.com/edgeimpulse/ingestion-sdk-c
I hit following built errors
inc/sensor_aq.h:271:131: error: expected ‘;’, ‘,’ or ‘)’ before ‘=’ token
int sensor_aq_init(sensor_aq_ctx *ctx, sensor_aq_payload_info *payload_info, EI_SENSOR_AQ_STREAM *stream, bool allow_empty_stream = false) {
I think that’s because you cannot set default values for parameters in C.
To fix this, I defined allow_empty_stream
outside of function arguments:
int sensor_aq_init(sensor_aq_ctx *ctx, sensor_aq_payload_info *payload_info, EI_SENSOR_AQ_STREAM *stream) {
bool allow_empty_stream = false;
After that, I added my hmac-key
from the project to sensor_aq_init_mbedtls_hs256_ context function in test/main.c
I tried to upload generated binary file to my project using:
edge-impulse-uploader .\ingestion_data.cbor
Edge Impulse uploader v1.6.7
Endpoints:
API: https://studio.edgeimpulse.com/v1
Ingestion: https://ingestion.edgeimpulse.com
Upload configuration:
Label: Not set, will be infered from file name
Category: training
Project ID: 2776
[1/1] Failed to upload .\ingestion_data.cbor Invalid message body, was specified to be CBOR but could not decode message (Failed to parse)
I also tried to decode the file on cbor.me
and output as text and upload it. I face the same error.
I am not sure what i am doing wrong.
I am copy pasting my file here:
{
"protected": {
"ver": "v1",
"alg": "HS256"},
"signature": "my-generated-signature",
"payload": {
"device_name": "ac:87:a3:0a:2d:1b",
"device_type": "DISCO-L475VG-IOT01A",
"interval_ms": 10.0,
"sensors": [
{"name": "accX", "units": "m/s2"},
{"name": "accY", "units": "m/s2"},
{"name": "accZ", "units": "m/s2"}],
"values": [
[-9.8100004196167, 0.029999999329447746, 1.2100000381469727],
[-9.829999923706055, 0.03999999910593033, 1.2799999713897705],
[-9.119999885559082, 0.029999999329447746, 1.2300000190734863],
[-9.140000343322754, 0.009999999776482582, 1.25]
]
}
}