Skip to content
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

WIP: Create Hologram Publisher #323

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

dnowacki-usgs
Copy link

@dnowacki-usgs dnowacki-usgs commented Aug 20, 2020

This is code I wrote many months ago, recently updated to be mostly consistent with modern ModularSensors code formatting, that implements a publisher that uses the Hologram socket API. It is based off of EnviroDIYPublisher.cpp/EnviroDIYPublisher.h. There are a number of rough edges. In particular, the Hologram Device ID is currently hard-coded in HologramPublisher.cpp, and should really be set externally...I am not at all a C++ programmer. Would love input or modifications; I'm just putting this up here since there has been interest, particularly in #305.

@dnowacki-usgs, I made these edits while taking my first look at your code. Thanks!!! The timing is good, since I'm also working on another publisher with EnviroDIY#324.
My edits should only be to whitespace and doxygen-formated comments, so it should work identically to what you submitted. Can you confirm?
@aufdenkampe aufdenkampe requested a review from SRGDamia1 August 27, 2020 14:00
@aufdenkampe
Copy link
Member

@SRGDamia1, should we point this PR to develop, or merge directly into master?

Also, I haven't tested this on my own hardware. @dnowacki-usgs provides extra details on how to configure things in #305, so I might be able to try testing in over the next few weeks, but not right away.

@dnowacki-usgs
Copy link
Author

Hi @aufdenkampe thanks for the edits! I haven't had a chance to test them but they look good to me. I mentioned this (by linking to a gist) in #305, but this is how I generate the HologramAPI publisher in the logger .ino file:

const char *registrationToken = "xxxxxxxx";   // Make this the Hologram Device Key
const char *samplingFeature = "12345678-abcd-1234-ef00-1234567890ab";     // Sampling feature UUID

// Publisher for Hologram
// Create a data publisher for the EnviroDIY/WikiWatershed POST endpoint
#include <publishers/HologramPublisher.h>
HologramPublisher HologramAPI(dataLogger, &modem.gsmClient, registrationToken, samplingFeature);

Note that samplingFeature remains from the MMW code I based this off of, although it is unused, and the variable registrationToken might be better renamed deviceKey or something.

@aufdenkampe
Copy link
Member

@SRGDamia1, it's been a while since we actively discussed this, and the APIs have likely changed, but the benefits described in the following issue could still prove to be quite beneficial to our server-side bottlenecks at Model My Watershed.

Here's the relevant issue thread, with the reasoning why this feature could be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants