{"id":13392,"date":"2019-09-08T17:46:10","date_gmt":"2019-09-08T15:46:10","guid":{"rendered":"https:\/\/pi3g.com\/?p=13392"},"modified":"2019-09-08T17:46:10","modified_gmt":"2019-09-08T15:46:10","slug":"paho-mqtt-client-javascript-envoy-vernemq-debugging-disconnects","status":"publish","type":"post","link":"https:\/\/pi3g.com\/de\/paho-mqtt-client-javascript-envoy-vernemq-debugging-disconnects\/","title":{"rendered":"Paho MQTT Client (Javascript), Envoy, VerneMQ: Fehlersuche bei Verbindungsabbr\u00fcchen"},"content":{"rendered":"<p>After deploying picockpit to my server, a bug was observed: the web frontend would disconnect in very regular intervals. <\/p>\n<p>This had not been present on the local development environment. Users of picockpit reported the same bug. <\/p>\n<p>I have debugged it today, and applied a hotfix. It turns out it was a timing issue. <\/p>\n<h1>TL;DR how to fix this<\/h1>\n<p>set up a shorter keepAliveInterval for Paho. 60 seconds is the default, but with network latencies this will lead to these timeouts.<\/p>\n<p>Here is my code for the connection (inside pcp-code.js which is loaded by the webpage):<\/p>\n<blockquote>\n<p>\/* <a href=\"https:\/\/www.eclipse.org\/paho\/files\/jsdoc\/Paho.MQTT.Client.html\">https:\/\/www.eclipse.org\/paho\/files\/jsdoc\/Paho.MQTT.Client.html<\/a> *\/<br \/>\nfunction MQTTconnect_inner(params){<br \/>&nbsp;&nbsp;&nbsp;&nbsp; mqtt = new Paho.Client(params.uri, params.clientid); \/* setting not required parameters as JS does not allow to pass named positional parameters *\/<br \/>&nbsp;&nbsp;&nbsp;&nbsp; mqtt.onConnectionLost = mqtt_onConnectionLost;<br \/>&nbsp;&nbsp;&nbsp;&nbsp; mqtt.onMessageDelivered = mqtt_onMessageDelivered;<br \/>&nbsp;&nbsp;&nbsp;&nbsp; mqtt.onMessageArrived = mqtt_onMessageArrived;<br \/>&nbsp;&nbsp;&nbsp;&nbsp; mqtt.onConnected = mqtt_onConnect_proper;<\/p>\n<p>&nbsp;&nbsp;&nbsp; var options = {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; timeout: 3, \/* if conection not successfull within 3 seconds, it is deemed to have failed *\/<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; onSuccess: mqtt_onConnect_connect,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; onFailure: mqtt_onConnectFailure_connect,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; userName: params.userName,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; password: params.password,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; keepAliveInterval: 30,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; useSSL: true,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reconnect: false,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mqttVersion: 4 <br \/>&nbsp;&nbsp;&nbsp;&nbsp; };<br \/>&nbsp;&nbsp;&nbsp;&nbsp; mqtt.connect(options);&nbsp;&nbsp;&nbsp; <br \/>\n}<\/p>\n<\/blockquote>\n<p><a href=\"https:\/\/pi3g.com\/wp-content\/uploads\/2019\/09\/image.png\"><img loading=\"lazy\" decoding=\"async\" width=\"786\" height=\"476\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/pi3g.com\/wp-content\/uploads\/2019\/09\/image_thumb.png\" border=\"0\"><\/a><\/p>\n<p>(reproduced as image as well)<\/p>\n<h1>Debugging steps<\/h1>\n<h2>Timing<\/h2>\n<p>I sat down with my mobile phone to time the timeouts, and see whether there was a pattern there.<\/p>\n<p><a href=\"https:\/\/pi3g.com\/wp-content\/uploads\/2019\/09\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"706\" height=\"159\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/pi3g.com\/wp-content\/uploads\/2019\/09\/image_thumb-1.png\" border=\"0\"><\/a><\/p>\n<p>In my implementation, Paho is reconnected by surrounding JavaScript code every 10 seconds on timeout. <\/p>\n<p><a href=\"https:\/\/pi3g.com\/wp-content\/uploads\/2019\/09\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"715\" height=\"205\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/pi3g.com\/wp-content\/uploads\/2019\/09\/image_thumb-2.png\" border=\"0\"><\/a><\/p>\n<p>We see the Paho javascript MQTT client loosing the connection every minute or every two minutes. This is already a strong indication that this is systematic, possibly a forced disconnect by the server.<\/p>\n<h2>JavaScript console<\/h2>\n<p><a href=\"https:\/\/pi3g.com\/wp-content\/uploads\/2019\/09\/image-3.png\"><img loading=\"lazy\" decoding=\"async\" width=\"756\" height=\"57\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/pi3g.com\/wp-content\/uploads\/2019\/09\/image_thumb-3.png\" border=\"0\"><\/a><\/p>\n<p>The error message I see in the console is:<\/p>\n<p><strong>WebSocket is already in CLOSING or CLOSED state.<\/strong><\/p>\n<p>In retrospect, this is possibly Paho trying to send the PINGREQ but failing just by a couple of seconds or possibly microseconds, as the server has disconnected the socket.<\/p>\n<p>NB: For superior compatibility with company firewalls, etc. I run Paho through websockets. <\/p>\n<h2>Verification with other browser<\/h2>\n<p>I have seen this issue with Chrome (my main browser) and Firefox. Therefore it is not due to a browser problem.<\/p>\n<p>(I was led to believe that it might be to some browser issues by this website: <a href=\"https:\/\/github.com\/socketio\/socket.io\/issues\/3259\">https:\/\/github.com\/socketio\/socket.io\/issues\/3259<\/a>)<\/p>\n<h2>Debugging VerneMQ<\/h2>\n<p><b>see also:<\/b><\/p>\n<ul>\n<li><a href=\"https:\/\/pi3g.com\/2019\/08\/08\/vernemq-how-to-disconnect-clients-forceably-per-command-line\/\">https:\/\/pi3g.com\/2019\/08\/08\/vernemq-how-to-disconnect-clients-forceably-per-command-line\/<\/a>&nbsp;<\/li>\n<li><a href=\"https:\/\/docs.vernemq.com\/administration\/managing-sessions\">https:\/\/docs.vernemq.com\/administration\/managing-sessions<\/a><\/li>\n<\/ul>\n<p>Show full client_id and mountpoint to avoid truncation:<\/p>\n<blockquote>\n<p>vmq-admin session show &#8211;mountpoint &#8211;client_id<\/p>\n<\/blockquote>\n<p><a href=\"https:\/\/pi3g.com\/wp-content\/uploads\/2019\/09\/image-4.png\"><img loading=\"lazy\" decoding=\"async\" width=\"684\" height=\"214\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/pi3g.com\/wp-content\/uploads\/2019\/09\/image_thumb-4.png\" border=\"0\"><\/a><\/p>\n<p>Run a trace:<\/p>\n<blockquote>\n<p>vmq-admin trace client client-id=js.1567943187982KSWuLXb &#8211;mountpoint=5cc72b97a6b76f00013d35d2<\/p>\n<\/blockquote>\n<p><a href=\"https:\/\/pi3g.com\/wp-content\/uploads\/2019\/09\/image-5.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1141\" height=\"175\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/pi3g.com\/wp-content\/uploads\/2019\/09\/image_thumb-5.png\" border=\"0\"><\/a><\/p>\n<p>As you see, you will get a trace of what is sent to the client and received from the client. <\/p>\n<p><em>Starting trace for 1 existing sessions for client &#8220;js.1567943187982KSWuLXb&#8221; with PIDs<\/em><\/p>\n<p><em>[&lt;9043.1475.12&gt;]<\/em><\/p>\n<p><em>&lt;9043.1475.12&gt; MQTT SEND: MP: &#8220;5cc72b97a6b76f00013d35d2&#8221; CID: &#8220;js.1567943187982KSWuLXb&#8221; PUBLISH(d0, q0, r0, m0, &#8220;pi\/000000007eaefc47\/com.picockpit\/sensors\/$state\/pi&#8221;) with payload:<\/em><\/p>\n<p><em>{&#8220;wlan_signal_info&#8221;: &#8220;Link Quality=61\/70 Signal level=-49 dBm&#8221;, &#8220;cpu_load&#8221;: 1.4, &#8220;net_io_bytes_received&#8221;: 798582943, &#8220;root_partition_used&#8221;: 2028572672, &#8220;net_io_bytes_sent&#8221;: 1482989984, &#8220;soc_temperatu (truncated)<\/em><\/p>\n<p>I also saw a PINGREQ() and PINGRESP(), keeping the session alive in this trace:<\/p>\n<p><b>&lt;9043.1475.12&gt; MQTT RECV: MP: &#8220;5cc72b97a6b76f00013d35d2&#8221; CID: &#8220;js.1567943187982KSWuLXb&#8221; PINGREQ()<\/b><\/p>\n<p><b>&lt;9043.1475.12&gt; MQTT SEND: MP: &#8220;5cc72b97a6b76f00013d35d2&#8221; CID: &#8220;js.1567943187982KSWuLXb&#8221; PINGRESP()<\/b><\/p>\n<p>Here is how the disconnect looks like:<\/p>\n<p><em>&lt;9043.1475.12&gt; MQTT SEND: MP: &#8220;5cc72b97a6b76f00013d35d2&#8221; CID: &#8220;js.1567943187982KSWuLXb&#8221; PUBLISH(d0, q0, r0, m0, &#8220;pi\/00000000327f9cbf\/com.picockpit\/sensors\/$state\/pi&#8221;) with payload:<\/em><\/p>\n<p><em>{&#8220;wlan_signal_info&#8221;: &#8220;Link Quality=68\/70 Signal level=-42 dBm&#8221;, &#8220;ram_total_bytes&#8221;: 969392128, &#8220;$uuid&#8221;: &#8220;928ca964-d22e-11e9-9e22-dca632007438&#8221;, &#8220;disk_io_bytes_written&#8221;: 619947008, &#8220;root_partition_tota (truncated)<\/em><\/p>\n<p><b>&lt;9043.1475.12&gt; Trace session for js.1567943187982KSWuLXb stopped<\/b><\/p>\n<p>Unfortunately there is<strong> no information<\/strong> that this is due to a timeout waiting for a pingreq() from the client. <\/p>\n<h2>Debugging Envoy<\/h2>\n<p>See also:<\/p>\n<ul>\n<li><a href=\"https:\/\/pi3g.com\/2019\/05\/18\/envoy-docker-and-websockets-debugging-and-configuration\/\">https:\/\/pi3g.com\/2019\/05\/18\/envoy-docker-and-websockets-debugging-and-configuration\/<\/a><\/li>\n<\/ul>\n<p><\/p>\n<p>As there was no information that this is due to a pingreq timeout, suspicion fell upon envoy disconnecting due to timeouts (possibly handling websockets incorrectly due to me not setting some config properly).<\/p>\n<p>The configuration was, however, applied properly:<\/p>\n<blockquote>\n<p><b> upgrade_configs:<\/b><\/p>\n<p><b>&nbsp;&nbsp; &#8211; upgrade_type: &#8220;websocket&#8221;<\/b><\/p>\n<p><b>&nbsp;&nbsp; enabled: true<\/b><\/p>\n<\/blockquote>\n<p>for the correct path (\/mqtt)<\/p>\n<p>There are no timeouts apart from connect_timeout for the backends (which were set to different values, surely not a minute).<\/p>\n<p>To enable debug output from envoy, you have to add an environment variable to the docker-compose.yaml:<\/p>\n<blockquote>\n<p>environment:<\/p>\n<p>&nbsp; loglevel: debug<\/p>\n<\/blockquote>\n<p><a href=\"https:\/\/pi3g.com\/wp-content\/uploads\/2019\/09\/image-6.png\"><img loading=\"lazy\" decoding=\"async\" width=\"459\" height=\"108\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/pi3g.com\/wp-content\/uploads\/2019\/09\/image_thumb-6.png\" border=\"0\"><\/a><\/p>\n<p>as the last lines in the stanza for the service envoy<\/p>\n<p><\/p>\n<p>Here\u2019s what I see as trace:<\/p>\n<p><em> &#8216;:status&#8217;, &#8216;101&#8217;<\/em><\/p>\n<p><em> &#8216;connection&#8217;, &#8216;Upgrade&#8217;<\/em><\/p>\n<p><em> &#8216;date&#8217;, &#8216;Sun, 08 Sep 2019 12:08:36 GMT&#8217;<\/em><\/p>\n<p><em> &#8216;sec-websocket-accept&#8217;, &#8216;mWAEi6p3RBFflHkNbxTMbnhaG4I=&#8217;<\/em><\/p>\n<p><em>&#8216;sec-websocket-extensions&#8217;, &#8216;permessage-deflate; client_max_window_bits=15&#8217;<\/em><\/p>\n<p><em>&#8216;sec-websocket-protocol&#8217;, &#8216;mqtt&#8217;<\/em><\/p>\n<p><em> &#8216;server&#8217;, &#8216;envoy&#8217;<\/em><\/p>\n<p><em> &#8216;upgrade&#8217;, &#8216;websocket&#8217;<\/em><\/p>\n<p><em> &#8216;content-length&#8217;, &#8216;0&#8217;<\/em><\/p>\n<p><em><br \/><\/em><\/p>\n<p><em>[2019-09-08 12:08:38.757][1][debug][main] [source\/server\/server.cc:170] flushing stats<\/em><\/p>\n<p><em> [2019-09-08 12:08:43.760][1][debug][main] [source\/server\/server.cc:170] flushing stats<\/em><\/p>\n<p><em> [2019-09-08 12:08:48.755][1][debug][main] [source\/server\/server.cc:170] flushing stats<\/em><\/p>\n<p><em> [2019-09-08 12:08:53.759][1][debug][main] [source\/server\/server.cc:170] flushing stats<\/em><\/p>\n<p><em>[2019-09-08 12:08:58.762][1][debug][main] [source\/server\/server.cc:170] flushing stats<\/em><\/p>\n<p><em> [2019-09-08 12:09:03.762][1][debug][main] [source\/server\/server.cc:170] flushing stats<\/em><\/p>\n<p><em> [2019-09-08 12:09:08.762][1][debug][main] [source\/server\/server.cc:170] flushing stats<\/em><\/p>\n<p><em> [2019-09-08 12:09:13.765][1][debug][main] [source\/server\/server.cc:170] flushing stats<\/em><\/p>\n<p><em> [2019-09-08 12:09:18.766][1][debug][main] [source\/server\/server.cc:170] flushing stats<\/em><\/p>\n<p><em> [2019-09-08 12:09:23.766][1][debug][main] [source\/server\/server.cc:170] flushing stats<\/em><\/p>\n<p><em> [2019-09-08 12:09:28.765][1][debug][main] [source\/server\/server.cc:170] flushing stats<\/em><\/p>\n<p><em> [2019-09-08 12:09:33.766][1][debug][main] [source\/server\/server.cc:170] flushing stats<\/em><\/p>\n<p><b><em> [2019-09-08 12:09:37.190][26][debug][connection] [source\/common\/network\/connection_impl.cc:520] [C9] remote Close<\/em><\/b><\/p>\n<p><b><em> [2019-09-08 12:09:37.190][26][debug][connection] [source\/common\/network\/connection_impl.cc:190] [C9] closing socket: 0<\/em><\/b><\/p>\n<p><b><em>[2019-09-08 12:09:37.190][26][debug][client] [source\/common\/http\/codec_client.cc:82] [C9] disconnect. resetting 1 pending requests<\/em><\/b><\/p>\n<p><b><em> [2019-09-08 12:09:37.190][26][debug][client] [source\/common\/http\/codec_client.cc:105] [C9] request reset<\/em><\/b><\/p>\n<p><b><em> [2019-09-08 12:09:37.190][26][debug][router] [source\/common\/router\/router.cc:868] [C8][S10834556124828578161] upstream reset: reset reason connection termination<\/em><\/b><\/p>\n<p><b><em>[2019-09-08 12:09:37.190][26][debug][http] [source\/common\/http\/conn_manager_impl.cc:187] [C8][S10834556124828578161] doEndStream() resetting stream<\/em><\/b><\/p>\n<p><b><em>[2019-09-08 12:09:37.191][26][debug][http] [source\/common\/http\/conn_manager_impl.cc:1596] [C8][S10834556124828578161] stream reset<\/em><\/b><\/p>\n<p><b><em> [2019-09-08 12:09:37.191][26][debug][connection] [source\/common\/network\/connection_impl.cc:101] [C8] closing data_to_write=0 type=2<\/em><\/b><\/p>\n<p><b><em> [2019-09-08 12:09:37.191][26][debug][connection] [source\/common\/network\/connection_impl.cc:653] [C8] setting delayed close timer with timeout 1000 ms<\/em><\/b><\/p>\n<p><b><em>[2019-09-08 12:09:37.191][26][debug][pool] [source\/common\/http\/http1\/conn_pool.cc:129] [C9] client disconnected, failure reason:<\/em><\/b><\/p>\n<p><b><em> [2019-09-08 12:09:38.192][26][debug][connection] [source\/common\/network\/connection_impl.cc:642] [C8] triggered delayed close<\/em><\/b><\/p>\n<p><b><em> [2019-09-08 12:09:38.192][26][debug][connection] [source\/common\/network\/connection_impl.cc:190] [C8] closing socket: 1<\/em><\/b><\/p>\n<p><b><em> [2019-09-08 12:09:38.192][26][debug][connection] [source\/extensions\/transport_sockets\/tls\/ssl_socket.cc:270] [C8] SSL shutdown: rc=0<\/em><\/b><\/p>\n<p><b><em> [2019-09-08 12:09:38.192][26][debug][connection] [source\/extensions\/transport_sockets\/tls\/ssl_socket.cc:201] [C8]<\/em><\/b><\/p>\n<p><b><em> [2019-09-08 12:09:38.193][26][debug][main] [source\/server\/connection_handler_impl.cc:80] [C8] adding to cleanup list<\/em><\/b><\/p>\n<p><b><em> [2019-09-08 12:09:38.767][1][debug][main] [source\/server\/server.cc:170] flushing stats<\/em><\/b><\/p>\n<p>This coincides with the disconnect on the client<\/p>\n<p><a href=\"https:\/\/pi3g.com\/wp-content\/uploads\/2019\/09\/image-7.png\"><img loading=\"lazy\" decoding=\"async\" width=\"582\" height=\"132\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/pi3g.com\/wp-content\/uploads\/2019\/09\/image_thumb-7.png\" border=\"0\"><\/a><\/p>\n<p>As you can see, this is initiated by <\/p>\n<p><strong>[C9] remote Close<\/strong><\/p>\n<p>This again throws suspicion back upon VerneMQ disconnecting the client due to a timeout issue. <\/p>\n<h2>Paho Timing options<\/h2>\n<p>A good source for reading about MQTT and keep-alives is Steve\u2019s Internet Guide:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.steves-internet-guide.com\/mqtt-keep-alive-by-example\/\">http:\/\/www.steves-internet-guide.com\/mqtt-keep-alive-by-example\/<\/a><\/li>\n<\/ul>\n<p>The client must send keepalive packets (<strong>PINGREQ<\/strong>), in the absence of other control packets, <strong>and is responsible <\/strong>for the interval between the packets not exceeding the Keep Alive value set on the broker.<\/p>\n<p>The client can send the packets earlier<\/p>\n<p>The next step of the investigation lead to looking at Paho and the keepalive. My initial concern was that Paho would not send keepalives by itself, so that I would have to run a loop and send them. <\/p>\n<p>This, however, was found not to be true \u2013 Paho actually handles the keepalives itself.<\/p>\n<p>Here\u2019s the source code of Paho MQTT Javascript:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/eclipse\/paho.mqtt.javascript\/blob\/master\/src\/paho-mqtt.js\">https:\/\/github.com\/eclipse\/paho.mqtt.javascript\/blob\/master\/src\/paho-mqtt.js<\/a><\/li>\n<\/ul>\n<p>line 703 and following have the \u201cPinger\u201d.<\/p>\n<p>it defines a doTimeout function, which in turn returns doPing<\/p>\n<p>doPing is defined a bit further below, it runs the actual ping, and sets up a timeout, with this._keepAliveInterval.<\/p>\n<blockquote>\n<p>this._client.socket.send(pingReq);<br \/>this.timeout = setTimeout(doTimeout(this), this._keepAliveInterval);<\/p>\n<\/blockquote>\n<p>By now, I am pretty certain that the keepAliveInterval has to be decreased for Paho from the default 60 seconds. Possibly due to network latencies, what worked for me locally does not work remotely any more.<\/p>\n<p>how do we set up a different time interval?<\/p>\n<p>Paho documentation:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.eclipse.org\/paho\/files\/jsdoc\/Paho.MQTT.Client.html\">https:\/\/www.eclipse.org\/paho\/files\/jsdoc\/Paho.MQTT.Client.html<\/a><\/li>\n<\/ul>\n<p>The Paho client instance has a method connect, which takes an object as its single parameter.<\/p>\n<p>The object has different attributes, one of them being the keepAliveInterval:<\/p>\n<p><a href=\"https:\/\/pi3g.com\/wp-content\/uploads\/2019\/09\/image-8.png\"><img loading=\"lazy\" decoding=\"async\" width=\"688\" height=\"47\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/pi3g.com\/wp-content\/uploads\/2019\/09\/image_thumb-8.png\" border=\"0\"><\/a><\/p>\n<p>I set this keepAliveInterval to 30 sec. Here\u2019s the current set of parameters I use:<\/p>\n<blockquote>\n<p>var options = {<br \/>&nbsp;&nbsp;&nbsp;&nbsp; timeout: 3, \/* if conection not successfull within 3 seconds, it is deemed to have failed *\/<br \/>&nbsp;&nbsp;&nbsp;&nbsp; onSuccess: mqtt_onConnect_connect,<br \/>&nbsp;&nbsp;&nbsp;&nbsp; onFailure: mqtt_onConnectFailure_connect,<br \/>&nbsp;&nbsp;&nbsp;&nbsp; userName: params.userName,<br \/>&nbsp;&nbsp;&nbsp;&nbsp; password: params.password,<br \/>&nbsp;&nbsp;&nbsp;&nbsp; keepAliveInterval: 30,<br \/>&nbsp;&nbsp;&nbsp;&nbsp; useSSL: true,<br \/>&nbsp;&nbsp;&nbsp;&nbsp; reconnect: false,<br \/>&nbsp;&nbsp;&nbsp;&nbsp; mqttVersion: 4 <br \/>\n};<br \/>\nmqtt.connect(options);&nbsp;&nbsp;&nbsp; <\/p>\n<\/blockquote>\n<p>With mqtt being an instance of the Paho MQTT Client.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nachdem ich picockpit auf meinem Server installiert hatte, wurde ein Fehler festgestellt: Das Web-Frontend brach in regelm\u00e4\u00dfigen Abst\u00e4nden ab. Dies war in der lokalen Entwicklungsumgebung nicht der Fall. Benutzer von picockpit meldeten denselben Fehler. Ich habe den Fehler heute behoben und einen Hotfix eingespielt. Es stellte sich heraus, dass es ein Timing-Problem war. TL;DR wie...<\/p>","protected":false},"author":830,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[636,432,608],"tags":[708,481,600,710,599,713,598,715,712,709,711,589,714,602],"class_list":["post-13392","post","type-post","status-publish","format-standard","hentry","category-mqtt","category-picockpit","category-vernemq","tag-debug","tag-envoy","tag-javascript","tag-keepaliveinterval","tag-mqtt","tag-network","tag-paho","tag-pingreq","tag-remote","tag-timeout","tag-timing","tag-vernemq","tag-websocket","tag-websockets"],"_links":{"self":[{"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/posts\/13392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/users\/830"}],"replies":[{"embeddable":true,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/comments?post=13392"}],"version-history":[{"count":1,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/posts\/13392\/revisions"}],"predecessor-version":[{"id":13393,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/posts\/13392\/revisions\/13393"}],"wp:attachment":[{"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/media?parent=13392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/categories?post=13392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/tags?post=13392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}