External memory for temporary image storage/buffering - Feasible?

Hey guys,
I am using the Particle Photon chip, and was wondering if its feasible to wire up an external memory IC for the Photon to communicate with (SPI probably?). I have images that are roughly 50K in size, and I want to get them up to the cloud and into the database. A stock Particle Photon does not have the memory capabilities to handle 50K worth of image data.

Would it be feasible to send the image stream into an external memory module, take only part of the image data out at a time (whatever memory allows), send these pieces to the cloud through multiple transmissions, and have them reconstructed in the database?

Is this a reasonable thing to do? Has anyone had any success with specific external memory modules?

Thanks and any info is greatly appreciated!

1 Like

Haven’t ever done that before, but doesn’t seem like a problem.

Do note that there is a limit to the length of strings you can send (I think 63 bytes?) and a limit of 1 function call per second (not sure on that one either) with a burst rate of up to 4 calls allowed.

This thread may be enlightening: Spark.Publish max length (63 characters)

Even if we get clever with our encoding, a 50k image is going to have a few percent overhead when we ASCII-armor it (don’t even think about uuencode or Base64 or similar! Those wouldn’t be “clever”), you’d still be looking at 15 minutes to send the image to the Particle cloud.

If I were doing it, I think I’d open a socket directly to a file service and burst my data that way… In fact - that’s a project for this weekend since I have large’ish chunks of ascii sensor data to move off the microSD. In theory, with a direct socket, there’s no reason you couldn’t stream that bitstream up some place in approximately realtime.

I’ve used a Micro SD card using a [breakout board] (https://www.sparkfun.com/products/13743) and the [SDFAT Library] (https://github.com/greiman/SdFat-Particle). It works quite well for storing very large amounts of data. I streamed it off later using HTTP POST.

2 Likes

HTTP POST is not a bad suggestion at all, but more overhead, and I’m a glutton for punishment. :wink: Same idea though. If you’re not deploying a bazillion, the card reader and card are dirt cheap. Even if you’re deploying a bazillion, the card reader and card are nearly dirt cheap. :wink:

I had trouble finding anything smaller than 8GB over the counter anymore. < $4 for an 8GB card, and < $4 for a reader, in one-off quantity.

In case Mahonroy wants to explore the madness we’re talking about, reference here: https://docs.particle.io/reference/firmware/photon/#tcpclient in the docs.

@Adrenalynn, you could also consider an SPI FRAM. Fujitsu makes 64KB/128KB/256KB 8-pin versions run at 25MHz SPI, last forever and have the extra advantage of being non-volatile. They may be perfect for what you want to do. :smiley:

2 Likes

Thanks Peekay, not big enough for me though. I need to be able to store at least a week’s worth of sensor data on the device. At least 64 megabits. $3-$4 in production volumes. Ultimately I may end-up going that way, 64megabits in production volume is around the same as 32 gigabits in microSD.

Thanks for the great info guys. Going to give one of those SPI FRAM IC’s a shot with this library:

Also going to try out the HTTP POST functionality.

1 Like