Skip to content

Add Raspberry Pi sensor observables#60

Merged
whymarrh merged 2 commits intomasterfrom
cpu-sensors
Mar 13, 2016
Merged

Add Raspberry Pi sensor observables#60
whymarrh merged 2 commits intomasterfrom
cpu-sensors

Conversation

@whymarrh
Copy link
Copy Markdown
Contributor

Closes #53

This PR implements observables for CPU voltage, frequency, and temperature (via Pi4J's SystemInfo methods). The usage is simple enough; a 1 minute poll interval:

final CpuInformation cpu = new CpuInformation(1, TimeUnit.MINUTES);
cpu.observe().subscribe();

@whymarrh whymarrh added this to the MATE 2016 milestone Feb 13, 2016
@cal-pratt
Copy link
Copy Markdown
Contributor

ship it!

@cal-pratt
Copy link
Copy Markdown
Contributor

Has this been tested? Can it be merged into master?

@whymarrh
Copy link
Copy Markdown
Contributor Author

whymarrh commented Mar 3, 2016

This has been tested and it works, but I have a few changes to make before merging this.

@whymarrh
Copy link
Copy Markdown
Contributor Author

whymarrh commented Mar 3, 2016

Should the API expose the three methods that are there now, or should there be just one Observable<CpuInformationValue> that has props for voltage, frequency, and temperature?

@cal-pratt
Copy link
Copy Markdown
Contributor

The latter. It would be cool to have a CpuInformation value pair with a String var for hostname ("rasprime", "picam1", etc). Then we could pretty easily make a view on the GUI to monitor all the different pi's.

@whymarrh whymarrh force-pushed the cpu-sensors branch 2 times, most recently from 7b94b99 to 89f247f Compare March 11, 2016 20:55
@whymarrh
Copy link
Copy Markdown
Contributor Author

This needs to sanity-checked on a Pi, but is ready for review /cc @EasternEdgeRobotics/developers

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to observe multiple raspi we will need a name field

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where the images don't have their hostnames set to anything meaningful, would it be better to attach a name externally instead? That is, in each entry point, when wiring up this information, we can map machines to the streams (somehow).

(Which might be doubly useful if we need to map machines to other information.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could make our own composite class to wrap names with an object? Essentially a clone of the timestamped class you mentioned the other day.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would work, yeah. How does that sound?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@cal-pratt
Copy link
Copy Markdown
Contributor

Ship it

whymarrh added a commit that referenced this pull request Mar 13, 2016
Add Raspberry Pi sensor observables
@whymarrh whymarrh merged commit 8346182 into master Mar 13, 2016
@whymarrh whymarrh deleted the cpu-sensors branch March 13, 2016 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants