Phpoc P5h-151 Iot Gateway Device User Manual

Phpoc P5h-151 Iot Gateway Device User Manual

PHPoC-logo

PHPoC P5H-151 IoT Gateway Device

PHPoC P5H-152 Programmable IoT Gateway Device-FIG1

Overview

  • The P5H-152 is a programmable device that provides Ethernet function. Because this product equipped a serial port which can be selected to RS485 or RS422, you can connect a variety of serial devices to a network.
  • Programming on this product requires the use of PHPoC (PHP on Chip). PHPoC is quite similar in syntax to PHP, the general-purpose scripting language. Therefore, anyone with experience in programming can easily learn and use it.
  • Although PHPoC and PHP are quite similar in syntax, they are clearly different programming languages. Refer to the PHPoC Language Reference and PHPoC vs PHP for detailed information.

Features

  • self-developed PHPoC interpreter
  • simple development environment via USB
  • 10/100Mbps Ethernet
  • a serial port which can be selected to RS485 or RS422 6 user-defined LEDs
  • self-developed TCP/IP stacks
  • Web Server
  • WebSocket, TLS
  • various libraries (Email, DNS, MySQL and Etc.)
  • dedicated development tool (PHPoC Debugger)

H/W Specification

PowerInput PowerDC Jack, 5V (±0.5V)
Current Consumptiontypical – approximately 273mA
Dimension89mm x 57mm x 24mm
Weightapproximately 69g
 

Interface

Serial PortD-SUB 9-pin Male Connector,
an RS232 port
Network10/100Mbps Ethernet
USBUSB Device Port – for PC connection
LED9 LEDs (System: 4, User-defined: 6)
Temperature (storage/operating)-40℃ ~ 85℃
EnvironmentRoHS Compliant

Layout

PHPoC P5H-152 Programmable IoT Gateway Device-fig2

Supplying Power

DC 5V Input
This port is the input port for supplying power. The input voltage is DC 5V(±0.5V) and the specification is as follows:

PHPoC P5H-152 Programmable IoT Gateway Device-fig3

Ethernet

Ethernet port supports 10/100Mbps Ethernet. This port is an RJ45 connector and it is mapped to NET0 for programming.

PHPoC P5H-152 Programmable IoT Gateway Device-fig4

Serial Port

PHPoC P5H-151 IoT Gateway Device-fig2

 

The type of serial port of P5H-152 can be selected to either RS485 or RS422. This port is a 6-pole terminal block and is mapped to UART0 for programming.
Setting flow control is required to use RS485 on UART0. For more details, please refer to the PHPoC Device Programming Guide for p40 document.

NumLableDescriptionLevelI/OWiring
1TR+Data +RS485In/OutRequired
2TR-Data –RS485In/OutRequired
3GNDGroundGroundRequired(3 or 6)
6GNDGroundGroundRequired(3 or 6)

pin assignment of RS422

NumLableDescriptionLevelI/OWiring
1TX+Transmit Data +RS422OutRequired
2TX-Transmit Data –RS422OutRequired
3GNDGroundGroundRequired(3 or 6)
4RX+Receive Data +RS422InRequired
5RX-Receive Data –RS422InRequired
6GNDGroundGroundRequired(3 or 6)
LED

This product has 10 LEDs. The user-defined LEDs are turned on when you output LOW to the UIO pin connected.

LableColorDescriptionUIO pin
PWRRedSystem LED – supplying powerN/A
STSYellowSystem LED – system statusN/A
L0GreenUser-defined LEDUIO1.8
L1GreenUser-defined LEDUIO1.7
L2GreenUser-defined LEDUIO1.6
A0GreenUser-defined LEDUIO1.9
A1GreenUser-defined LEDUIO0.30
BGreenUser-defined LEDUIO0.31
RJ45_GGreenSystem LED – system statusN/A
RJ45_YYellowSystem LED – network link statusN/A
Function Button

The function button, which is inside the hole of the side panel, is used to operate this product as a button setup mode.

USB Device Port for connection with PC

The USB device port is to connect with PC. You can access to P5H-152 via development tool by connecting USB cable to this port.

Software (IDE)

PHPoC Debugger
PHPoC Debugger is a software used for developing and setting PHPoC products. You need to install this program on your PC for using PHPoC.

  • PHPoC Debugger Download Page
  • PHPoC Debugger Manual

