Sollae Systems P4M-440G User Manual

Sollae Systems P4M-440G User Manual

Mqtt client module
Hide thumbs Also See for P4M-440G:

Advertisement

Quick Links

P4M-440G MQTT User Manual > Introduction
Introduction
P4M-440G is an MQTT client module. This module accepts AT commands via the UART port,
providing various features for MQTT communication. As a result, users can implement MQTT
functionality on their MCU (Microcontroller) or microcomputer using this module.
2023-10-04
Sollae Systems
page 1 of 39

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the P4M-440G and is the answer not in the manual?

Questions and answers

Summary of Contents for Sollae Systems P4M-440G

  • Page 1 P4M-440G MQTT User Manual > Introduction Introduction P4M-440G is an MQTT client module. This module accepts AT commands via the UART port, providing various features for MQTT communication. As a result, users can implement MQTT functionality on their MCU (Microcontroller) or microcomputer using this module.
  • Page 2 P4M-440G MQTT User Manual > Introduction > Features Features Equipped with MQTT client functionality Supports simple control through AT commands 1 x 10/100Mbit Ethernet port 1 x UART port (default 19200 bps) Supports TLS v1.2 Provides storage capability for Root CA and client certificates...
  • Page 3: Hardware Specifications

    P4M-440G MQTT User Manual > Introduction > Hardware Specifications Hardware Specifications Input DC 3.3V (±0.16V) Power Current Consumption 95mA, typical Dimension 26mm x 26mm x 9mm Weight Approximately 4g 1 x UART Port (3.3V Level) UART Baudrate: 1200 ~ 115200 bps...
  • Page 4 P4M-440G MQTT User Manual > Introduction > Dimensions Dimension ※ Dimensions(unit : mm) may vary according to a method of measurement. 2023-10-04 Sollae Systems page 4 of 39...
  • Page 5 P4M-440G MQTT User Manual > Introduction > Layout Layout P4M-440G interfaces with two 12 x 1 pin headers (P1 ~ P2). The pin spacing is 2mm. Pin# Name Description P1.1 Ground P1.2 TPTX+ In/Out Ethernet Transmit + P1.3 TPTX- In/Out Ethernet Transmit - P1.4...
  • Page 6 P4M-440G MQTT User Manual > Introduction > Layout Pin# Name Description P2.9 SDA(0.7) In/Out Reserved P2.10 U1TX(0.10) In/Out UIO 0.10 / UART1 TX P2.11 U1RX(0.11) In/Out UIO 0.11 / UART1 RX P2.12 Ground There is an STS LED located at the top-left corner of the module. This LED blinks at a 1-second interval.
  • Page 7 UIO 0.11 / UART1 RX There are two UARTs, each providing RXD and TXD pins. ※ Notice: You can activate only one of the UART on P4M-440G. The default port is UART0, and you can refer to the AT commands and MQTT configuration for instructions on how to change it.
  • Page 8 Debugger. Either type B USB connector, mini USB or micro USB connector can be used for this port. Please refer to the application circuit diagram for the connection method. ※ Notice: The VBUS pin cannot be used for supplying power to P4M-440G. 2023-10-04 Sollae Systems page 8 of 39...
  • Page 9 P4M-440G MQTT User Manual > Introduction > Application Application This is an application circuit diagram for interfaces of P4M-440G. 2023-10-04 Sollae Systems page 9 of 39...
  • Page 10 P4M-440G MQTT User Manual > Basic Usage > Management Software Software PHPoC Debugger PHPoC Debugger is a software used for management and configurateion of PHPoC products. You need to install this program on your PC for using PHPoC. PHPoC Debugger Download Page...
  • Page 11: Connection With A Pc

    P4M-440G MQTT User Manual > Basic Usage > Management Software > Connection with a PC Connection with a PC To access the product via PHPoC Debugger, a connection with a PC is required. USB Connection Connect the USB device port of P4M-440G to PC via a USB cable.
  • Page 12 P4M-440G MQTT User Manual > Basic Usage > Management Software > Initial Setup and Certificates Initial Setup and Certificates IP Address P4M-440G is initially configured to automatically obtain an IP address. Therefore, in a typical network where IP addresses are assigned automatically, there is no need for initial IP address configuration.
  • Page 13: Firmware Upgrade

    P4M-440G MQTT User Manual > Basic Usage > Management Software > Firmware Upgrade Firmware Upgrade Firmware can be updated to introduce new features or fix discovered bugs in the product. If the firmware version on your current product is not the latest version, it is advisable to perform an upgrade.
  • Page 14: Settings Reset

    P4M-440G MQTT User Manual > Basic Usage > Reset Reset Settings Reset Settings Reset makes all the settings of your PHPoC products to factory default. Settings Reset Procedure Step Action Product State STS LED Input LOW signal to ISP# shortly (less than...
  • Page 15 P4M-440G MQTT User Manual > MQTT Usage MQTT Usage This document serves as a guide on how to use the MQTT functionality of the P4M-440G and does not cover detailed information about the MQTT protocol. For in-depth details about the protocol,...
  • Page 16: File System

    MQTT PXM - Functionality for MQTT communication phpoc.ini General configuration file pxm.ini PXM configuration file These files are stored in the P4M-440G's file system by default, allowing users to immediately utilize the MQTT functionality. 2023-10-04 Sollae Systems page 16 of 39...
  • Page 17: Command Responses

    P4M-440G MQTT User Manual > MQTT Usage > Preparation > AT Commands AT Commands All MQTT functionalities of the P4M-440G are executed through AT commands. Therefore, it is essential for users to be familiar with the usage of AT commands.
  • Page 18: Device Connection

    Connect P4M-440G to an internet-enabled network and, if necessary, configure the IP address. 2. UART connection and configuration Connect the user's MCU or microcontroller to P4M-440G's UART0 port and configure it as follows: 19200 bps, No-parity, 8-data bit, 1-stop bit 3.
  • Page 19 P4M-440G MQTT User Manual > MQTT Usage > MQTT Settings > Topic and Message Buffer Topic and Message Buffer By storing topics and messages in buffers and accessing them using buffer IDs, you can exchange MQTT messages more efficiently. You can use a total of four buffers (with IDs 0 to 3) for topic buffers and message buffers, respectively.
  • Page 20 P4M-440G MQTT User Manual > MQTT Usage > MQTT Settings > Timeout Timeout Timeout settings provide five parameters, and the unit of the settings is in seconds. Timeout Description Default Value Order CONNECT Timeout for MQTT CONNECT request PUBLISH Timeout for MQTT PUBLISH request...
  • Page 21 P4M-440G MQTT User Manual > MQTT Usage > MQTT Settings > Timeout Setting SUBSCRIBE timeout to 2 seconds at+mct=,,2 Setting PINGREQ timeout to 2 seconds at+mct=,,,2 Setting Keep Alive timeout to 30 secodns at+mct=,,,,30 2023-10-04 Sollae Systems page 21 of 39...
  • Page 22 P4M-440G MQTT User Manual > MQTT Usage > MQTT Settings > Connection Flags Connection Flags Three flags are provided for MQTT connection configuration. Flag Value Default Value Order Clean Session 0 or 1 Will QoS 0 or 1 Will Retain...
  • Page 23 P4M-440G MQTT User Manual > MQTT Usage > MQTT Settings > Connection Flags 2023-10-04 Sollae Systems page 23 of 39...
  • Page 24 P4M-440G MQTT User Manual > MQTT Usage > MQTT Settings > Connection Payload Connection Payload Five payload settings are provided for MQTT connection. Payload Description Order Note Client ID Client ID Will Topic Topic to store will message Will Message...
  • Page 25 P4M-440G MQTT User Manual > MQTT Usage > MQTT Settings > Connection Payload Setting a user name and a password at+mccp=,,,"test_user","test_password" 2023-10-04 Sollae Systems page 25 of 39...
  • Page 26 P4M-440G MQTT User Manual > MQTT Usage > MQTT Settings > QoS Three settings for Quality of Service (QoS) are provided. Parameter Description Values Order PUBLISH QoS QoS field of PUBLISH packet 0, 1 RETAIN RETAIN flag of PUBLISH packet...
  • Page 27 P4M-440G MQTT User Manual > MQTT Usage > MQTT Settings > QoS at+mcb=,,0 2023-10-04 Sollae Systems page 27 of 39...
  • Page 28 P4M-440G MQTT User Manual > MQTT Usage > Connecting to Broker Connecting to Broker P4M-440G can request a connection to a MQTT broker as an MQTT client. Connect to a Broker: +MNC Command Format AT+MNC="<Broker's hostname / IP address>" AT+MNC="<Broker's hostname / IP address>",<Port number>...
  • Page 29 P4M-440G MQTT User Manual > MQTT Usage > Connecting to Broker AT+MQNS Response Code Code Description Not conencted Connected Connected + Wait for a response (PUBACK / SUBACK / UNSUBACK) An example at+mnc="203.0.113.0" at+mqns +MQNS:4 Disconnect from a Broker: +MND...
  • Page 30 P4M-440G MQTT User Manual > MQTT Usage > SUBSCRIBE SUBSCRIBE P4M-440G, as an MQTT client, can request to subscribe to a specific topic on the MQTT broker or request to unsubscribe from topics it has subscribed to. SUBSCRIBE Request: +MBS Command Format AT+MBS="<Topic>"...
  • Page 31 P4M-440G MQTT User Manual > MQTT Usage > SUBSCRIBE at+mqns +MQNS:4 An example: Using a topic buffer at+mbt=0,"test/test_topic" at+mbu=0 at+mqns +MQNS:4 2023-10-04 Sollae Systems page 31 of 39...
  • Page 32 P4M-440G MQTT User Manual > MQTT Usage > PUBLISH PUBLISH P4M-440G, as an MQTT client, can request to publish messages to a MQTT broker. PUBLISH Request: +MBP Command Format AT+MBP="<Topic>","<Message>" AT+MBP="<Topic>",<An ID of a Message Buffer> AT+MBP=<An ID of a Topic Buffer>,"<Message>"...
  • Page 33: Reading Messages

    P4M-440G MQTT User Manual > MQTT Usage > Reading Messages Reading Messages If there are messages published to the subscribed topics, those messages will be received and can be read. In the case of multiple received messages, you can only read the last received message.
  • Page 34 P4M-440G MQTT User Manual > MQTT Usage > Reading Messages An example: Using a topic buffer at+mbt=0,"test/test_topic" at+mqnu=0 +MQNU:1 Getting the Size of a Received Message: +MQNR Command Format AT+MQNR="<Topic>" AT+MQNR=<An ID of a Topic Buffer> An example at+mqnr="test/test_topic" +MQNU:12 An example: Using a topic buffer at+mbt=0,"test/test_topic"...
  • Page 35 P4M-440G MQTT User Manual > MQTT Usage > Etc. > Reading the Client ID Reading the Client ID You can read the client ID of the device. Reading the Client ID: +MQC Command Format AT+MQC="clientid" An example at+mqc="clientid" +MQC:USER-SCLI-ENTI-DCHK An example: Setting with a client ID at+mccp="user_client_id"...
  • Page 36 P4M-440G MQTT User Manual > MQTT Usage > Etc. > Setting Short Response Setting Short Response You can set short response for AT commands. Setting short response: +MCO Command Format AT+MCO=<Value> Values Descriptoin Disable Short Response (Default) Enable Short Response...
  • Page 37: Setting Procedures

    P4M-440G User Manual. If you modify or delete files stored in the P4M-440G's file system, MQTT functionality may not work correctly. In such cases, you should use PHPoC Debugger to re-upload the ATC/MQTT package to the P4M-440G's file system. You can download the ATC/MQTT package from the online repository.
  • Page 38 P4M-440G MQTT User Manual > Advanced > Advanced AT Commands Advanced AT Commands You can read or change IP address-related settings for P4M-440G using AT commands. IP Address-related Settings Item Descriptoin dhcp Obtain an IP address automatically(1: Enable, 0: Disable)
  • Page 39 P4M-440G MQTT User Manual > Advanced > Advanced AT Commands Storing the envs: +EBS Command Format AT+EBS="envs",0xa5c3 An example at+ebs="envs",0xa5c3 Modifying an envs item: +EBW Command Format AT+EBW="<Item>","<Value>" AT+EBW="<Item>",<Value> An example: Enabling the DHCP at+ebl="envs" at+ebw="dhcp",1 at+ebs="envs",0xa5c3 An example: Using a static IP address (203.0.113.0) at+ebl="envs"...

Table of Contents