Announcement

Collapse
No announcement yet.

Search Result

Collapse
11 results in 0.0069 seconds.
Keywords
Members
Tags
phpoc-basic x
  •  

  • How Web Server on PHPoC Works

    How Web Server on PHPoC Works

    PHPoC devices have an embedded web server. It enables to control, monitor or do setting via web browser.

    Now, Let's see how it works.

    After developing source code files and upload it to PHPoC devices, you can access it via web browser.

    When you types IP address of PHPoC on web browser, web browser actually makes an HTTP request to PHPoC device.

    When receiving HTTP request from web browser, Web server does:
    • Get the requested file name on PHPoC
    ...
    Go to post
    Last edited by support; 02-07-2018, 05:56 PM.

  • How to Monitor Sensors/Devices via WebSocket

    How to Monitor Sensors/Devices via WebSocket

    Advantage of Monitoring via WebSocket
    • Useful to monitor states of sensors/devices in a long period of time without reloading webpage.
    • Data can be sent by server in real-time
    • Reduce network latency and overhead.

    How to Monitor via WebSocket

    This kind of method requires two kind of code:
    • Code run in system loop :
      • Acts as WebSocket server,
      • Reads state from sensors/devices,
      • Send it to WebSoket Client via Websocket.
    • Web App code: this code contains:
      • HTML and CSS code
    ...
    Go to post
    Last edited by support; 02-09-2018, 09:09 AM.

  • How to Monitor Sensors/Devices via HTTP Request

    How to Monitor Sensors/Devices via HTTP Request

    Advantage of Monitoring via HTTP Request
    • Simple to create
    • Useful to check states of sensors/devices

    How to Monitor via HTTP Request

    This kind of method does NOT require any code run in system loop. It just needs to:
    • Create a PHP file (For example, my_file.php).
    • Write the code.
    • Upload it to PHPoC devices.
    • Access webpage via Web Browser on your PC or smart phone (See How To).

    Source code will includes:
    • PHPoC code: Required. This code read state/value from sensors/devices
    ...
    Go to post
    Last edited by support; 02-08-2018, 05:28 PM.

  • How to Monitor Sensors/Devices via Web Browser

    How to Monitor Sensors/Devices via Web Browser

    There are two methods to monitor sensors/devices via Web Browser. Each method has its own advantages

    Monitor via HTTP Request
    • Simple to create
    • Useful to check states of sensors/devices

    Monitor via WebSocket
    • Useful to monitor states of sensors/devices in a long period of time without reloading webpage
    Go to post
    Last edited by support; 02-09-2018, 10:06 AM.

  • How to Control Devices via WebSocket

    How to Control Devices via WebSocket

    Advantage of controlling sensors/devices via WebSocket
    • Convenient to create Graphic User Interface
    • Useful to control continuous states of devices (e.g. turn on/off LED)

    How to control sensors/devices via WebSocket

    This kind of method requires two kind of code:
    • Web App code: this code contains:
      • HTML and CSS code to form webpage,
      • JavaScript code, which is run on Web browser:
        • Acts WebSocket Client,
        • Handles action from user.
        • Sends the controlling command/value to PHPoC
    ...
    Go to post
    Last edited by support; 02-09-2018, 09:48 AM.

  • How to Control Devices via HTTP Request

    How to Control Devices via HTTP Request

    Advantage of controlling sensors/devices via HTTP request (POST or GET)
    • Simple to create
    • Useful to control discrete states of devices (e.g. turn on/off LED)

    How to control sensors/devices via HTTP POST or GET

    This kind of method does NOT require any code run in system loop.

    For the sake of simplicity, In this tutorial present only HTTP GET.
    There are some way to make HTTP GET from webpage. A simple way is hyperlink. Hyperlink can be embedded in text or image...
    Go to post
    Last edited by support; 02-08-2018, 05:23 PM.

  • How to Control Devices via Web Browser

    How to Control Devices via Web Browser

    To control sensors/devices via Web Browser, we have to send the control value from Web Browser to sensor/devices.

    There are two kinds of methods to directly send data from Web Browser to sensors/devices: via HTTP request and via WebSocket. Therefore, there are two methods to directly control devices via Web Browser. Each method has its own advantages

    Control via HTTP Request
    • Simple to create
    • Useful to control discrete states of devices (e.g. turn on/off LED)

    Control...
    Go to post
    Last edited by support; 02-09-2018, 09:51 AM.

  • How to Create Embedded Web Apps with WebSocket on PHPoC

    How to Create Embedded Web Apps with WebSocket on PHPoC

    As mentioned in WebSocket, WebSocket includes two parts: server side and client side. To exchanging data via WebSocket, it needs to create WebSocket connection first.
    The connection is maintained unless it is actively closed or there is a network error.

    Creating WebSocket Connection

    Server Side

    Server side code is PHPoC code, and it is run in system loop.
    PHP Code:
    <?php
    include "/lib/sn_tcp_ws.php";

    ws_setup(0"path_name",
    ...
    Go to post
    Last edited by support; 02-08-2018, 05:21 PM.

  • WebSocket

    WebSocket

    Introduction to WebSocket

    The WebSocket is one of the new features of HTML5. It is used to bi-directional exchange data between client (e.g Web browser) and server without reloading webpage. The WebSocket reduces polling and the network throughput overhead.

    In a simple words, to exchange data between web client and server,
    • Without WebSocket, we need to reload all or part of web page.
    • Without WebSocket, If data is available on server, server has to wait until client
    ...
    Go to post
    Last edited by support; 02-08-2018, 05:19 PM.

  • PHPoC System Files

    PHPoC System Files

    To create an PHPoC-powered IoT devices, It needs to write PHPoC Script files and upload it to PHPoC hardware via PHPoC Debugger (PHPoC IDE). To do so, it need to know directory structure of PHPoC and what kind of files can be uploaded to PHPoC devices.

    Directory structure On PHPoC Devices



    We can access this directory and files via PHPoC Debugger. It looks like below:

    ...
    Go to post
    Last edited by support; 02-09-2018, 09:56 AM.

  • How PHPoC System Works

    How PHPoC System Works

    This post are going to answer to the following questions:
    • How PHPoC system run PHPoC files
    • Which file is mandatory in PHPoC system?
    • Which PHP file is run locally in PHPoC system loop
    • Which PHP files is run in response to HTTP request from outside?
    • How to force a PHP file to run in system loop?
    • How to make PHP file not run in response to HTTP request

    To create IoT devices with PHPoC, we write PHPoC script files and upload them to PHPoC devices. We can upload many files to PHPoC....
    Go to post
    Last edited by support; 02-08-2018, 03:39 PM.
Working...
X