Great to see such a vibrant community here using Exosite! I’m trying to get the simple ReadWriteString example working on my photon to push data to the platform. I’m using this example
and from what I can tell this:
if ( exosite.writeRead(writeString+String(millis()), readString, returnString))
always evaluates to false. I’ve double checked my CIK and know that is correct. Is there something I’m missing or ideas on how I could further debug this to find out why this is returning false?
Off the top of my head the only thing that I can think of is that your device might not be activated. Are you using a generic device or a client model based device (something that asked you for a serial number)? If it’s the later it needs to be activated before the CIK can be used. Normally the device does this, you can use the provision example to do this automatically or do it manually once by manually making a request to http://docs.exosite.com/http/#activate
Thanks for the reply! I’m not sure what you mean about activated. I am using a Spark Photon and when I setup the device on the Exosite side I created a “generic device”. Is that the type of device I should have created or does it not really matter? The portal doesn’t list as being inactive, but it’s easy enough for me to just make that activate resource call as well to ensure it’s all good.
I’ve just forked the library so then I can modify the debugging information when I load it through the spark web based development IDE and we can see what’s going on. Once I can trace into that it will help uncover some things. Hoping to have time for that tonight. I’ll keep you posted on any updates. Thanks again!
Success! I got it working. Operator error on my part. Turning on debugging showed that I was getting a 400 Bad Request so I knew it was something on my side. Digging into the code I noticed that I had misunderstood the data source types and names. After looking at the API docs, I went back and recreated data sources “uptime” and “command” and all is good. I’ve now got data flowing into the portal.
Thanks for the help @Patrick!
Whether you have an example of using the particle webhook with Exosite?
This will be useful because in this way will be used AES encryption for Photon or now DTLS for the ELECTRON through the Particle Cloud.
This would be probably practicable with Lua script.
You can probably achieve two-way communication with GET and POST … https://docs.particle.io/guide/tools-and-features/webhooks/