<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=MQTT%3A_Arduino_Authentication</id>
	<title>MQTT: Arduino Authentication - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=MQTT%3A_Arduino_Authentication"/>
	<link rel="alternate" type="text/html" href="https://onnocenter.or.id/wiki/index.php?title=MQTT:_Arduino_Authentication&amp;action=history"/>
	<updated>2026-04-19T22:10:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.4</generator>
	<entry>
		<id>https://onnocenter.or.id/wiki/index.php?title=MQTT:_Arduino_Authentication&amp;diff=47847&amp;oldid=prev</id>
		<title>Onnowpurbo: Created page with &quot; /*   Basic MQTT example with Authentication      - connects to an MQTT server, providing username      and password    - publishes &quot;hello world&quot; to the topic &quot;outTopic&quot;    -...&quot;</title>
		<link rel="alternate" type="text/html" href="https://onnocenter.or.id/wiki/index.php?title=MQTT:_Arduino_Authentication&amp;diff=47847&amp;oldid=prev"/>
		<updated>2017-05-10T22:10:42Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; /*   Basic MQTT example with Authentication      - connects to an MQTT server, providing username      and password    - publishes &amp;quot;hello world&amp;quot; to the topic &amp;quot;outTopic&amp;quot;    -...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt; /*&lt;br /&gt;
  Basic MQTT example with Authentication&lt;br /&gt;
 &lt;br /&gt;
   - connects to an MQTT server, providing username&lt;br /&gt;
     and password&lt;br /&gt;
   - publishes &amp;quot;hello world&amp;quot; to the topic &amp;quot;outTopic&amp;quot;&lt;br /&gt;
   - subscribes to the topic &amp;quot;inTopic&amp;quot;&lt;br /&gt;
 */&lt;br /&gt;
 &lt;br /&gt;
 #include &amp;lt;SPI.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;Ethernet.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;PubSubClient.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 // Update these with values suitable for your network.&lt;br /&gt;
 byte mac[]    = {  0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };&lt;br /&gt;
 IPAddress ip(192, 168, 0, 4);&lt;br /&gt;
 IPAddress server(192, 168, 0, 100);&lt;br /&gt;
 &lt;br /&gt;
 void callback(char* topic, byte* payload, unsigned int length) {&lt;br /&gt;
   // handle message arrived&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 EthernetClient ethClient;&lt;br /&gt;
 PubSubClient client(server, 1883, callback, ethClient);&lt;br /&gt;
 &lt;br /&gt;
 void setup()&lt;br /&gt;
 {&lt;br /&gt;
   Ethernet.begin(mac, ip);&lt;br /&gt;
   // Note - the default maximum packet size is 128 bytes. If the&lt;br /&gt;
   // combined length of clientId, username and password exceed this,&lt;br /&gt;
   // you will need to increase the value of MQTT_MAX_PACKET_SIZE in&lt;br /&gt;
   // PubSubClient.h&lt;br /&gt;
   &lt;br /&gt;
   if (client.connect(&amp;quot;arduinoClient&amp;quot;, &amp;quot;mqtt-spy&amp;quot;, &amp;quot;123456&amp;quot;)) {&lt;br /&gt;
     client.publish(&amp;quot;outTopic&amp;quot;,&amp;quot;hello world&amp;quot;);&lt;br /&gt;
     client.subscribe(&amp;quot;inTopic&amp;quot;);&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void loop()&lt;br /&gt;
 {&lt;br /&gt;
   client.loop();&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Onnowpurbo</name></author>
	</entry>
</feed>