This event includes 3 data points: gps, temperature, and notification. These will translate to “tags” in the Renesas IoT Sandbox.
Step 4: Activate Tags in Renesas IoT Sandbox
Go back to Renesas IoT Sandbox’s web portal and click on Config => Data Streams.
Click on “Edit” for raw datastream.
Change gps Extended Type to “GeoPoint Time Series” and active all three tags as shown below. Save.
Click on Dashboard and add the “Single User – Real Time Event Log” widget to your view.
Select user “mobile” (or the name of the user you created).
Step 5: Create a New Profile on Mobile
In the Iot Controller app, create a new profile. Click the + in the top righthand corner, then click the new profile created and name it. You will need to create an API Key, Login, and Password (see Steps 2).
You will create a “new” profile.
Note: You can delete profiles by swiping right.
Open the “new” profile. Click API login and enter your credentials from above.
Click Renesas and Done. Remember to click “Save” (only for iOS).
Step 6: Adding New Widgets
Click the +Add New Widget button on the top, and you will see a scrolling list of 8 Widgets you can enable.
Add a slider widget, then click on the slider icon to configure it. Enter raw for stream and temperature for tag.
Now add the switch widget. Enter raw for stream and switch for tag.
Your screen should look something like this:
Go back to your dashboard and observe the real-time event chart as you toggle the switch and change the slider on the mobile phone. You should see the events appear. Congrats! You just sent events to Renesas IoT Sandbox’s cloud using your mobile device.
Additional notes on the different widgets:
GPS: This widget will transmit geoPoints once every 5 seconds*.
Gauge: This widget will query a stream/tag once every 2 seconds*.
Notification: This widget will query a stream/tag once every 2 seconds for a text message*.
Log: This widget will query a stream/tag once every 2 seconds for last 10 text message*.
Map: This widget will query a stream/tag with type geoPoint to display location on the map*.
JSON: This widget will transmit a JSON key value pair.
* These widgets consume a lot of credits and are not recommended for Sandbox.
How to send a push notification
If you allow push notifications on the mobile app, a FCM_token tag and key are created in the raw data stream when the profile is created. Be sure to activate the FCM_token key. If you don’t see it, you’ve probably disabled push notifications, or have not created a profile on the mobile app.
Next, create a workflow to send Push Notifications. Click on Workflow Studio and “Create”.
Give your workflow a name like “Push Notification”.
Click on “Tags and Triggers” on the right panel and expand the raw stream. Drag “temperature” over to the center canvas.
Click on Modules on the right panel and under Foundation, drag “Base Python” to the center canvas as well.
Double click on Base Python. Expand IONodes to expose “Add Input”, click here to add an additional input to this module. Click Save.
You will now see two input nodes. Under Tags and Triggers on the right panel, drag “FCM_token” to the main canvas. Note, you need to activate the tag in order to see it and use it.
Drag FCM_token to the canvas and connect it to in2 of the module.
Now we are going to write a simple workflow script. Double click on Python and add these lines. It’s important that the temperature and FCM_token trigger are in the same order as described to match the code.
Code snippet here:
temperature = IONode.get_input(‘in1’)[‘event_data’][‘value’]