MQTT Library For PHPoC p20 (Support SSL)

MQTT Library For PHPoC p20 (Support SSL)

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

Introduction

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.

Website http://mqtt.org/
Wiki: https://en.wikipedia.org/wiki/MQTT

Features

  - Support MQTT over TLS/SSL
  - Support MQTT Version 3.1 and 3.1.1
  - Document Reference:
    + MQTT Version 3.1: http://public.dhe.ibm.com/software/dw/w ... -v3r1.html
    + MQTT Version 3.1.1: http://docs.oasis-open.org/mqtt/mqtt/v3 ... 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
    + iot.eclipse.org
    + broker.hivemq.com
    + test.mosquitto.org
    + broker.mqttdashboard.com
    + m11.cloudmqtt.com
    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: http://public.dhe.ibm.com/software/dw/w ... 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:
MQTT_support_SSL_p20.zip
(16.5 KiB) Downloaded 54 times


Note that: To use SSL, you need to increase buffer of PHPoC by create phpoc.ini file in root directory
<phpoc.ini>
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
Khanh
 
Posts: 72
Joined: Fri Mar 11, 2016 10:57 am

Return to Project

Who is online

Users browsing this forum: No registered users and 1 guest