Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Hackers Week

Avatar for Fran Fran
March 15, 2016

Hackers Week

Avatar for Fran

Fran

March 15, 2016

More Decks by Fran

Other Decks in Technology

Transcript

  1. Hello, Spain Team! Fran Ríos Developer and Cloud Architect Ismael

    Martín Engineer Caye Rodríguez Engineer Lourdes Liró Engineer fcojriosbello loulirsal Htmael cayrodmed1
  2. First of all! BEFORE WE START Check that Node.js, NPM

    and github are installed on your computer SET UP EVERYTHING Execute the following command: npm install –g netbeast-cli More info on our documentation: http://docs.netbeast.co/chapters/get_started/get_started_from_your_laptop.html
  3. How? Netbeast connects devices from different technologies & brands Developers

    can create apps for Netbeast and upload them to our marketplace Different apps can provide different uses and values, you get to choose the ones that suit you! And allows to control your smart home through apps
  4. Netbeast's platform We stand at a differentiated position than other

    market players Marketplace OS Dashboard Router
  5. Javascript • Goal: to create interactive sites. • Shares many

    of the features of Java. • Interact with HTML and spice up websites with dynamic content.
  6. Node.js Server side platform built on Google Chrome’s JavaScript Engine

    Node.js = Runtime Environment + JavaScript Library 1) Asynchronous and event driven 2) Single threaded but highly scalable 3)No buffering
  7. REPL terminal (Read Eval Print Loop) Computer environment like a

    console in Unix/Linux . Just type: >node
  8. NPM Node Package Manager: install Node programs and manage/install dependencies.

    >npm install --global netbeast-cli #installing >npm install [email protected] #an specific version >npm info netbeast >npm ls #list installed packages
  9. Get on with it! We are going to build an

    example app and launch it to the space!
  10. Dashboard is alive Take a walk through dashboard Type: beast

    start and check localhost:8000 on your browser Open Source Dashboard source code is on github. You can also clone it directly: https://github.com/netbeast/dashboard Remember to install dependencies: npm install
  11. App template (I) Let’s build an app template To do

    so, type: beast new sampleApp *Don’t worry about if it doesn’t work. It’s a symlink to bin/cli.js . Use the following command instead: bin/cli.js new sample Result This process will create a base app called “sample” We’ll explain what’s inside a sample app now.
  12. App template (II) What’s inside? >cd sampleApp • server.js •

    express • minimist • package.json • dependencies • properties • public • front-end
  13. Packaging and launching Playing with the dashboard It’s necessary to

    compress your app before uploading it to the dashboard. You can do it with beast pkg ../sampleApp --to ../sampleApp.tar.gz and check localhost:8000 on your browser. After that we are ready to install it: beast install sampleApp.tar.gz
  14. Publish your app Remember that we are building the first

    marketplace on the iot environment. That’s the powerful key that allows the community to grow up in number of developers and devices supported.
  15. What's a plugin? It’s the key that allows you to

    interact with smart devices in your apps. It uses the Netbeast API. Using the netbeast-cli we can create a base plugin. Type: beast new samplePlugin –-plugin You will get the following structure: • package.json • src • index.js, resources.js, routes.js • index.js • test.js
  16. Virtual Bulb At this point we can interact with devices.

    We’ll do it with virtual ones. Install BULB-PLUGIN in the dashboard. Click Explore and Install the plugin. It will be notified when it’s done. You can check in the plugins section:
  17. Virtual Bulb Type the following commands if the previous steps

    didn’t work: wget https://github.com/netbeast/bulb-plugin/archive/master.zip unzip master.zip beast pkg bulb-plugin-master --to bulb-plugin-master.tar.gz beast install bulb-plugin-master.tar.gz Then access to the dashboard and execute the plugin on it. You’ll see a virtual bulb on your screen.
  18. Let's interact with it We’re going to develop two exercises

    with the virtual bulb. Open the dashboard and check that virtual bulb is running. Then clone this repo: https://github.com/netbeast/workshop.git
  19. Hands on! How can we interact with devices? beast('topic').set({ property:

    value }) We’ll do two exercises. level-1 and level2! You’ll need some tips like that one: What’s the topic, property and value? Topics: lights, music, switch power: true || false hue: 0..360 saturation: 0..100 brightness: 0..100 color:#FF13AA
  20. So far… Finished the development of most of our platform

    Increased headcount by 6 Made a successful hackathon and got first applications from third party developers We opened a second office in Seville, Spain! Joined AllSeen Alliance