{"action":"closed","issue":{"url":"https://api.github.com/repos/TMRh20/RF24Gateway/issues/3","labels_url":"https://api.github.com/repos/TMRh20/RF24Gateway/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/TMRh20/RF24Gateway/issues/3/comments","events_url":"https://api.github.com/repos/TMRh20/RF24Gateway/issues/3/events","html_url":"https://github.com/TMRh20/RF24Gateway/issues/3","id":105013494,"number":3,"title":"Send/Receive Loop when trying to use MQTT over RF24Ethernet/RF24Gateway","user":{"login":"Krifto","id":6061618,"avatar_url":"https://avatars.githubusercontent.com/u/6061618?v=3","gravatar_id":"","url":"https://api.github.com/users/Krifto","html_url":"https://github.com/Krifto","followers_url":"https://api.github.com/users/Krifto/followers","following_url":"https://api.github.com/users/Krifto/following{/other_user}","gists_url":"https://api.github.com/users/Krifto/gists{/gist_id}","starred_url":"https://api.github.com/users/Krifto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Krifto/subscriptions","organizations_url":"https://api.github.com/users/Krifto/orgs","repos_url":"https://api.github.com/users/Krifto/repos","events_url":"https://api.github.com/users/Krifto/events{/privacy}","received_events_url":"https://api.github.com/users/Krifto/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/TMRh20/RF24Gateway/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/TMRh20/RF24Gateway/labels/help%20wanted","name":"help wanted","color":"159818"},{"url":"https://api.github.com/repos/TMRh20/RF24Gateway/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-05T08:25:50Z","updated_at":"2015-12-05T19:46:17Z","closed_at":"2015-12-05T19:46:17Z","body":"When putting an MQTT client on an Arduino UNO, thanks to the awesome RF24* libraries (which implement the Client.h interface) we can have it communicate over the RF24Ethernet library to a mosquitto server on a Raspberry Pi. The MQTT client is found here https://github.com/knolleary/pubsubclient, the MQTT server is mosquitto.\r\n\r\nEverything works great (publishing and subscribing messages, reconnecting etc) but I have found a strange problem. I noticed lots of TX and RX traffic on the RF24Gateway dashboard. Running the mosquitto server with verbose output (mosquitto -v), I could see that the Arduino was constantly firing a SUBSCRIBE request, and the mosquitto server was acknowledging it. \r\n\r\nRacking up the RF24Ethernet debugging, I can see that the code repeatedly reaches this line in RF24Client.cpp:\r\n\r\n`IF_ETH_DEBUG_L2( Serial.print(F(\"UIPClient stop?????? \")); Serial.println(data->state & UIP_CLIENT_SOCKETS); Serial.println(F(\"**\")); Serial.println(data->state,BIN); Serial.println(F(\"**\")); Serial.println(UIP_CLIENT_SOCKETS,BIN); Serial.println(F(\"**\"));  );`.\r\n\r\nThis produces the output `UIPClient stop?????? 0\r\n    **\r\n    10000\r\n    **\r\n    11111111111111111111111100001111\r\n    **`.\r\n\t\t\r\nAfter a while, this back-and-forth ends, but then the same starts happening when there is a ping handshake between client and server. Then the whole RF2Ethernet connection seems to drop, and after reconnect everything starts over again.\r\n\r\nI have tried all kinds of configuration changes, tried to trace through all the different libraries (including PubSubClient). I noticed there that the PubSubClient actually only sends the SUBSCRIBE request once, but somehow RF24* repeats sending that same request, every time the SUBACK message from the MQTT server arrives.\r\n\r\nI feel that I do not understand the whole stack of libraries enough to make any headway with this problem. \r\n\r\nCould somebody else maybe try the sketch and see if they encounter the same problem? Or maybe someone already got MQTT over RF24 running smoothly?\r\n\r\nHere is the sketch I am trying:\r\nhttps://gist.github.com/Krifto/865456a1f9596c0878b3"}}