Problem with data property limited to 255 bytes in Particle.publish

Hi!, my (new) problem is that, on my purpose to send a wav file from a Photon device to a secure server by using web hooks, i’ve seen that, according to the doc, the data field for an event published through the particle cloud is limited to 255 bytes … does it means that it would not be possible to stream audio content directly from the photon device to the secure server? i’m sorry if this is a basic question, and i would like to thank any help from all experts.
best regards

You don’t want to squeeze your WAV file through Particle.publish() That
would take ages. The limit is 1 message per second, and with each message being 256 bytes, that’s a data throughput of at most 0.25kbytes/s. This is plenty for messaging (what the system is built for) but of course not for streaming.

To upload a WAV to a secure server you can:

  1. use the HTTP client library that has (recently gained) SSL support. You could post the data to a given URL.

  2. send the data to a trusted local server unencrypted, and have it forward that via HTTPS.

1 Like

Thanks @mdma! …
is the http client library available in Particle IDE?

Hi @mdma , is your solution valid in this partcular case? … what i’m trying to do is to perform a request to a secure server from my photon device (https), and by now, tha only solution i find for this is using webhooks. i have already implemented a webhook for sending text commands to this secure server, and it worked fine. tha problem is that for a different aplication, i need to send a wav file fro the photon device to a secure server, so i am implementing a webhoook, bur according to the request format of the server, i should send an authorization header, spacify a content-type, include some optional arguments, and then, put the binary data of the wav file in the body. Is this last step which i don’t know how to implement in a webhook … could you please give me some orientation about that?

@fbt, check this out: