Code Monkey home page Code Monkey logo

device-arduino's Introduction

Arduino Uno/Yun Samples

This repository contains samples for connecting Arduino Uno/Yun devices to the IBM Watson IoT Platform

The events that are emitted in this sample are:

  • Internal sensor temperature

Pre-requisite setup for the 2 flows

Arduino Uno

  1. Connect Ethernet / Wifi shield to Arduino Uno

  2. Connect Ethernet cable to the Ethernet / Wifi shield

  3. Install sketch on desktop / laptop

  4. Download Paho mqtt library, for Ardunio, from this link (https://projects.eclipse.org/projects/technology.paho/downloads) in the sketch
    a) To load it into the Arduino IDE, the zip file should be downloaded intact, without unzipping.
    b) Then in the IDE: Select Sketch -> Import Library -> Add Library and select the zip file

  5. Connect the USB cable to the Arduino Uno and other end to desktop / laptop which has the sketch installed on it

  6. The samples folder of this repository (https://github.com/ibm-messaging/iot-arduino) contains 2 folders, each containining 1 flow - a) Quickstart flow b) Registered flow

  7. Compile the 2 skectch codes (corresponding to the flows)

  8. Depending upon the requirement, push one of the flows to the Arduino device

  9. Reset the Ethernet / Wifi shield

  10. Wait for about 10 seconds and the flow starts working

Arduino Yun

  1. Configure Arduino Yun to connect to your WiFi Network
  2. Follow steps-3,4,5,6 from Arduino Uno
  3. Pick the sketch names - quickstart_yun.ino (https://github.com/ibm-watson-iot/device-arduino/blob/master/samples/quickstart/quickstart_yun.ino) / registered_yun.ino (https://github.com/ibm-watson-iot/device-arduino/blob/master/samples/registered/registered_yun.ino) for Arduino Yun
  4. Continue following steps-7 to 10 from Arduino Uno

Quickstart flow

  1. Modify the clientId, in the sketch code, by providing the values in the following format "d:quickstart:iotsample-arduino:aabbccde02", by replacing "aabbccde02" with the MAC Address of the device
  2. Open the quickstart dashboard (http://quickstart.internetofthings.ibmcloud.com/#/)
  3. Provide the MAC Address (in case of the example, its aabbccde02) in the textbox "Ready to View data?"

Registered Flow

This has 2 flows

  1. Registered Flow from device
  2. Registered Flow to device

Registered Flow from device and to device

  1. Modify the AUTHTOKEN in the sketch code
  2. Modify the MS_PROXY, in the sketch code, by providing the values in the following format "uguhsp.messaging.internetofthings.ibmcloud.com", by replacing "uguhsp" with your organization
  3. Modify the CLIENT_ID, in the sketch code, by providing the values in the following format "d:uguhsp:iotsample-arduino:00aabbccde03", by replacing "aabbccde03" with the Device Id and "uguhsp" with the organization and "iotsample-arduino" with the device type that you entered when creating the device.
  4. Use mqttpublisher / mqttsubscriber to publish and subscribe the commands / events sent to / received from the Arduino Uno
  5. Modify the mac Address (given in the sample as { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x03 } ) by the MAC Address of the Ethernet shield. This applies only for Arduino Uno, no change required in Arduino Yun sketch.

Development

device-arduino's People

Contributors

amitmangalvedkar avatar antelder avatar benbakowski avatar clydei avatar jospaul1 avatar sathipal avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.