ubxlib icon indicating copy to clipboard operation
ubxlib copied to clipboard

multiple transmission of a mqtt message with only one sent

Open alexmaron81 opened this issue 3 years ago • 9 comments

I have the problem that when I publish a message, four always arrive? the next time i send, there are already 8 in the queue Rabbitmq broker (MQTT)

alexmaron81 avatar May 16 '22 09:05 alexmaron81

Hi Alex - what are you setting the QoS to? If you want to guarantee that only one will arrive you should use U_MQTT_QOS_EXACTLY_ONCE.

RobMeades avatar May 16 '22 09:05 RobMeades

image

alexmaron81 avatar May 16 '22 10:05 alexmaron81

That would seem correct: could you possibly paste into here an AT log of the exact sequence, which I could use to show your problem to our application engineering guys?

RobMeades avatar May 16 '22 10:05 RobMeades

image

alexmaron81 avatar May 16 '22 11:05 alexmaron81

Great, thanks, let me see what they say...

RobMeades avatar May 16 '22 11:05 RobMeades

Right, have had a discussion with AE, the AT sequence is fine so we need visibility from another angle. A few options:

  1. Are you able to get at the USB port of the module? Specifically, would it be possible to attach a Windows PC to that USB port only after powering the module up? If so, you could obtain a log from it (I will tell you how). It needs to only be connected after powering the module up as, if the module detects something plugged into the USB port at boot it will switch to only accepting AT commands over the USB port and NOT over the UART port, which would prevent your MCU talking to it.
  2. Are you able to take a log (e.g. Wireshark, or just an MQTT message log) on the broker side at all?
  3. Would you be willing to share log-in details for the broker with us, in which case we could reproduce the problem here?

RobMeades avatar May 16 '22 12:05 RobMeades

I would like to try the first variant. I just have to figure out how to connect the USB port. Is it a problem if the VCC pin gets the V_SYS voltage and then the RSVD/VUSB_DET is powered by the USB? The circuit board was developed for us, so I don't have much of a clue. image

alexmaron81 avatar May 16 '22 12:05 alexmaron81

The critical moment is when PWR_ON is briefly pulled low to effect the power on process. At that point the module boots and checks if the USB is connected (I guess it probably just checks whether 5V is present on the VUSB _DET line).

The ubxlib code will be toggling PWR_ON at your command (either when you call uNetworkAdd() or maybe you are calling uCellPwrOn() directly, I can't recall now). When it does this the USB must NOT be connected. Once it has done that, you can plug in the USB to obtain logs. I will need to get you the stuff for doing that actual log capturing on the Windows PC side of course.

RobMeades avatar May 16 '22 12:05 RobMeades

Could you possibly send me a direct message so that we can continue there?

RobMeades avatar May 16 '22 13:05 RobMeades

This was moved to direct comms, closing - please re-open if there are still concerns.

RobMeades avatar Oct 05 '22 09:10 RobMeades