ito - samples

Download sample codes

Instructions

  1. Download any of ZIP archive files from above and unpack it. These ZIP files include ito library itself.
  2. Create a new config.json file according to your environment. Two templates, config-template-firebase.json and config-template-kii.json, are available in the same directory.
    • If you wish to use ito with Kii Cloud, please download Kii Cloud SDK for HTML5 from Kii Developer Portal and copy KiiSDK.min.js under the same directory.
  3. Upload or deploy the sample app to your web server.
  4. Run device.html on your IoT device, e.g. any smartphone with camera (for the "Simple remote camera" sample app), a CHIRIMEN board (for the "LED blinking with CHIRIMEN" sample app).
    • In case of CHIRIMEN, please load the web app on the Browser app. If you wish to launch the web app via WebIDE console, please type codes like the following:
      new MozActivity({ name: 'view', data: { type: 'url', url: '(URL of the web app)'}});
  5. Run index.html on your smartphone or tablet. Note: The "Simple remote camera" sample app requires WebRTC compatibility at both IoT device and web browser.

Simple remote camera

  1. When an IoT device launches a web app for devices (i.e. device.html), its screen will show a QR code representing a controller URL.
  2. When you open the URL read from the QR code by your smartphone, your browser will launch the controller web app (i.e. index.html), the device and the smartphone's web app will automatically establish pairing between them.
  3. As soon as they are paired, the device will start transmitting a video stream captured from its camera, which will be displayed on the web app running on the smartphone.
  4. When you click or tap a "revoke" button, the pairing will be discarded.

LED blinking with CHIRIMEN

  1. When a CHIRIMEN board launches a web app for devices (i.e. device.html), it will start waiting for pairing request with a passcode.
    • The default value of the passcode is chirimen, which is defined as passcode in device.js.
  2. When you open a web app for smartphones (i.e. index.html) and input CHIRIMEN's passcode on the web app, pairing between the board and the smartphone will be established, and the web app will show controller UIs.
  3. After the pairing establishment, a LED light on the CHIRIMEN board will be turned on/off or blink when you click (tap) controller UIs on the web app.
  4. When you click or tap a "revoke" button, the pairing will be discarded.

Resources for development

For further information about web app implementation and hardware prototyping using CHIRIMEN, please refer to CHIRIMEN repositories on GitHub.