Giter Club home page Giter Club logo

Comments (13)

jmangum avatar jmangum commented on June 18, 2024 1

Thank you @deckerego! I will give this new feature a try, but it might be a few weeks before I can get to it.

from ampule.

deckerego avatar deckerego commented on June 18, 2024

Multipart/MIME file uploads and downloads aren't available yet, but I'll look into adding that as an enhancement this week.

from ampule.

jmangum avatar jmangum commented on June 18, 2024

Perfect. FYI, the application where I would like to use file transfer over http is a wifi-connected Adafruit MLX90640 IR camera connected to an Unexpected Maker FeatherS2 ESP32S2 that I want to run as a remote wildlife camera. I may also try sending the IR camera frames over RFM95 radio transceiver, but I thought that sending over wifi might be an easier implementation.

from ampule.

deckerego avatar deckerego commented on June 18, 2024

@jmangum - are you planning to get the raw byte array from the camera driver, and then convert & send the file in-memory? That's the approach I'm looking at right now at least - providing a method to return a raw byte array with a supplied MIME type.

from ampule.

jmangum avatar jmangum commented on June 18, 2024

I was planning on using the CircuitPython library to grab the image from the camera and send these image data as a file that I could then transfer via HTTP. Did not plan on doing this in memory.

from ampule.

deckerego avatar deckerego commented on June 18, 2024

Could you point me to the library methods you were thinking of using to fetch the image? I'd like to review the return types and build an example & tests that match your use case.

from ampule.

jmangum avatar jmangum commented on June 18, 2024

The CurcuitPython library I use to read the MLX90640 is located at https://github.com/adafruit/Adafruit_CircuitPython_MLX90640.

from ampule.

deckerego avatar deckerego commented on June 18, 2024

Sure, but that seems to return a collection of integer values for infrared intensity rather than an image, correct? What functions would you call to return an image?

from ampule.

jmangum avatar jmangum commented on June 18, 2024

Correct. I can export this list of floats to a file which I can then transfer using your library. I then use another python script to generate an image from the list of floats (temperatures). This was why my original suggestion was that the general ability to transfer files would be useful.

from ampule.

deckerego avatar deckerego commented on June 18, 2024

Ah - gotcha. Thx for explaining @jmangum

For that particular use case I'd recommend serializing your floats into a JSON or plaintext response, then sending that response instead of sending a file. You could easily do that today using the Content-Type application/json or text/plain - you could either use the built-in JSON libraries within Python to convert an in-memory object, or you could manually build a string and send that in plaintext if you like.

I'm still going to work in allowing you to send binary data as a response (e.g. b'1234'), but for your particular use case I think you can get rolling with the current release.

from ampule.

deckerego avatar deckerego commented on June 18, 2024

@jmangum - I have a test version of ampule available in the pull request linked to this issue - feel free to try it out and let me know if that works. You will need to set the Content-Type accordingly if you output bytes instead of a string.

from ampule.

deckerego avatar deckerego commented on June 18, 2024

@jmangum - an updated version has been pushed to the file_download branch with fixes for the ESP32-S2. Feel free to give the updated version a whirl.

from ampule.

jmangum avatar jmangum commented on June 18, 2024

Thank you @deckerego. I think that you can close this issue.

from ampule.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.