B4J Tutorial [IoT] Welcome to the Internet of Things

Discussion in 'B4J Tutorials' started by Erel, Nov 23, 2015.

  1. Erel

    Erel Administrator Staff Member Licensed User

    This example demonstrates how the B4X tools can be used to create a solution with multiple types of components and communication channels.

    See the following video (make sure to watch it in HD resolution):



    The components in this example:
    - Intel Edison (B4J - jMRAA library)
    - Raspberry Pi (B4J - jPi4J library)
    - B4A app
    - B4i app
    - B4J desktop app
    - Browser

    All the applications, except of the web app that runs in the browser, use MQTT for the communication.
    A lightweight web server runs on the Intel Edison to support the browsers.

    The data is serialized with B4XSerializator (RandomAccessFile).

    The various apps monitor the hardware buttons and control the LEDs. Note that all the connected devices always show the updated state.

    The five projects are attached.
     

    Attached Files:

  2. LucaMs

    LucaMs Expert Licensed User

    What advantage have you had using MQTT instead of a web server (b4j)?
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    MQTT is simpler when you want to send a message to multiple clients. You don't even need to know which clients are connected.

    For example when you change the state of a LED all the connected devices update the UI switch to the new state.
     
  4. Rick Harris

    Rick Harris Well-Known Member Licensed User

    Nice development. Why is this done in B4J? You recently wrote that B4A is still your most important development language...
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    As I see it, this question is not important. There is no competition between B4A, B4i and B4J. They complete each other.

    It is also not true that it is done in B4J.
    The Android app is written with B4A, the iPhone app is written with B4i and the apps that run on the Linux boards and the desktops are written in B4J.
    The choice of the tool depends on the operating system.
    There is no good reason to avoid using B4i and especially B4J.

    This solution is a great example of the power of B4X tools combined. I'm not sure that there is any other tool that would have allowed you to create such a solution...

    BTW, I'm not sure what I wrote in the past, but B4A is exactly important as the other tools. Not more, not less.

    Please start a new thread if you like to further discuss the choice of tools.
     
    amaxco, Mark Turney, Jmu5667 and 2 others like this.
  6. Michael1968

    Michael1968 Member Licensed User

    Hello Erel,

    my Edison arrived today :)

    did the original OS running on your Edison??

    best regards
    Michael
     
    Erel likes this.
  7. Erel

    Erel Administrator Staff Member Licensed User

  8. suciwulans

    suciwulans Member Licensed User

    Erel what About browser? should i write PHP script for making UI switch button?
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    All the code is included. You don't need PHP.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice