I am currently using my Pi 4 as a broker, My laptop as the Client(MQTT.fx) that publishes, and my mobile that use MyMQTT app as client that subscribes.
My goal is to dissect every features of MQTT by doing packet analysis(even though the documentation is very detailed and tells everything).
So coming back to the question, I am struggling to find a way to make the Force Disconnect Condition(No PINGRESP) to happen in my setup.
I was although able to initiate the LWT, by force closing MQTT.fx application while it was connected to the Broker(Pi). This indeed sent the LWT message across all the clients (mobile and another laptop). I was also able to view the packets moving between my Pi and the Clients by using ngrep tool in Pi's terminal.
So I would like any of you, to kindly suggest me some way to simulate Keep Alive Force Disconnect Condition like I did with LWT.
Generally what comes to my mind is the following solutions, but I don't know how to implement them.
- PINREQ Packet shouldn't even go to the Broker - Is there any tool to block specific packets? But still I don't think if something like that still exists it will blindly block all MQTT packets instead of specific type of MQTT packets
- Maybe can we modify the client's library to not even send a PINREQ command in the first place
Any guidance or suggestion are appreciated.
Thanks in advance