How to push larger amount of data to the device?

Particle.function can be used to send upto 622 characters. But, how do I send something more, like a few kilobytes? Are there any established “best practices” to do that ? Or is pulling data using something like TCPClient the only way for this.

One simple hack I figured was to have the data in the code itself and OTA it. But I was hoping for something better than that.

I’ve searched the forum and found many posts on pushing data from the device but nothing to push data to the device.

The data has to be pushed just once in a while.

If you are using a Particle.function() then it also depends upon what sort of data you are sending because if it is bytes rather than ascii characters then you will need to encode the data as Base64. This effectively expands 3 bytes to 4 ascii characters. Plus you will need a checksum and a packet identifier - so 622 becomes more like 450 bytes of data per function call.

FTP is possible but doesn’t have the security unless you implement this yourself. It would be easier as a pull rather than a push to the device.

I get that. The encoding is a secondary hurdle. I am trying to cross the primary hurdle of 622 characters. I am suprised this hasn’t been asked in this forum earlier. Perhaps I am not using the right search terms.

I am trying to push it because it ensures security. Pulling through a secondary source is going to open up a lot of security issues. I would prefer to use the OTA hack over those.

Have you considered using MQTT? It has it’s limits as well but it should get you well past the 622 character limit. Good luck!

Yes, but doing it over TLS is the issue. Setting up MQTT-TLS library takes up significant part of the space available for the application, limiting the user application size. Guess I’d have to use the OTA hack.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.