hirotakaster / MQTT

MQTT for Photon, Spark Core
Other
216 stars 118 forks source link

MQTT_KEEPALIVE 15 is expensive #70

Closed jrburk closed 6 years ago

jrburk commented 6 years ago

Can the constant

define MQTT_KEEPALIVE 15

please been made configurable. On mobile connects this costs a significant amount of money every month.

hirotakaster commented 6 years ago

hi @jrburk you can change the KEEPALIVE on constructor. MQTT(char* domain, uint16_t port, int keepalive, void (*callback)(char*,uint8_t*,unsigned int));

here is sample MQTT client("server_name", 1883, 15 * 2, callback);

jrburk commented 6 years ago

Hello @hirotakaster a matching constructor cannot be found because I'm using it together with an extended message size:

MQTT cm(IOT_HOST, 1883, 5*60, callback, 1023);

I want to switch to your library MQTT-TLS at some point. Would it work there?

hirotakaster commented 6 years ago

@jrburk okay, MQTT-TLS will work. I tested it with MQTT-TLS server.