I’m trying to build a web browser based android mobile client (mentioned here).
For the training, the data upload section the pseudo code is here:
when in training mode:
Make the device available on Edge-Impulse Studio by websocket handshake
if sampling request received from Edge-Impulse studio over websockets:
sample data for required length
when sampling finished:
[1] notify the studio through the designated websocket message
[2] in the data structure (with other details) push the returned data array
[3] encode the data structure (SHA-256 and hmacKey using https://github.com/Caligatio/jsSHA on the browser side as crypto lib is for nodejs)
[4] Upload the data using fetch()
I have another issue now
After the data uploads successfully, the wss
connection closes after few seconds upon upload.
A wss closure request
is received and the closure code is 1005
, meaning it expected a close status but received none.
I don’t know, if there should be a ping-pong messaging to keep the wss
connection open, until I request a closure from my client.
Any help or is it my code ()