MoteBus HelloWorld


ENVIRONMENT

Node.js

  • Step A

    • Install Node.js

      https://nodejs.org/en/

      Download and install under C:\nodejs

    • Installation testing

      Open <Cmd> and test if the installation was successful

      node -v  // shows the version of node
      
  • Step B

    • Open <Cmd> and specify the path to the Node.js summary

    • Create a folder under C:\nodejs ; name it “project”
      mkdir C:\nodejs\project

    • cd C:\nodejs\project

      npm init //initialize node package manager
      

      Press “enter” until finished with all the arguments

      npm install motebus --save //install MoteBus
      npm install express --save //install express
      
  • Step C

    • Install MoteBus SDK

      • MoteBusHelloWorld Download link

        http://www.ypcloud.com/download/motebushelloworld.zip

      • Unzip to extract the HelloWorld folder and copy to C: \nodejs\project

      • Run C:\nodejs_project\HelloWorld\bin\MoteBus_win32.exe as an Administrator, ensuring that TCP port 6788 is open in the system's firewall

    • Run HelloWorld.js

      cd C:\nodejs\project\HelloWorld

      node index.js  //runs index.js
      
  • Step D

    • Local Host test
      cd C:\nodejs\project\HelloWorld\test\

      node MoteTest.js
      

      MoteTest.js is a test program for testing the Motebus connector which will return the test results for Add(), Echo() & Time() functions

    • Client Server test

      • Use a code editor to open _MoteTest.js and modify the third statement of the js file

      • Find & Replace '127.0.0.1' with '192.168.10.185'

results matching ""

    No results matching ""