Functions and Features of PHPoC Debugger

  • Upload files from local PC to PHPoC
  • Download files in PHPoC to local PC
  • Edit files stored in PHPoC
  • Debug PHPoC scripts
  • Monitor resources of PHPoC
  • Configure parameters of PHPoC
  • Upgrade Firmware of PHPoC
  • Support MS Windows O/S

Connecting Product

USB Connection

  1. Connect the USB device port of P5H-152 to your PC via a USB cable.
  2. Run PHPoC Debugger
  3. Select connected COM PORT and press connect PHPoC P5H-152 Programmable IoT Gateway Device-fig6) button.
  4. If USB is successfully connected, connect button will be inactivated and disconnect button PHPoC P5H-152 Programmable IoT Gateway Device-fig7) will be activated

Remote Connection
P5H-152 provides the remote connection. Please refer to the PHPoC Debugger manual page for details.

Reset

Settings Reset
Settings Reset makes all settings of your PHPoC products to factory default.

Settings Reset Procedure

StepActionProduct StateSTS LED
1Press function button shortly (less than 1

second)

Button setup modeOn
2Keep pressing the function button over 5

seconds

Preparing initializationBlink very

rapidly

3Check if the STS LED is turned OFFInitialization readyOff
 

4

Release the function button right after the STS is OFF.(※ If you don’t release the button within 2 seconds, the state go back

to the step 3)

 

Progressing initialization

 

On

5Rebooting automaticallyInitial stateOff

Factory Reset
Factory Reset makes all settings of your PHPoC products to factory default including a password. Futhermore, all files stored in flash memory are deleted as well as certificate. Because of this, you have to backup your files before doing Factory Reset. To progresss the Factory Reset, the PHPoC Debugger is required.

Factory Reset Procedure

Web Interface

PHPoC itself has a webserver to provide a web interface. When receiving a HTTP request, it executes the php script in the requested file (if there) and respond to the client. Webserver is independent of PHPoC main script. TCP 80 is used for web server and you can use the interface via Internet Explorer, Chrome or any other web browsers.

How to use web interface
To use the web interface, “index.php” file should be in the file system of your PHPoC. Connect to this page by entering device IP address after connecting it to network.

PHPoC P5H-152 Programmable IoT Gateway Device-fig8

If the name of file is not “index.php”, just specify the name of file after the IP address with slash mark.

PHPoC P5H-152 Programmable IoT Gateway Device-fig9

Practical Use of Web Interface
Since the web server executes the php script in the requested file, user can put php code in the in the requested file to interact with peripherals. It is worth noting that there is other way to interact with the peripherals in real-time from web interface. This can be done by using websocket.

Setting Passwords

If you set a password for the product, you must enter the password when connecting the product via USB or network.
Please refer to the PHPoC Debugger manual page for details.

Escaping Infinite Reset

PHPoC basically runs scripts when it boots up. Therefore, it is possible that a PHPoC cannot be escaped from infinite reboot when script contains system command such as “reboot”. To solve this problem, it is required to stop the running script.
Refer to the following.

  1. Entering ISP mode
    Make your PHPoC product to enter ISP mode by supplying power while pressing FUNC button. In the ISP mode, you can access to PHPoC by PHPoC Debugger without running a script.
  2. Connect to PHPoC
    Connect a PC to PHPoC via a USB cable and connect to the port via PHPoC Debugger. A message window related with ISP mode will be popped up.
  3. Reboot PHPoC
    Reboot PHPoC by using “Reboot a product” menu in PHPoC Debugger. After rebooting, PHPoC stops running script even it is not in the ISP mode.
  4. Correct source code
    Correct the source code to prevent infinite reboot state.

Device Information

DeviceQuantityPathNote
NET1/mmap/net0
TCP5/mmap/tcp0~4
UDP5/mmap/udp0~4
UART1/mmap/uart0
UIO2/mmap/uio0~1LED 6(pin #0.30~31, #1.6~9), TXDE(#0.8)
ST8/mmap/st0~7
UM4/mmap/um0~3
NM1/mmap/nm0
RTC1/mmap/rtc0

Refer to the PHPoC Device Programming Guide for p40 for detailed information about using devices.

Documents / Resources

PHPoC P5H-151 IoT Gateway Device [pdf] User Manual
P5H-151, IoT Gateway Device, P5H-151 IoT Gateway Device, Gateway Device, Gateway

Documents / Resouces

Download manual
Here you can download full pdf version of manual, it may contain additional safety instructions, warranty information, FCC rules, etc.


Related Manuals