Error while sampling on thunderboard sense 2

Question/Issue:
I am trying to upload speech data for training a keyword spotting model on Thunderboard sense 2. I have uploaded the edge impulse firmware and run demo codes using simplicity studio. But I am facing error while sampling through edge impulse cli and browser.

ERROR:
Microsoft Windows [Version 10.0.19044.1889]
(c) Microsoft Corporation. All rights reserved.

C:\Users\disha>edge-impulse-daemon
Edge Impulse serial daemon v1.15.1
Endpoints:
Websocket: wss://remote-mgmt.edgeimpulse.com
API: https://studio.edgeimpulse.com/v1
Ingestion: https://ingestion.edgeimpulse.com

[SER] Connecting to COM7
[SER] Serial is connected, trying to read config…
[SER] Retrieved configuration
[SER] Device is running AT command version 1.3.0

Setting upload host in device… OK
Configuring remote management settings… OK
Configuring API key in device… OK
Configuring HMAC key in device… OK
[SER] Device is not connected to remote management API, will use daemon
[WS ] Connecting to wss://remote-mgmt.edgeimpulse.com
[WS ] Connected to wss://remote-mgmt.edgeimpulse.com
[WS ] Device “Thunderboard” is now connected to project “keyword detection”
[WS ] Go to Login - Edge Impulse to build your machine learning model!
[WS ] Incoming sampling request {
path: ‘/api/training/data’,
label: ‘test1’,
length: 5000,
interval: 16,
hmacKey: ‘769be16f3a9ade987a5c6e93d21c617e’,
sensor: ‘Built-in accelerometer’
}
[SER] Configured upload settings
[SER] Received stop signal, stopping application… Press CTRL+C again to force quit.
Terminate batch job (Y/N)? y

C:\Users\disha>edge-impulse-daemon
Edge Impulse serial daemon v1.15.1
Endpoints:
Websocket: wss://remote-mgmt.edgeimpulse.com
API: https://studio.edgeimpulse.com/v1
Ingestion: https://ingestion.edgeimpulse.com

[SER] Connecting to COM7
[SER] Serial is connected, trying to read config…
[SER] Retrieved configuration
[SER] Device is running AT command version 1.3.0

Setting upload host in device… OK
Configuring remote management settings… OK
Configuring API key in device… OK
Configuring HMAC key in device… OK
[SER] Device is not connected to remote management API, will use daemon
[WS ] Connecting to wss://remote-mgmt.edgeimpulse.com
[WS ] Connected to wss://remote-mgmt.edgeimpulse.com
[WS ] Device “Thunderboard” is now connected to project “keyword detection”
[WS ] Go to Login - Edge Impulse to build your machine learning model!
[WS ] Incoming sampling request {
path: ‘/api/training/data’,
label: ‘test1’,
length: 5000,
interval: 16,
hmacKey: ‘769be16f3a9ade987a5c6e93d21c617e’,
sensor: ‘Built-in accelerometer’
}
[SER] Configured upload settings
[SER] Serial closed - retrying in 5 seconds
[WS ] Trying to connect in 1 second…
[SER] Cannot connect to remote management API using daemon, failed to read apiKey, deviceId or deviceType from device. Restarting your development board might help. Retrying in 5 seconds…
[WS ] Connecting to wss://remote-mgmt.edgeimpulse.com
[WS ] Connected to wss://remote-mgmt.edgeimpulse.com
[SER] Serial is connected, trying to read config…
[WS ] Failed to sample data Error when communicating with device: Sampling settings:
Interval: 16 ms.
Length: 5000 ms.
Name: test1
HMAC Key: 769be16f3a9ade987a5c6e93d21c617e
File name: /fs/test1
Samples req: 312
Starting in 2000 ms… (or until all flash was erased)
b
Not a valid AT command (b)
[SER] Retrieved configuration
[SER] Device is running AT command version 1.3.0

