Help installing github libraries?

(Hi, apologies in advance if this question is stupid, I’m not super experienced with Particle and even less so with C++ so expect some newbie ideas. I’ve tried reading the docs a lot but I’m still really confused and so I thought I might as well try and make a post. A pre-emptive thank you for your collective patience)

I am making a project in which I am attempting to connect to Google’s gmail API and retrieve user data. I originally tried using Particle’s in-built Google Cloud Platform pub-sub connection, however upon further reading the documentation on that integration, it seems that the connection is Particle → GCP not GCP → Particle, which is what I need. Therefore, I looked further into solutions and found this guide:

Which I’m pretty sure is how I can get it to work. However, one of the first steps in that guide is installing google’s client library:

However, unfortunately there is no one-line import solution for C++, and it instead sends you to the github:

And so I am trying to install this library but it is not within the particle community libraries, but I have the github for it. The docs seem to only include information for creating libraries, not importing them, and so I am stuck. I have both the web IDE and Particle Workbench installed, in case the web IDE is limeted in its abilities. Is there anyway to easily import this? I would think that just cloning it using VScode would work but honestly at this point I’m not sure.

(This next part might be a bit of a different category, but I didn’t want to split this into two posts)
Additionally(and this is where my c++ inexperience may come up), according to the github’s readme I need a “working c++ toolchain (compiler, linker, etc.)” to install this library. When I setup Particle Workbench it had me “install a toolchain” where I picked my device OS and installed it. Is this the same thing or do they just use the same term?

Again, thank you in advance for any help anyone gives. If this seems non-sensical or impossible to do even telling me that would help. Honestly, I’m not even sure that what I’m trying to can be done on an Argon, at which point I’d find another solution. But I figured it’d be better to ask the collective void than beat my head against a desk for another week.

Hi,
here is some example for ESP but should be easy to adapt and maybe will give you some hints :+1:

Best,
Arek

1 Like

That official Google library is only intended for Windows/Mac/Linux and will likely be impractical to use as it would need to be heavily modified.

The recommended way is to use the Google cloud integration, which only takes a few lines of code and no library at all.

Google Cloud Platform Integration Documentation

Ok thats what I thought, and I don’t have the expertise to modify it.

As for the documentation, I read that earlier, but from I read it seems like the integration is only one way. Particle publishes to Google Cloud Platform, but I need the opposite, Particle recieving from GCP. Did I miss a part of that document?

The GCP integration is one-way. You can’t subscribe to a Google cloud pubsub event on-device.

However, you can use the particle-api-js from a Google cloud function (or app engine). This makes it possible to subscribe to a pubsub event from your cloud function, and from that, generate a Particle function call or publish to get the data back to the device. That’s the recommended method.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.