MQTT Library For PHPoC p20 (Support SSL)

MQTT Library For PHPoC p20 (Support SSL)

Postby Khanh » Mon Feb 06, 2017 2:39 pm


MQTT is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport. It is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium.



  - Support MQTT over TLS/SSL
  - Support MQTT Version 3.1 and 3.1.1
  - Document Reference:
    + MQTT Version 3.1: ... -v3r1.html
    + MQTT Version 3.1.1: ... 3.1.1.html
  - History:
    + 2016-09-01: Support MQTT Version 3.1 and 3.1.1
  - Testing succesufully with:
    + Mosquitto Broker installed in my computer
    In case clean session is set to false, it does work well with some servers due to sever send a lot of packet continously, PHPoC has the limit of embedded system.
    Clean session false is not recommended to use.
  - QoS Level: 0, 1, 2.
  - Note:    
    + Message delivery retry: ... html#retry
      * This is optional, default is disable. User can enable it by using mqtt_setup() function.
      * If retry option is anable, the max time of retry is 10. User can change this value by changing MQTT_RESEND_MAX_NUM.
      Note: Resend process is performed in a blocking loop, be careful when use this option.

Sources Code

You can get library and examples here:
(16.5 KiB) Downloaded 84 times

Note that: To use SSL, you need to increase buffer of PHPoC by create phpoc.ini file in root directory
Code: Select all
tcp0_txbuf_size = 4096 ; SSL/TCP send buffer
tcp0_rxbuf_size = 4096 ; SSL/TCP send buffer
ssl0_rxbuf_size = 4096

Let us know if you have any comments or concerns
Posts: 73
Joined: Fri Mar 11, 2016 10:57 am

Return to Project

Who is online

Users browsing this forum: No registered users and 1 guest