OK I found out one of the problems with Method 1 -- the subscribe and publish topics in the new MQTT_w_UART had a forward slash in front of them in the prj.conf file so I got rid of the forward slash and now it is at least getting the subscribed MQTT packets. It should be my/subscribe/topic and not /my/subscribe/topic
OK I found out one of the problems with Method 1 -- the subscribe and publish topics in the new MQTT_w_UART had a forward slash in front of them in the prj.conf file so I got rid of the forward slash and now it is at least getting the subscribed MQTT packets. It should be my/subscribe/topic and not /my/subscribe/topic
Hi,
There are two methods I have tried to send data back to the MQTT server based on two separate Nordic examples
I wouldn't really say that there are two methods for doing MQTT on the nRF9160. They both use the same MQTT client library, mqtt_simple uses it directly, while the Serial LTE Modem (SLM) provides an AT command interface for customers that want to use the nRF1960 as a pure modem (i.e. not running their application on the nRF9160's application core).
note first and foremost that the filename and root directory/path must be short
This is mostly a limitation in Windows, though I agree that the sometimes long paths in the build folder doesn't help. Most of that is inherited from Zephyr's build system, so unfortunatley there isn't much we can do about it.
GerryB said:OK I found out one of the problems with Method 1
Does this mean that your mqtt_simple project now works as expected?
GerryB said:It should be my/subscribe/topic and not /my/subscribe/topic
My impression is that it varies a bit from broker to broker how an initial / is handled. Some seem to ignore it, while other treat 'foo' and '/foo' as different topics.
METHOD 2: PROBLEMS with LTE_Serial_Modem (LSM) AT#XMQTT commands
one: for whatever reason, just connecting to the server makes it download a bunch of old messages that the MQTT_SIMPLE fortunately ignores.
What broker do you connect to?
Were the messages retained messages?
Do you have any logs, or steps to reproduce this?
I have not experienced this any of my tests.
Perhaps the bigger problem, however, is the AT#XMQTTPUB command. Even if we could fix the first problem, the AT#XMQTTPUB command is broken.
This is a bug. I have reported it internally, so hopefully it will be fixed soon.
and then when you type something again, it will publish once to the MQTT publish topic but never again and you are completely locked out from that point onward.
While I am able to reproduce the "#xmqttpub-enters-datamode-bug", I am not able to reproduce this. When I typed in something for the second time (and more), it got sent to the broker as expected.
Best regards,
Didrik
Hi Didrik.
Yes - method 1 finally works, thank you. The forward slash character removal solved the last hurdle.
As for method 2 - they werent retained messages that I know of - they were sent there by me - but one clue is that even without the subscribe topic being specified, they were received anyway
The #XMQTTPUB bug in SLM should be fixed by this pull request: https://github.com/nrfconnect/sdk-nrf/pull/5876
With that PR, the SLM should no longer enter data mode unless you want it to. See also the update to the documentation: http://developer.nordicsemi.com/nRF_Connect_SDK_dev/doc/PR-5876/nrf/applications/serial_lte_modem/doc/MQTT_AT_commands.html#mqtt-publish-xmqttpub
As for how to exit data mode, the answer is to send "+++" without any CR or LF termination.