enableiot / iotkit-samples

Demonstration code for the IoT Kit
Other
43 stars 36 forks source link

IoTkit Arduino Library Samples Out of Date #20

Closed AHoopyFrood closed 9 years ago

AHoopyFrood commented 9 years ago

The two example sketches included with the IoTkit library still have the incorrect sensor names in the send commands. The unzipped examples are corrected but these are not what the IDE pulls when you open the examples.

mtomczew commented 9 years ago

Hi

What do you mean by outdated sensor names? IoTkitRegisterExample and IoTkitSimpleExample have been recently updated to show additional functionalities of newest version of iotkit-agent. If you use older version, you can update using instructions in README.md

IoTkitRegisterExample shows you how to register sensor or actuator. IotKitSendMetricsExample how to send metrics. IoTKitActuationExample shows how to control built-in LED using IoTKit Cloud (requires registered component and using MQTT) IoTkitSimpleExample.ino shows both sending measurements and receiving actuations (requires already registered components defined in a comment in the beginning of a file. Additionaly, use MQTT if you need actuations).

Archieve file have old versions of these sketches and I wonder if I should delete that. Is this archieve automatically downloaded and used by IDE?

Different sketches have different requirements to run (e.g. components registered or protocol used). In updated sketched I used shorter sensor names without spaces because I don't think space character is good in id, path, etc.

AHoopyFrood commented 9 years ago

I'm sure I'm using the wrong terminology so bare with me. When you register on the IoT Dashboard your account comes with some pre-configured components (temperature, humidity, etc). When you install Libraries in the Arduino IDE it wants a .zip file. From what you said it sounds like that zip is an archive of a previous version which is causing the issue (the old versions use component names like "temperature sensor" which may or may not have an issue with a space but definitely don't connect to the components in the dashboard since the names don't match). I assume that the examples were written to connect with these components since none of the how-to documents cover creating new components. If that isn't the case it should be considered.

I would either remove the zip entirely, make the contents of the zip match the latest release, or put "Archive" or something in the name of the zip to denote it's status. Since the IDE wants a zip and the 'How to for Arduino' article tells you to use the .zip, having the most current versions exposed and zipped would be nice. As for updating, the only thing I see in the README.md is something about changing your IP in the library, which I haven't found to be necessary with registering components or sending data through arduino. The parent README doesn't seem to cover it either.

mtomczew commented 9 years ago

I think you can download all repository content from github as zip. I would rather remove binary file from repository but if article specify this file exists there it should stay there longer but be updated.

Most of examples show how to perform single action and they have some requirements for start.

I found one issue with outdated comment in simple example - temp & temperature. Was that one of the problems?

When talking about agent update I meant README.md in iotkit-agent repository: https://github.com/enableiot/iotkit-agent or npm: https://www.npmjs.com/package/iotkit-agent

We have a few public repositories:

  1. https://github.com/enableiot/iotkit-agent with an application which helps sending measurements and allow receiving actuations back to device
  2. https://github.com/enableiot/iotkit-samples with samples of API usage in a few different programming languages
  3. https://github.com/enableiot/iotkit-api/wiki/Api-Home with API documentation

To explain some terminology: Component type you specify during component registration is temperature.v1.0, humidity.v1.0 or powerswitch.v1.0. Component name is a name of your choice. Component can be a sensor or actuator depending on its type. When sending measurements you specify component name and value of measurement.

Do you think IoTKitRegisterExample should register all components required in other sketches or just show how to register your example component?

bbaltz505 commented 9 years ago

Hi. The IoTkit.zip has been updated in GitHub so that should fix these issues with the sample code. The setup instructions (activating device, registering components, etc.) are listed in the comments of the latest samples (IoTkitSimpleExample, anyway). I agree, we should should update the README to either list the pre-work or refer to the information in the sample code comments.

Please let us know if you still have any issues.