CPU Temperature to Particle Cloud

Hello Dear Community,

I would like to know if anyone of you was able to load the CPU Temperature of the Raspberry Pi onto the Cloud and could help me.

I am a total beginner regarding the usage of the Pi and the Particle Cloud and couldn’t find any answer by now.

It would be awesome if there’s someone willing to share any helpful information.

Thank you in advance!

Hi there,

The Raspberry Pi is no longer supported as a Particle hardware platform, so I recommend not spending too much time on it.

That said, you should be able to use Particle.publish() to push the temperature to the cloud. From there, you could talk to something like Thingspeak.com to display the temperature in a graphical form (chart, etc.). For Thingspeak, you’ll need to set up a webhook that pushes your data to their APIs; this is true for most other similar data visualization sites as well.

1 Like

Hello,

Thank you for the reply!

I will try out what you recommended.

Best regards

Hello one more time,

I was just wondering if you know the code behind pushing the temperature of the Pi onto the cloud.
I am new to this and can’t figure out how to do it…

Would be really awesome if you could help me!

Best regards

Would this help?

(note the code in the screenshot)

1 Like

Thank you so much ScruffR!
It worked fine.

I would like to ask another question:

My current output looks like this, when I click “view events from a terminal”:

I would like to make it look like this:

49

The reason for this is that I need to parse the JSON, especially the “data” which stores the temperature values into Unity using JSON Utility. I am a beginner at this as well and I am pretty sure an output like mine on picture 1 won’t work, because I think it should dynamically update the values and not write a new line one by one for the JSON Utility to know what value is the latest.

Is there any way to do this? Or does it even matter if it’s dynamically updated on a single line instead of creating a new one for every event?

Best regards!

There are plenty threads you could search for JSON or *snprintf()` that would help you format your data the way you want it.

That won't work. A published event is fire and forget.
Imagine you spoke a sentence and then regret what you said, how would you replace any of the already spoken words?

However, I'm also pretty certain that Unity can cope with any kind of data you throw at it :wink:

1 Like

Oh wow I never thought about it this way…
It actually makes sense now and the event is basically still visible on my browser, but already forgot :smiley:

I think I am now able to solve my issue and once again, thank you so much!

I really appreciate your time and effort!

1 Like