[WS ] received message { err: ‘not authenticated, send “hello” first’, auth: false }
Setting upload host in device… OK
Configuring remote management settings… OK
Configuring API key in device… OK
Configuring HMAC key in device… OK
[SER] Failed to get info off device Error: Cannot parse sensor line: Nam
at EiSerialProtocol.getConfig (C:\Users\disha\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\shared\daemon\ei-serial-protocol.js:155:31)
at async SerialConnector.connectLogic (C:\Users\disha\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\daemon.js:482:26)
[SER] Serial is connected, trying to read config…
[SER] Failed to get info off device Error: Cannot parse sensor line: Nam
at EiSerialProtocol.getConfig (C:\Users\disha\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\shared\daemon\ei-serial-protocol.js:155:31)
at async Timeout.connectLogic [as _onTimeout] (C:\Users\disha\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\daemon.js:455:22)
[SER] Received stop signal, stopping application… Press CTRL+C again to force quit.
Terminate batch job (Y/N)? y

C:\Users\disha>edge-impulse-daemon
Edge Impulse serial daemon v1.15.1
Endpoints:
Websocket: wss://remote-mgmt.edgeimpulse.com
API: https://studio.edgeimpulse.com/v1
Ingestion: https://ingestion.edgeimpulse.com

[SER] Connecting to COM7
[SER] Serial is connected, trying to read config…
[SER] Retrieved configuration
[SER] Device is running AT command version 1.3.0

