-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Payload passed to the publish method of MQTT did not send properly #9
Comments
Try sharing code snippets
|
I used the following code snippets and I always received "/tangtret/phongtrung/tran/tu/relay1" or "/tangtret/phongtrung/tran/tu/relay2" instead of "ON" / "OFF" value. print("------mqtt demo------") cfg={ tmr.start(1,1000,function() clientid = "EMW3165_" .. mcu.chipid() |
What do you get if you try:test.mosquitto.org for test? |
It also behaved as mention before, the client sent the topic string as payload. Please look at the following picture! Would you please fix this soon? |
you'll have to use callbacks:
if you receive a value, that is not a string, then you'll need to cast it to a number:
|
Oh my god, believe me, I played with MQTT protocol for several projects before, I am sure the MQTT library of this wifimcu has issue with publishing message. The demo also did not publish 'hiwifimcu', it published the topic instead. Please tell the one who developed the library about this problem. Please ... please, I am not good at C++ to understand the original source in C of this library. |
The demo is tested between two wifimcus, and it works. It's true that it published the topic if only one wifimcu was used. We found this while coding. This is the function provided from MXChip.inc SDK. Let us know if any more prolems. |
Mqtt client publish message, message content is the topic name.like this:
This is my code
And I have test
It is normal when I use other client's API. |
The mqtt publish bug is fixed. |
I tried publishing a message, the message did not being sent correctly, the value of topic was always sent as payload message.
The text was updated successfully, but these errors were encountered: