Posting Images with rpi not updating in thingspeak

Ken Mitchell on 16 Mar 2023 (Edited on 16 Mar 2023)
Latest activity Reply by Ken Mitchell on 17 Mar 2023

I can upload an image using postman. But when I try it with my rpi the image never shows. I receive status code 202. Then the current image from postman goes blank. Tells me the post sort of worked... Does anyone have working python3 code that they can share?

Christopher Stapels
Christopher Stapels on 16 Mar 2023
I've had this problem before. The issue is the format that the PI sends the bytes for the image for an HTTP POST arent recognized as a valid image type by MATLAB in ThingSpeak.
Ken Mitchell
Ken Mitchell on 16 Mar 2023
I was just using a pic already on the Pi, using a path to the actual pic. Trying to do it similar to Postman.
Ken Mitchell
Ken Mitchell on 17 Mar 2023

I tried to use the posted code and it failed. Hence tried postman and it worked. So tried to duplicate postman in python and it failed. I think issue is the new rpi os, python 2 vs 3? Anyone? Looking to getting it to work.

Christopher Stapels
Christopher Stapels on 16 Mar 2023 (Edited on 16 Mar 2023)
The code in the example I shared has a part for a local filename. If you chage that to match your file does it work? Is the method you are using similar to what is shown in the code?
When I tried a curl command directly from command line in the pi, I got the same problem you described.