Skip to content
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

Abnormal busy, done behavoir on Iot Mqtt Publish FUB #28

Open
sclaiborne opened this issue Sep 17, 2023 · 3 comments
Open

Abnormal busy, done behavoir on Iot Mqtt Publish FUB #28

sclaiborne opened this issue Sep 17, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@sclaiborne
Copy link
Collaborator

Description

The Busy, Done behavior is unexpected. AS variable trace attached.

AR: E4.53
IotMqtt: rev5, 4.53

I am seeing the Busy status goes TRUE sometime after Send goes TRUE (sometimes). I would expect the Busy to go High with Send and stay TRUE until done goes TRUE.

I am also seeing the Done bit say TRUE for 2 cycles, when I would expect it to be TRUE for just 1 cycle.

image

Code

Note buildPacket will populate publishMessage and return a length.

PROGRAM _INIT
	IotMqttPublish_0.QoS := IotMqtt_QoS0; // We are sending enough data, dont confirm its recieved
END_PROGRAM

PROGRAM _CYCLIC
	IotMqttPublish_0.IotMqttLink := gMqttApi.link;
	IotMqttPublish_0.Enable := Configuration.enable;

	IF (IotMqttPublish_0.Active 
		AND gMqttApi.connected) THEN
		
		IotMqttPublish_0.Topic := ADR(Configuration.topic);
		
		// Send data
		IF NOT IotMqttPublish_0.Busy AND NOT IotMqttPublish_0.Done AND NOT IotMqttPublish_0.Error THEN
		
			// Build packet
			IotMqttPublish_0.Send := TRUE;
			IotMqttPublish_0.Buffer := ADR(publishMessage);
			IotMqttPublish_0.BufferLength := buildPacket(ADR(publishMessage), SIZEOF(publishMessage), ADR(encodeError));
		END_IF
		
	END_IF
	
	IF IotMqttPublish_0.Enable OR (IotMqttPublish_0.IotMqttLink <> 0) THEN
		IotMqttPublish_0();
		IF IotMqttPublish_0.Done THEN
			// This is so we can send packets back to back
			IotMqttPublish_0.Send := FALSE;
//			IotMqttPublish_0();
		END_IF
	END_IF
	
END_PROGRAM

PROGRAM _EXIT
	IotMqttPublish_0(Enable := FALSE); 
END_PROGRAM
@priesf
Copy link
Collaborator

priesf commented Sep 26, 2023

Hi, thanks for pointing this out.
We will try to have a look at some point. I'm quite busy at the moment.

@priesf priesf added the bug Something isn't working label Sep 26, 2023
@DavidWLoupe
Copy link

Respectfully, I'm curious if there has been any development on this issue

@priesf
Copy link
Collaborator

priesf commented Feb 19, 2024

Hi, I'm sorry that there is very little information at the moment.
There is no solution available. Analysis is still ongoing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants