Hello all,
I’m working on making a device that detects motion and takes a picture of the motion. Once the image is captured, I’d like to send it over LTE to an API endpoint. The image itself will likely be 1-2 MB in size, so it’s not really that small. My question here is will the Notecard be able to support this and how feasible is this? I’m thinking this will exceed the capabilities of the notes feature, but could possibly work using the web proxy feature? If so, how would this work?
Thanks
Hi @brendanb and welcome to the Blues community!
Your question caught my eye as I’m about to embark on some image transfer tasks with the Notecard as well. In short, yes, you’re on the right path by considering the web.post API. There is a documentation section on Sending Large Payloads to Notehub that you should look at. In essence, you’ll be splitting up the file into fragments, and sending those one at a time to Notehub. YMMV, but 8KB seems to be a good size for each fragment you send.
Is this an Arduino app or Python or…? I ask because I would HIGHLY recommend converting/compressing the image to JPG/PNG/WebP (depending on what the image is). I’ve been using a great Arduino PNG library that takes ~100KB BMP images down to about 7KB.
Rob
2 Likes
Awesome. Thanks for the link. This would be an Arduino app (on an ESP32 micro controller). I’d love a link to your library for compressing images!
In terms of sending large payloads over multiple fragments… my understanding is that the host will send multiple fragments to the notecard, the notecard will send each of these fragments to Notehub, but then does Notehub assemble all of these into one before routing it to my API? Also, will this count as multiple routes that use consumption credits or will this only be one consumption credit for the entire operation?
I’m using the PNGenc library (but there is also a JPEGEnc library from the same author). I’ve found them to be very well supported libraries!
In terms of the fragments/routing, yes, you are correct. The host sends the ~8KB fragments to the Notecard, the Notecard uses the web.post API to send each fragment to Notehub, and Notehub assembles the fragments before routing. So the total consumption credits used would be 1 per web.post API request (so 1 per fragment), and 1 for routing the assembled file. Yet another reason to compress your images down!
Rob
what feather and what camera are you guys using?
In my case I wasn’t using a proper camera, instead a thermal camera breakout (MLX90640), along with the Blues Swan (STM32-based feather).
Rob