-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to post a file via the data param #194
Conversation
52b6b2c
to
29ada91
Compare
Tested @justmobilize solution with a Pico W/OV5640 PiCowbell/PiCowbell doubler setup which posts jpeg to Adafruit IO with feed history turned-off. Works perfectly! Due to memory limitations have to reset board (I actually put it into a A couple of important implementation notes:
Thank you @justmobilize ! |
Is there an example for using this? I'd like to give it a try, but I'm not sure how to use it. |
Sure thing @jerryneedell . Attached is my test code. Very much a work-in-progress, so please excuse the awful code. It does work as I have repeatedly posted pictures to aio. |
@jerryneedell here is the test code I used (just used an existing file): https://gist.github.com/justmobilize/f0ee9668d7aab6d91524b3ab53953d2c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, thanks for the new functionality @justmobilize!
Thanks for testing and letting us know @jmangum.
I tested this version successfully on a Feather ESP32S3 TFT. I compared requests made with this version of the library against those made with CPython requests using the same requests.post argument values.
All of my testing was with a local flask test server, not adafruit IO specifically.
I do think it would be nice ultimately to have an example in the repo in the examples dir, it's slightly more discoverable there than in the tests.
Updating https://github.com/adafruit/Adafruit_CircuitPython_DS248x to 1.0.1 from 1.0.0: > Update ds248x_simpletest.py Updating https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI to 8.4.0 from 8.3.1: > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#209 from justmobilize/add-ap-info Updating https://github.com/adafruit/Adafruit_CircuitPython_ConnectionManager to 3.1.1 from 3.1.0: > Merge pull request adafruit/Adafruit_CircuitPython_ConnectionManager#21 from justmobilize/update-wiznet-version-check Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 3.1.2 from 3.1.1: > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#208 from RetiredWizard/monoprecision Updating https://github.com/adafruit/Adafruit_CircuitPython_Requests to 4.1.1 from 4.0.0: > Merge pull request adafruit/Adafruit_CircuitPython_Requests#195 from DJDevon3/main > Merge pull request adafruit/Adafruit_CircuitPython_Requests#194 from justmobilize/post-file-as-data Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Added the following libraries: Adafruit_CircuitPython_S35710, Adafruit_CircuitPython_HX711 Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Updated download stats for the libraries
Add ability to post a file via the data param
data
object hasread
send it up as raw data, reading in chuncks