Modifing Arduino example template493

OldNerd private msg quote post Address this user
Hi all, I'm new to GroveStreams (have used Temboo and Thinkspeak before) and am impressed with the power and functionality offered. The downside is that I found it kind of difficult to "drive".
I was able to get the Arduino Yun example up and running but now I'm hitting the wall to make the following changes:
- Instead of Temperature I would like to measure Water Consumption so I would like to rename all the titles accordingly.
- Remove the temperature in F as I will have just one magnitude (Liters) to be displayed.

I'm pretty familiar with Arduino so I need some hints as what is to be changed on its sketch but what I really need is some guide as how to edit the Grove side of the equation.

Anyone kind enough to share a guideline as how to change the Example?

Many thanks in advance
Post 1 IP   flag post
MikeMills private msg quote post Address this user
In the GS Observation studio, right click on your component and choose "Edit". You can pretty much change anything in there including the stream name. The feed api, that the arduino is using, detects which component to put the stream data into by using the Component ID and the Stream ID so if you change those IDs, then you need to change your Ardunio code.

Editing a component after it has been created is not an issue, but if you are registering many devices/components, then it can become a painfully repetitive thing to do. To avoid that, edit a component so that it looks the way you want (names, value types, units, and such), save it, and then right click on it and Create a template based on it. Enter Component Studio, edit the template, give it an ID, pass the template ID into every feed PUT call on the Arduino (many examples of this in our examples). This will create a new component based on the template if a component with that ID does not exist.
Post 2 IP   flag post
OldNerd private msg quote post Address this user
Thanks Mike, it seems I'm doing something wrong because every time I try to change the Name of the stream (from temperature - C to Water Consumption)

I get an error message

What am I doing wrong?

Post 3 IP   flag post
MikeMills private msg quote post Address this user
You should be able to edit a component, change a stream name, and save it.

The error you are getting is usually related to changing a setting on the stream that changes how the stream data is saved in the store. GS needs to reconcile (or transform) the existing data. For example, if you change the value type from Integer to Float, then a reconcile occurs. Are you changing any other stream setting besides the name?

A simple workaround, if you don't care about your existing data, is to delete all existing stream data before you edit the component and save it. Right click on the stream and select Delete All Time-Series data. Then there is no reconcile when the component is saved.
Post 4 IP   flag post
OldNerd private msg quote post Address this user
Thanks Mike, still no joy. I guess it is too complicated for me.

Do you have a very basic/simple example where I can define my stream from scratch and upload data using and Arduino Yun?

Post 5 IP   flag post
MikeMills private msg quote post Address this user
You can try deleting your existing component (right click on it and choose delete) and then let an Arduino feed arrive. That will create the component with default streams. Then edit the component and change the stream names.

I'm still not sure why the above failed. Maybe the detailed reconcile error would give a clue.

Creating a component and streams manually isn't that difficult:
1) Right click on a folder and choose new component
2) Give the component any name and set its ID to what you pass up in the Arduino API call
3) Right click on the streams folder, while editing the component, and add a Regular stream. Give it any name and the correct ID. Set's its Value type. Repeat for other streams.

That should be it.
Post 6 IP   flag post
MikeMills private msg quote post Address this user
Ensure that the value the device is passing up is compatible with the Stream Value Type. For example, it might be passing up "10.3 C" (as a string) and the stream has a value type of FLOAT. It won't be able to convert "10.3 C" to a float. It could convert "10.3". That could be why a reconcile is failing. Just a guess.
Post 7 IP   flag post
2935 7 7
Log in or sign up to compose a reply.