Announcement

Collapse
No announcement yet.

Tutorials

Collapse
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 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 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.

  • 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.

  • 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.

  • 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.
There are no articles in this category.
 
  • Filter
  • Time
  • Show
Clear All
new posts
Please log in to your account to view your subscribed posts.

Latest Articles

Collapse

  • Arduino - RS-485 Expansion Board
    by support
    PES-2607 is an easy-to-use RS422/RS485 Expansion Board for Arduino Uno and Mega, which allows Arduino to exchange data with serial device via RS422 or RS485.
    Especially, Arduino does NOT use UART pins to communicate with RS422/RS485 expansion board. Therefore, users can use Arduino UART pins for other purposes.
    Moreover, A single Arduino Uno/Mega can communicate with multiple RS422/RS485 expansion boards (up to 14) without using Arduino UART pins.

    Library and examples for...
    11-13-2018, 02:45 PM
  • Arduino - RS-422 Expansion Board
    by support
    PES-2607 is an easy-to-use RS422/RS485 Expansion Board for Arduino Uno and Mega, which allows Arduino to exchange data with serial device via RS422 or RS485.
    Especially, Arduino does NOT use UART pins to communicate with RS422/RS485 expansion board. Therefore, users can use Arduino UART pins for other purposes.
    Moreover, A single Arduino Uno/Mega can communicate with multiple RS422/RS485 expansion boards (up to 14) without using Arduino UART pins.

    Library and examples for...
    11-13-2018, 02:44 PM
  • Arduino - RS-232 Expansion Board
    by support
    PES-2606 is an easy-to-use RS-232 Expansion Board for Arduino Uno and Mega, which allows Arduino to exchange data with serial device via RS-232.
    Especially, Arduino does NOT use UART pins to communicate with RS-232 expansion board. Therefore, users can use Arduino UART pins for other purposes.
    Moreover, A single Arduino Uno/Mega can communicate with multiple RS-232 expansion boards (up to 14) without using Arduino UART pins.

    Library and example for the RS-232 expansion board...
    11-13-2018, 02:43 PM
  • Arduino - Stepper Motor Controller
    by support
    PES-2605 is an easy-to-use stepper motor controller for Arduino Uno and Mega, which uses micro-stepping method to precisely control stepper motor.
    Library and example for the stepper motor controller are part of of PhpocExpansion library for Arduino. The library reference is available here.

    This tutorial shows how to use the step motor controller with an example of PhpocExpansion library for Arduino.


    Hardware Required...
    11-13-2018, 02:41 PM
  • Arduino - DC Motor Controller
    by support
    PES-2604 is an easy-to-use DC motor controller for Arduino Uno and Mega.
    Library and example for the DC motor controller are part of of PhpocExpansion library for Arduino. The library reference is available here.

    This tutorial shows how to use the DC motor controller with an example of PhpocExpansion library for Arduino.


    Hardware Required...
    11-13-2018, 02:40 PM
  • Arduino - Digital Input Board
    by support
    PES-2602 is an easy-to-use 4-port Input Expansion Board for Arduino Uno and Mega, which allows Arduino to monitor state of DC electric device. In addition, it can monitor NPN, PNP and dry contact(relay).
    Library and example for the 4-port input expansion board are part of of PhpocExpansion library for Arduino. The library reference is available here.

    This tutorial shows how to use 4-port input expansion board with an example of PhpocExpansion library for Arduino.

    ...
    11-13-2018, 02:39 PM
Working...
X