Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Let's take a look at the tasks that Chris (the IoT team administrator) and Alex (the device owner) have to do, from downloading WSO2 IoT Server to registering the Android device.

...

Tip
titleBefore you begin
  1. WSO2 IoT Server supports devices on Android version 4.2.x to 7.0 (Android Jelly Beans to Nougat).
  2. Install Oracle Java SE Development Kit (JDK) version 1.8.* and set the JAVA_HOME environment variable. For more information on setting up JAVA_HOME on your OS, see Installing the Product.
  3. Download WSO2 IoT Server and unzip the file.

  4. Start WSO2 IoT Server by starting the two profiles in the following order:

    Start the

    's core profile, which corresponds to device management, device plugins, transports, APIs, and authentication and authorization components of WSO2 IoT Server.

    Code Block
    cd <IOTS_HOME>/bin
    ./iot-server.sh --> for Linux/MAC/Solaris
    iot-server.bat --> for Windows

    The default port assigned for the core is 9443.

  5. Start the analytics profile, which corresponds to the WSO2 Data Analytics Server profile.

    Code Block
    cd <IOTS_HOME>/analytics/bin
    ./analytics.sh --> for Linux/MAC/Solaris
    analytics.bat --> for Windows

    The default port assigned for analytics is 9445.

  6. Access the WSO2 device management console by navigating to https://<IoT_HOST>:9443/devicemgt. Use admin as the username and the password. You will see the Admin role and the Admin user.

    Note

    Have you run the sample script previously when trying out the iOS quick start guide? If so, delete the two users Alex and Chris, the role iotMobileUser, and the sample policies that were created for Android, iOS, and Windows.

Let's get started!

Creating users and a sample policy

Follow the steps given below to create the two users Alex and Chris, and a configured passcode policy. This is done so that it will be easy for you to try out the quick start guide.

Navigate to the <IOTS_HOME>/samples/mobile-qsg directory and start the mobile-qsg script.

Code Block
cd <IOTS_HOME>/samples/mobile-qsg
./mobile-qsg.sh --> for Linux/MAC/Solaris 
java -jar mobile-qsg.jar --> for Windows

...

If you haven't configured WSO2 IoT Server for iOS, the iOS sample policy will not be created. Therefore, you will get the message given below. This will not restrict you from trying out the Android quick start guide.

...

  1. Access the WSO2 device management console by navigating to https://<IoT_HOST>:9443/devicemgt. Use admin as the username and the password. You will see the Admin role and the Admin user.

    Note

    Have you run the sample script previously when trying out the iOS quick start guide? If so, delete the two users Alex and Chris, the role iotMobileUser, and the sample policies that were created for Android, iOS, and Windows.

Let's get started!

Creating users and a sample policy

Follow the steps given below to create the two users Alex and Chris, and a configured passcode policy. This is done so that it will be easy for you to try out the quick start guide.

  1. Navigate to the <IOTS_HOME>/samples/mobile-qsg directory and start the mobile-qsg script.

    Code Block
    cd <IOTS_HOME>/samples/mobile-qsg
    ./mobile-qsg.sh --> for Linux/MAC/Solaris 
    java -jar mobile-qsg.jar --> for Windows
    Note

    When you add a new user to WSO2 IoT Server, the user receives an email with the username and password that needs to be used to log in to WSO2 IoT Server. In this quick start guide, we have not configured WSO2 IoT Server to send emails. Therefore you will get an error in the terminal where the core profile is running. If you don't want to see this error, you need to configure the email settings. For more information, see Configuring the Email Settings.

    Expand
    titleClick here to see the error you get.
    Code Block
    [2017-07-27 02:47:14,527] [IoT-Core] ERROR - {org.apache.axis2.description.ClientUtils} The system cannot infer the transport information from the mailto:chris@mobx.com URL.
    [2017-07-27 02:47:14,527] [IoT-Core] ERROR - {org.apache.axis2.description.ClientUtils} The system cannot infer the transport information from the mailto:alex@example.com URL.
    [2017-07-27 02:47:14,531] [IoT-Core] ERROR - {org.wso2.carbon.email.sender.core.service.EmailSenderServiceImpl} Error occurred while delivering the message, subject: 'You have successfully been registered in WSO2 IoT', to: 'chris@mobx.com'
    org.apache.axis2.AxisFault: The system cannot infer the transport information from the mailto:chris@mobx.com URL.
    	at org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:81)
    	at org.apache.axis2.client.OperationClient.prepareMessageContext(OperationClient.java:288)
    	at org.apache.axis2.description.OutOnlyAxisOperationClient.executeImpl(OutOnlyAxisOperation.java:249)
    	at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
    	at org.apache.axis2.client.ServiceClient.fireAndForget(ServiceClient.java:511)
    	at org.apache.axis2.client.ServiceClient.fireAndForget(ServiceClient.java:488)
    	at org.wso2.carbon.email.sender.core.service.EmailSenderServiceImpl$EmailSender.run(EmailSenderServiceImpl.java:117)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at java.lang.Thread.run(Thread.java:748)
    [2017-07-27 02:47:14,531] [IoT-Core] ERROR - {org.wso2.carbon.email.sender.core.service.EmailSenderServiceImpl} Error occurred while delivering the message, subject: 'You have successfully been registered in WSO2 IoT', to: 'alex@example.com'
    org.apache.axis2.AxisFault: The system cannot infer the transport information from the mailto:alex@example.com URL.
    	at org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:81)
    	at org.apache.axis2.client.OperationClient.prepareMessageContext(OperationClient.java:288)
    	at org.apache.axis2.description.OutOnlyAxisOperationClient.executeImpl(OutOnlyAxisOperation.java:249)
    	at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
    	at org.apache.axis2.client.ServiceClient.fireAndForget(ServiceClient.java:511)
    	at org.apache.axis2.client.ServiceClient.fireAndForget(ServiceClient.java:488)
    	at org.wso2.carbon.email.sender.core.service.EmailSenderServiceImpl$EmailSender.run(EmailSenderServiceImpl.java:117)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at java.lang.Thread.run(Thread.java:748)
Info

Check out the WSO2 IoT Server dashboard by signing in to the WSO2 IoT Server console using chris as the username and chrisadmin as the password: https://<IoT_HOST>:9443/devicemgt.  
You will then see the new iotMobileUser role, 3 new policies (only 2 policies will be created if you have not configured WSO2 IoT Server for iOS), and 2 new users that were added using these scripts.

...