Sending Multiple Values to Initial State using JSON

Sending Multiple Values to Initial State using JSON

bg opacity:.75

Review

Screenshot 2024-06-22 at 1.00.51 AM

Review

Screenshot 2024-06-22 at 1.02.00 AM

Goal: Use JSON to send Multiple Values to Initial State at Once

  • It is faster and uses less bandwidth to send multiple sensor in a single package
  • We will use JSON to package all the data and send to Initial State
  • The following examples are provided as a quick reference
  • More detailed steps are described in the lecture

Reminder: Steps to Connect Photon 2 and Initial State

  1. Create account at https://initialstate.com
  2. Create stream bucket at https://initialstate.com
  3. Create an integration -> webhook on Particle console
  4. Write firmware sketch and flash Photon 2

Configure Initial State to Receive JSON

Initial State Settings

image-20200703180348874

Configure Particle Cloud to Pass JSON

Particle integration settings

image-20200703160032339

Configure Particle Cloud to Pass JSON

Particle integration settings

JSON Data: {{{PARTICLE_EVENT_VALUE}}}

URL: https://groker.init.st/api/events

image-20200703180944077

Configure Particle Cloud to Pass JSON

Particle integration settings

img

Configure Particle Cloud to Pass JSON

Particle integration setting: HTTP Headers

X-IS-AccessKey > «USE YOUR OWN API KEY»>

X-IS-BucketKey > «USE YOUR OWN BUCKET KEY»>

Creating JSON

Exercise - Send Multiple Values to Initial State

  • Generate random temperature and humidity
  • Send to Initial State with one JSON value

Credits

Updated: