======mqtt_subscribe====== WMPRO, WMMINI FW >= 1.1074 WMMEGA FW >= 2.1078 Subscribe to an MQTT channel ====Description==== mqtt_subscribe ( string $channel, string $callback ) ====Parameters==== $channel: Channel to subscribe to. See [[uphp:mqtt_configuration|MQTT Configuration]] $callback: Callback script to execute upon receipt of a message ====Return Values==== 1 if successful and 0 on failure ====Example==== ====Example Callback==== Callbacks can use the ''stdin'' file to read input. Use fgets() to get the first line, which will be the full channel. The following lines will be the data received. ====Note===== On WattmonPRO & MINI the maximum packet size is 128 bytes. On WattmonMega, M2 & Mini2 the maximum packet size is 2048 bytes. ====See Also==== [[mqtt_publish()]] - Publish to an MQTT channel