mqttclient icon indicating copy to clipboard operation
mqttclient copied to clipboard

A high-performance, high-stability, cross-platform MQTT client, developed based on the socket API, can be used on embedded devices (FreeRTOS / LiteOS / RT-Thread / TencentOS tiny), Linux, Windows, Mac...

Results 51 mqttclient issues
Sort by recently updated
recently updated
newest added

你好。用的arm-poky-linux-gnueabi-gcc。 `` ./build.sh arm-poky-linux-gnueabi-gcc `` 不成功。怎么做呢?

公司项目是使用 VS Studio C++开发,需要增加 mqtt 通信功能,看软件介绍可以支持windows,但在 platform 目录下却找不到适配 windows 的文件。是要自己来写windows平台的适配函数,还是有什么方法?

请教下 Jie哥,系统如果睡眠后,且睡眠时间超过了mqtt_keep_alive_interval时间,那么mqtt connection是否就断开了,需要重新走一遍初始化流程? 或是在系统睡前之前设置一个定时器,时间到了初始化后再publish? client = mqtt_lease(); KAWAII_MQTT_LOG_D("After mqtt_lease()."); mqtt_set_port(client, g_mqtt_port); mqtt_set_host(client, g_mqtt_host); mqtt_set_client_id(client, g_mqtt_client_id); mqtt_set_user_name(client, g_mqtt_user_name); mqtt_set_password(client, g_mqtt_password); mqtt_set_clean_session(client, 1); KAWAII_MQTT_LOG_D("\nbefore mqtt_connect\n"); mqtt_connect(client);

调试发现,mqtt_publish 返回的是MQTT_SEND_PACKET_ERROR. 但是查看 mqtt_yield_thread 函数 `rc = mqtt_yield(c, c->mqtt_cmd_timeout); if (MQTT_CLEAN_SESSION_ERROR == rc) { MQTT_LOG_W("%s:%d %s()..., mqtt clean session....", __FILE__, __LINE__, __FUNCTION__); network_disconnect(c->mqtt_network); mqtt_clean_session(c); goto exit; } else if (MQTT_RECONNECT_TIMEOUT_ERROR...

库中不少使用宏来声明的函数体,比如`KAWAII_MQTT_CLIENT_SET_STATEMENT(user_name, char*)`。部分编辑器比如`SourceInsight`并不会将这些宏展开,会有下面这些不便: 1. 不展开宏用户并不清楚有哪些接口可用 2. 接口上的参数类型也需要根据宏来确认 3. 智能提示功能也不可用 上述问题换编辑器可以解决,但还是希望楼主可以照顾一下其他编辑器

我的情况是,MQTT服务器是单向认证,不需要客户端带CA证书,只需要用户名和密码就能实现连接,我用MQTT.fx这个软件能连接上,软件配置如下: ![1](https://user-images.githubusercontent.com/31332231/100590477-6d96a200-332f-11eb-88d5-663ac2cb4236.jpg) ![2](https://user-images.githubusercontent.com/31332231/100590551-83a46280-332f-11eb-9170-43b5157748aa.jpg) 如上图。使用这样的配置方式是能连接上服务器的,但是使用mqttclient不使用CA证书的情况下就不知道怎么连接了。

As a client developed in accordance with the standard MQTT protocol, you may need to add new features on some platforms or meet some more convenient needs. You can speak...

enhancement

1、platform_thread_init函数中,xTaskCreate的最后一个参数应该是&thread->thread,而不是V1.1.0版本中的thread->thread。 platform_thread_init函数的自测代码修改为: err = xTaskCreate(entry, name, stack_size, param, priority, &thread->thread); 2、platform_thread_destroy函数中,先将任务删除,然后再释放内存的逻辑无法顺利运行。当任务删除后,无法运行到vTaskDelete的后一条释放语句。 platform_thread_destroy函数的自测代码修改为: TaskHandle_t threadToBeDeleted; threadToBeDeleted = thread->thread; platform_memory_free(thread); if (NULL != threadToBeDeleted) vTaskDelete(threadToBeDeleted); 3、我现在使用DTU在建立TCP连接、断开TCP连接都会给用户任务发送事件,用户任务超时5秒等到事件发生,当收到“离线到在线”事件连接 MQTT Server,收到"在线到离线事件" Disconnect, 什么都没有收到的情况下就超时了,即每5秒向MQTT Server发送一次Qos2消息。 在Qos2服务质量下,假设Socket无需用户维护,远程Socket首先断开连接,用户任务检测到掉线,在用户任务中调用mqtt_disconnect函数,会使得内部state变成CLIENT_STATE_CLEAN_SESSION,mqtt_yield返回MQTT_CLEAN_SESSION_ERROR,从而调用mqtt_clean_session,state变成CLIENT_STATE_INVALID状态,最终跳转到platform_thread_destroy函数。platform_thread_destroy函数删除了yield任务,但是c->mqtt_thread没有清零,当Socket再次连接成功后,调用的yield进程没有被重新创建,无法正常运行。...

![image](https://user-images.githubusercontent.com/6436021/92376088-a2ca9400-f134-11ea-8a59-55b5501755df.png) c->mqtt_network在network_release里面被清零了,所以不用释放,直接屏蔽 platform_memory_free(c->mqtt_network),添加c->mqtt_write_buf和c->mqtt_read_buf内存释放,就可以了 _Originally posted by @Torchwoods in https://github.com/jiejieTop/mqttclient/issues/13#issuecomment-688220242_