Clear Filters
Clear Filters

Can we upload image to Thingspeak?

20 views (last 30 days)
Current situation:
I have saved my processed image in raspberry pi. I would like to upload the image to Thingspeak. However, I came across some posts saying that we cant upload image to Thingspeak. I wish to view my image at Thingspeak and also at Thingview(mobile app).
1) Can we upload image to Thingspeak?
2) Or can i upload the image to Google Drive then link it back to Thingspeak ?
3) If no, any way to do it?
This is the example that show the image, but I not sure how it does.
Mei Sing Wang
Mei Sing Wang on 1 Apr 2020
Hi, I am currently doing my final year project regarding on Iot Urban Farming, which I use Pi NoIR camera together with raspberry pi 3B+ in order to perform NDVI (Normalized Difference Vegetation Index) image. I want my camera to take picture at specific time every day and perform NDVI, then upload to Iot platform which we can visualize anytime.
There are two ways I would like to achieve:
1) Either show the NDVI image or
2) Plot the NDVI value to graph
Which way will be easier to achieve...
Currently, I have done my python script for:
1) Take picture at scheduled time
2) Process and show NDVI image and save to a specific folder in raspberry pi
Now I would like to upload it to an IoT platform(currently using Thingspeak) and I am kind of confused that should I:
1) continue work on python script to upload the image, or
2) work on Matlab visualization code
I am a total beginner on writing python code.
If I work on Matlab visualization code, is this where i should write my code?
Rene Chan
Rene Chan on 3 Apr 2020
Thanks for sharing the details!
One way to help you decide between the two next steps you are contemplating is to think about edge (on device) vs. cloud (ThingSpeak) processing.
Edge processing allows you to perform lighter duty computation on the device and then write the result to the cloud. It is easily achievable with you current implementation on the Pi and write the result to a ThingSpeak channel for basic visualization. It is a good starting point. What you will be missing is the additional analysis/processing of the images that is either impractical or impossible to do on the Pi.
Here's where the cloud processing like ThingSpeak with MATLAB comes in. For that to work, the raw data (images in this case) must be made available to ThingSpeak. ThingSpeak currently does not directly support collecting image as part of data write. But you can do what Christopher suggested by sending it to a third-party storage. You can then use MATLAB Visualization in ThingSpeak to perform computation and display the result on a channel.

Sign in to comment.

Accepted Answer

Christopher Stapels
Christopher Stapels on 31 Mar 2020
Edited: Christopher Stapels on 29 Dec 2020
At present, it is not easy to upload images to ThingSpeak. You could break it up into multiple fields and feeds, but it would require a lot of code and probably small images.
I suspect you can use google drive, though I haven't yet. The plant channel you linked uses a static image in the MathWorks documentation.
I used dropbox for the image on this channel. Here is the MATLAB visualization code. If you are using Dropbox, the key part is the dl=1 at the end of the URL.
myFig=figure( 'Position',[50 10 100 1000]);
Mei Sing Wang
Mei Sing Wang on 1 Apr 2020
Thank you, I will try to work on how to upload my image to Google Drive or Dropbox first haha. I am a beginner hence it takes a lot of time. Thanks!
Christopher Stapels
Christopher Stapels on 3 Aug 2022
You can now use ThingSpeak's new image ingestion service described on the write image doc page.

Sign in to comment.

More Answers (1)

Vinod on 31 Mar 2020
Edited: Vinod on 1 Apr 2020
If you are using a Raspberry Pi, you can set up the IP camera functionality on it and then use the IP camera in a MATLAB visualization on ThingSpeak.
For example, try this code that reads from a public IP camera in a MATLAB visualization:
title(sprintf('Last updated at: %s',datetime('now')))


More Answers in the  ThingSpeak Community


Find more on ThingSpeak in Help Center and File Exchange


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!