[SER] Device is not connected to remote management API, will use daemon
[WS ] Connecting to wss://remote-mgmt.edgeimpulse.com
[WS ] Connected to wss://remote-mgmt.edgeimpulse.com
[WS ] Device “Thunderboard” is now connected to project “keyword detection”
[WS ] Go to Login - Edge Impulse to build your machine learning model!
[WS ] Incoming sampling request {
path: ‘/api/training/data’,
label: ‘test1’,
length: 1000,
interval: 10,
hmacKey: ‘769be16f3a9ade987a5c6e93d21c617e’,
sensor: ‘Built-in accelerometer’
}
[SER] Configured upload settings
[SER] Device not connected to WiFi directly, reading from buffer (bytes 0 - 1872, expecting to read ~2496 bytes…
[SER] Reading 101% complete…
[SER] Reading from buffer OK
[SER] File is 1872 bytes after decoding
[SER] Uploading to https://ingestion.edgeimpulse.com/api/training/data
[SER] Failed to upload to https://ingestion.edgeimpulse.com/api/training/data StatusCodeError: 400 - “Missing protected header”
at new StatusCodeError (C:\Users\disha\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\request-promise-core\lib\errors.js:32:15)
at Request.plumbing.callback (C:\Users\disha\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\request-promise-core\lib\plumbing.js:104:33)
at Request.RP$callback [as _callback] (C:\Users\disha\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\request-promise-core\lib\plumbing.js:46:31)
at Request.self.callback (C:\Users\disha\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\request\request.js:185:22)
at Request.emit (events.js:400:28)
at Request. (C:\Users\disha\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\request\request.js:1161:10)
at Request.emit (events.js:400:28)
at IncomingMessage. (C:\Users\disha\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\request\request.js:1083:12)
at Object.onceWrapper (events.js:519:28)
at IncomingMessage.emit (events.js:412:35)
at endReadableNT (internal/streams/readable.js:1317:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
statusCode: 400,
error: ‘Missing protected header’,
options: {
headers: {
‘x-api-key’: ‘ei_6c211c6796b89e1f0666014e1fc18047ea242c4e8e283ead157923357d82c192’,
‘x-file-name’: ‘test1’,
‘Content-Type’: ‘application/cbor’
},
body: <Buffer 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 … 1822 more bytes>,
encoding: ‘binary’,
uri: ‘https://ingestion.edgeimpulse.com/api/training/data’,
method: ‘POST’,
callback: [Function: RP$callback],
transform: undefined,
simple: true,
resolveWithFullResponse: false,
transform2xxOnly: false
},
response: <ref 1> IncomingMessage {
_readableState: ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList { head: null, tail: null, length: 0 },
length: 0,
pipes: [],
flowing: true,
ended: true,
endEmitted: true,
reading: false,
sync: false,
needReadable: false,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
errorEmitted: false,
emitClose: true,
autoDestroy: false,
destroyed: false,
errored: null,
closed: false,
closeEmitted: false,
defaultEncoding: ‘utf8’,
awaitDrainWriters: null,
multiAwaitDrain: false,
readingMore: false,
decoder: [StringDecoder],
encoding: ‘latin1’,
[Symbol(kPaused)]: false
},
_events: [Object: null prototype] {
end: [Array],
close: [Array],
data: [Function (anonymous)],
error: [Function (anonymous)]
},
_eventsCount: 4,
_maxListeners: undefined,
socket: TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
secureConnecting: false,
_SNICallback: null,
servername: ‘ingestion.edgeimpulse.com’,
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object: null prototype],
_eventsCount: 10,
connecting: false,
_hadError: false,
_parent: null,
_host: ‘ingestion.edgeimpulse.com’,
_readableState: [ReadableState],
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: ‘’,
server: undefined,
_server: null,
ssl: [TLSWrap],
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: [ClientRequest],
[Symbol(res)]: [TLSWrap],
[Symbol(verified)]: true,
[Symbol(pendingSession)]: null,
[Symbol(async_id_symbol)]: 537,
[Symbol(kHandle)]: [TLSWrap],
[Symbol(kSetNoDelay)]: false,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(connect-options)]: [Object],
[Symbol(RequestTimeout)]: undefined
},
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: ‘1.1’,
complete: true,
headers: {
date: ‘Wed, 17 Aug 2022 10:32:12 GMT’,
‘content-type’: ‘text/plain’,
‘transfer-encoding’: ‘chunked’,
connection: ‘close’,
‘access-control-allow-origin’: '
’,
‘content-security-policy’: “default-src ‘none’; frame-ancestors ‘none’; form-action ‘none’;”,
‘x-content-type-options’: ‘nosniff’,
‘x-frame-options’: ‘DENY’,
‘x-xss-protection’: ‘1; mode=block’,
‘referrer-policy’: ‘strict-origin’,
‘cache-control’: ‘s-maxage=0,public,no-cache,no-store,must-revalidate’,
‘strict-transport-security’: ‘max-age=63072000’
},
rawHeaders: [
‘Date’,
‘Wed, 17 Aug 2022 10:32:12 GMT’,
‘Content-Type’,
‘text/plain’,
‘Transfer-Encoding’,
‘chunked’,
‘Connection’,
‘close’,
‘Access-Control-Allow-Origin’,
‘*’,
‘Content-Security-Policy’,
“default-src ‘none’; frame-ancestors ‘none’; form-action ‘none’;”,
‘X-Content-Type-Options’,
‘nosniff’,
‘X-Frame-Options’,
‘DENY’,
‘X-XSS-Protection’,
‘1; mode=block’,
‘Referrer-Policy’,
‘strict-origin’,
‘Cache-Control’,
‘s-maxage=0,public,no-cache,no-store,must-revalidate’,
‘Strict-Transport-Security’,
‘max-age=63072000’
],
trailers: {},
rawTrailers: [],
aborted: false,
upgrade: false,
url: ‘’,
method: null,
statusCode: 400,
statusMessage: ‘Bad Request’,
client: TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
secureConnecting: false,
_SNICallback: null,
servername: ‘ingestion.edgeimpulse.com’,
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object: null prototype],
_eventsCount: 10,
connecting: false,
_hadError: false,
_parent: null,
_host: ‘ingestion.edgeimpulse.com’,
_readableState: [ReadableState],
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: ‘’,
server: undefined,
_server: null,
ssl: [TLSWrap],
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: [ClientRequest],
[Symbol(res)]: [TLSWrap],
[Symbol(verified)]: true,
[Symbol(pendingSession)]: null,
[Symbol(async_id_symbol)]: 537,
[Symbol(kHandle)]: [TLSWrap],
[Symbol(kSetNoDelay)]: false,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(connect-options)]: [Object],
[Symbol(RequestTimeout)]: undefined
},
_consuming: true,
_dumped: false,
req: ClientRequest {
_events: [Object: null prototype],
_eventsCount: 5,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: false,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
_defaultKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: ‘’,
finished: true,
_headerSent: true,
socket: [TLSSocket],
_header: ‘POST /api/training/data HTTP/1.1\r\n’ +
‘x-api-key: ei_6c211c6796b89e1f0666014e1fc18047ea242c4e8e283ead157923357d82c192\r\n’ +
‘x-file-name: test1\r\n’ +
‘Content-Type: application/cbor\r\n’ +
‘host: ingestion.edgeimpulse.com\r\n’ +
‘content-length: 1872\r\n’ +
‘Connection: close\r\n’ +
‘\r\n’,
_keepAliveTimeout: 0,
_onPendingData: [Function: noopPendingOutput],
agent: [Agent],
socketPath: undefined,
method: ‘POST’,
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
path: ‘/api/training/data’,
_ended: true,
res: [Circular *1],
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: ‘ingestion.edgeimpulse.com’,
protocol: ‘https:’,
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype]
},
request: Request {
_events: [Object: null prototype],
_eventsCount: 5,
_maxListeners: undefined,
headers: [Object],
body: <Buffer 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 … 1822 more bytes>,
encoding: ‘binary’,
uri: [Url],
method: ‘POST’,
readable: true,
writable: true,
explicitMethod: true,
_qs: [Querystring],
_auth: [Auth],
_oauth: [OAuth],
_multipart: [Multipart],
_redirect: [Redirect],
_tunnel: [Tunnel],
_rp_resolve: [Function (anonymous)],
_rp_reject: [Function (anonymous)],
_rp_promise: [Promise [Object]],
_rp_callbackOrig: undefined,
callback: [Function (anonymous)],
_rp_options: [Object],
setHeader: [Function (anonymous)],
hasHeader: [Function (anonymous)],
getHeader: [Function (anonymous)],
removeHeader: [Function (anonymous)],
localAddress: undefined,
pool: {},
dests: [],
__isRequestRequest: true,
_callback: [Function: RP$callback],
proxy: null,
tunnel: true,
setHost: true,
originalCookieHeader: undefined,
_disableCookies: true,
_jar: undefined,
port: 443,
host: ‘ingestion.edgeimpulse.com’,
path: ‘/api/training/data’,
httpModule: [Object],
agentClass: [Function: Agent],
agent: [Agent],
_started: true,
href: ‘https://ingestion.edgeimpulse.com/api/training/data’,
req: [ClientRequest],
ntick: true,
response: [Circular *1],
originalHost: ‘ingestion.edgeimpulse.com’,
originalHostHeaderName: ‘host’,
responseContent: [Circular 1],
_destdata: true,
_ended: true,
_callbackCalled: true,
[Symbol(kCapture)]: false
},
toJSON: [Function: responseToJSON],
caseless: Caseless { dict: [Object] },
body: ‘Missing protected header’,
[Symbol(kCapture)]: false,
[Symbol(RequestTimeout)]: undefined
}
}
[WS ] Incoming sampling request {
path: ‘/api/training/data’,
label: ‘test1’,
length: 1000,
interval: 16,
hmacKey: ‘769be16f3a9ade987a5c6e93d21c617e’,
sensor: ‘Built-in accelerometer’
}
[SER] Configured upload settings
[SER] Sampling started
[SER] Sampling done
[SER] Device not connected to WiFi directly, reading from buffer (bytes 0 - 1264, expecting to read ~1685 bytes…
[SER] Reading 101% complete…
[SER] Reading from buffer OK
[SER] File is 1264 bytes after decoding
[SER] Uploading to https://ingestion.edgeimpulse.com/api/training/data
[SER] Failed to upload to https://ingestion.edgeimpulse.com/api/training/data StatusCodeError: 400 - “Missing protected header”
at new StatusCodeError (C:\Users\disha\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\request-promise-core\lib\errors.js:32:15)
at Request.plumbing.callback (C:\Users\disha\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\request-promise-core\lib\plumbing.js:104:33)
at Request.RP$callback [as _callback] (C:\Users\disha\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\request-promise-core\lib\plumbing.js:46:31)
at Request.self.callback (C:\Users\disha\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\request\request.js:185:22)
at Request.emit (events.js:400:28)
at Request. (C:\Users\disha\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\request\request.js:1161:10)
at Request.emit (events.js:400:28)
at IncomingMessage. (C:\Users\disha\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\request\request.js:1083:12)
at Object.onceWrapper (events.js:519:28)
at IncomingMessage.emit (events.js:412:35)
at endReadableNT (internal/streams/readable.js:1317:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
statusCode: 400,
error: ‘Missing protected header’,
options: {
headers: {
‘x-api-key’: ‘ei_6c211c6796b89e1f0666014e1fc18047ea242c4e8e283ead157923357d82c192’,
‘x-file-name’: ‘test1’,
‘Content-Type’: ‘application/cbor’
},
body: <Buffer 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 … 1214 more bytes>,
encoding: ‘binary’,
uri: ‘https://ingestion.edgeimpulse.com/api/training/data’,
method: ‘POST’,
callback: [Function: RP$callback],
transform: undefined,
simple: true,
resolveWithFullResponse: false,
transform2xxOnly: false
},
response: <ref 1> IncomingMessage {
_readableState: ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList { head: null, tail: null, length: 0 },
length: 0,
pipes: [],
flowing: true,
ended: true,
endEmitted: true,
reading: false,
sync: false,
needReadable: false,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
errorEmitted: false,
emitClose: true,
autoDestroy: false,
destroyed: false,
errored: null,
closed: false,
closeEmitted: false,
defaultEncoding: ‘utf8’,
awaitDrainWriters: null,
multiAwaitDrain: false,
readingMore: false,
decoder: [StringDecoder],
encoding: ‘latin1’,
[Symbol(kPaused)]: false
},
_events: [Object: null prototype] {
end: [Array],
close: [Array],
data: [Function (anonymous)],
error: [Function (anonymous)]
},
_eventsCount: 4,
_maxListeners: undefined,
socket: TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
secureConnecting: false,
_SNICallback: null,
servername: ‘ingestion.edgeimpulse.com’,
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object: null prototype],
_eventsCount: 10,
connecting: false,
_hadError: false,
_parent: null,
_host: ‘ingestion.edgeimpulse.com’,
_readableState: [ReadableState],
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: ‘’,
server: undefined,
_server: null,
ssl: [TLSWrap],
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: [ClientRequest],
[Symbol(res)]: [TLSWrap],
[Symbol(verified)]: true,
[Symbol(pendingSession)]: null,
[Symbol(async_id_symbol)]: 819,
[Symbol(kHandle)]: [TLSWrap],
[Symbol(kSetNoDelay)]: false,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(connect-options)]: [Object],
[Symbol(RequestTimeout)]: undefined
},
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: ‘1.1’,
complete: true,
headers: {
date: ‘Wed, 17 Aug 2022 10:34:07 GMT’,
‘content-type’: ‘text/plain’,
‘transfer-encoding’: ‘chunked’,
connection: ‘close’,
‘access-control-allow-origin’: '
’,
‘content-security-policy’: “default-src ‘none’; frame-ancestors ‘none’; form-action ‘none’;”,
‘x-content-type-options’: ‘nosniff’,
‘x-frame-options’: ‘DENY’,
‘x-xss-protection’: ‘1; mode=block’,
‘referrer-policy’: ‘strict-origin’,
‘cache-control’: ‘s-maxage=0,public,no-cache,no-store,must-revalidate’,
‘strict-transport-security’: ‘max-age=63072000’
},
rawHeaders: [
‘Date’,
‘Wed, 17 Aug 2022 10:34:07 GMT’,
‘Content-Type’,
‘text/plain’,
‘Transfer-Encoding’,
‘chunked’,
‘Connection’,
‘close’,
‘Access-Control-Allow-Origin’,
'
’,
‘Content-Security-Policy’,
“default-src ‘none’; frame-ancestors ‘none’; form-action ‘none’;”,
‘X-Content-Type-Options’,
‘nosniff’,
‘X-Frame-Options’,
‘DENY’,
‘X-XSS-Protection’,
‘1; mode=block’,
‘Referrer-Policy’,
‘strict-origin’,
‘Cache-Control’,
‘s-maxage=0,public,no-cache,no-store,must-revalidate’,
‘Strict-Transport-Security’,
‘max-age=63072000’
],
trailers: {},
rawTrailers: [],
aborted: false,
upgrade: false,
url: ‘’,
method: null,
statusCode: 400,
statusMessage: ‘Bad Request’,
client: TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
secureConnecting: false,
_SNICallback: null,
servername: ‘ingestion.edgeimpulse.com’,
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object: null prototype],
_eventsCount: 10,
connecting: false,
_hadError: false,
_parent: null,
_host: ‘ingestion.edgeimpulse.com’,
_readableState: [ReadableState],
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: ‘’,
server: undefined,
_server: null,
ssl: [TLSWrap],
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: [ClientRequest],
[Symbol(res)]: [TLSWrap],
[Symbol(verified)]: true,
[Symbol(pendingSession)]: null,
[Symbol(async_id_symbol)]: 819,
[Symbol(kHandle)]: [TLSWrap],
[Symbol(kSetNoDelay)]: false,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(connect-options)]: [Object],
[Symbol(RequestTimeout)]: undefined
},
_consuming: true,
_dumped: false,
req: ClientRequest {
_events: [Object: null prototype],
_eventsCount: 5,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: false,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
_defaultKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: ‘’,
finished: true,
_headerSent: true,
socket: [TLSSocket],
_header: ‘POST /api/training/data HTTP/1.1\r\n’ +
‘x-api-key: ei_6c211c6796b89e1f0666014e1fc18047ea242c4e8e283ead157923357d82c192\r\n’ +
‘x-file-name: test1\r\n’ +
‘Content-Type: application/cbor\r\n’ +
‘host: ingestion.edgeimpulse.com\r\n’ +
‘content-length: 1264\r\n’ +
‘Connection: close\r\n’ +
‘\r\n’,
_keepAliveTimeout: 0,
_onPendingData: [Function: noopPendingOutput],
agent: [Agent],
socketPath: undefined,
method: ‘POST’,
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
path: ‘/api/training/data’,
_ended: true,
res: [Circular *1],
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: ‘ingestion.edgeimpulse.com’,
protocol: ‘https:’,
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype]
},
request: Request {
_events: [Object: null prototype],
_eventsCount: 5,
_maxListeners: undefined,
headers: [Object],
body: <Buffer 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 … 1214 more bytes>,
encoding: ‘binary’,
uri: [Url],
method: ‘POST’,
readable: true,
writable: true,
explicitMethod: true,
_qs: [Querystring],
_auth: [Auth],
_oauth: [OAuth],
_multipart: [Multipart],
_redirect: [Redirect],
_tunnel: [Tunnel],
_rp_resolve: [Function (anonymous)],
_rp_reject: [Function (anonymous)],
_rp_promise: [Promise [Object]],
_rp_callbackOrig: undefined,
callback: [Function (anonymous)],
_rp_options: [Object],
setHeader: [Function (anonymous)],
hasHeader: [Function (anonymous)],
getHeader: [Function (anonymous)],
removeHeader: [Function (anonymous)],
localAddress: undefined,
pool: {},
dests: [],
__isRequestRequest: true,
_callback: [Function: RP$callback],
proxy: null,
tunnel: true,
setHost: true,
originalCookieHeader: undefined,
_disableCookies: true,
_jar: undefined,
port: 443,
host: ‘ingestion.edgeimpulse.com’,
path: ‘/api/training/data’,
httpModule: [Object],
agentClass: [Function: Agent],
agent: [Agent],
_started: true,
href: ‘https://ingestion.edgeimpulse.com/api/training/data’,
req: [ClientRequest],
ntick: true,
response: [Circular *1],
originalHost: ‘ingestion.edgeimpulse.com’,
originalHostHeaderName: ‘host’,
responseContent: [Circular *1],
_destdata: true,
_ended: true,
_callbackCalled: true,
[Symbol(kCapture)]: false
},
toJSON: [Function: responseToJSON],
caseless: Caseless { dict: [Object] },
body: ‘Missing protected header’,
[Symbol(kCapture)]: false,
[Symbol(RequestTimeout)]: undefined
}
}
[WS ] Incoming sampling request {
path: ‘/api/training/data’,
label: ‘test1’,
length: 1000,
interval: 0.0625,
hmacKey: ‘769be16f3a9ade987a5c6e93d21c617e’,
sensor: ‘Built-in microphone’
}
[SER] Configured upload settings
[SER] Device not connected to WiFi directly, reading from buffer (bytes 0 - 32000, expecting to read ~42666 bytes…
[SER] Reading 23% complete…
[SER] Reading 50% complete…
[SER] Reading 76% complete…
[SER] Reading 89% complete…
[SER] Reading from buffer OK
[SER] File is 28744 bytes after decoding
[SER] Uploading to https://ingestion.edgeimpulse.com/api/training/data
[SER] Failed to upload to https://ingestion.edgeimpulse.com/api/training/data StatusCodeError: 400 - “Invalid message body, was specified to be CBOR but could not decode message (Undeterminated nesting)”
at new StatusCodeError (C:\Users\disha\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\request-promise-core\lib\errors.js:32:15)
at Request.plumbing.callback (C:\Users\disha\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\request-promise-core\lib\plumbing.js:104:33)
at Request.RP$callback [as _callback] (C:\Users\disha\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\request-promise-core\lib\plumbing.js:46:31)
at Request.self.callback (C:\Users\disha\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\request\request.js:185:22)
at Request.emit (events.js:400:28)
at Request. (C:\Users\disha\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\request\request.js:1161:10)
at Request.emit (events.js:400:28)
at IncomingMessage. (C:\Users\disha\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\request\request.js:1083:12)
at Object.onceWrapper (events.js:519:28)
at IncomingMessage.emit (events.js:412:35)
at endReadableNT (internal/streams/readable.js:1317:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
statusCode: 400,
error: ‘Invalid message body, was specified to be CBOR but could not decode message (Undeterminated nesting)’,
options: {
headers: {
‘x-api-key’: ‘ei_6c211c6796b89e1f0666014e1fc18047ea242c4e8e283ead157923357d82c192’,
‘x-file-name’: ‘test1’,
‘Content-Type’: ‘application/cbor’
},
body: <Buffer 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 … 28694 more bytes>,

Project ID:
129631

Hi @abhay
Sorry for the long response. First thing: did you try our pre-compiled firmware? You can download it form this link: https://cdn.edgeimpulse.com/firmware/silabs-thunderboard-sense2.bin
Details on how to flash it you can find here: SiLabs Thunderboard Sense 2 - Edge Impulse Documentation

Mateusz

Hi @abhay,

Your firmware seems to be running an older version of AT commands (1.3.0) can use newer thunderboard sense 2 firmware? Either:

Try it and I hope this solves your issue.

1 Like

Thankyou for the reply, I will surely do the following and get back to you with the result.