<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://leo.leung.xyz/wiki/index.php?action=history&amp;feed=atom&amp;title=ArduinoJson</id>
	<title>ArduinoJson - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://leo.leung.xyz/wiki/index.php?action=history&amp;feed=atom&amp;title=ArduinoJson"/>
	<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=ArduinoJson&amp;action=history"/>
	<updated>2026-10-04T23:15:46Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=ArduinoJson&amp;diff=5306&amp;oldid=prev</id>
		<title>Leo at 22:46, 26 July 2020</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=ArduinoJson&amp;diff=5306&amp;oldid=prev"/>
		<updated>2020-07-26T22:46:25Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:46, 26 July 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l47&quot;&gt;Line 47:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 47:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Project Website: https://arduinojson.org/&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Project Website: https://arduinojson.org/&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Navbox Tinkering}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Tinkering]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Leo</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=ArduinoJson&amp;diff=5291&amp;oldid=prev</id>
		<title>Leo: Created page with &quot;ArduinoJson is an Arduino library that makes it easier to parse and generate JSON output. This is useful to save multiple parameters into a config file in SPIFFS or to generat...&quot;</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=ArduinoJson&amp;diff=5291&amp;oldid=prev"/>
		<updated>2020-07-26T18:02:02Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;ArduinoJson is an Arduino library that makes it easier to parse and generate JSON output. This is useful to save multiple parameters into a config file in SPIFFS or to generat...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;ArduinoJson is an Arduino library that makes it easier to parse and generate JSON output. This is useful to save multiple parameters into a config file in SPIFFS or to generate or parse MQTT messages.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
Install the ArduinoJson library in the Arduino library manager. Be aware that the latest version of ArduinoJson is version 6 and is not compatible with version 5.&lt;br /&gt;
&lt;br /&gt;
=== AdrduinoJson 5 ===&lt;br /&gt;
Include the header :&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = #include &amp;lt;ArduinoJson.h&amp;gt;&lt;br /&gt;
| lang = c&lt;br /&gt;
}}&lt;br /&gt;
To generate JSON output, create a new &amp;lt;code&amp;gt;JsonObject&amp;lt;/code&amp;gt; and use it like a dictionary. Use &amp;lt;code&amp;gt;printTo()&amp;lt;/code&amp;gt; to generate the JSON output.&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = DynamicJsonBuffer jsonBuffer;&lt;br /&gt;
JsonObject&amp;amp; json = jsonBuffer.createObject();&lt;br /&gt;
&lt;br /&gt;
# You can specify values with various types. Eg. char* or literal strings&lt;br /&gt;
json[&amp;quot;name&amp;quot;] = sensor_name;&lt;br /&gt;
json[&amp;quot;command&amp;quot;] = &amp;quot;push&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
# Floats and ints&lt;br /&gt;
json[&amp;quot;measurement_f&amp;quot;] = 12.2;&lt;br /&gt;
json[&amp;quot;measurement_i&amp;quot;] = 12;&lt;br /&gt;
&lt;br /&gt;
# Boolean&lt;br /&gt;
json[&amp;quot;measurement_b&amp;quot;] = true;&lt;br /&gt;
&lt;br /&gt;
# Convert into a JSON message as char array&lt;br /&gt;
char payload[256];&lt;br /&gt;
json.printTo(payload);&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
To parse JSON data:&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = DynamicJsonBuffer jsonBuffer;&lt;br /&gt;
JsonObject&amp;amp; json = jsonBuffer.parseObject(jsonpayload);&lt;br /&gt;
&lt;br /&gt;
// Copy out the strings or do parsing as necessary.&lt;br /&gt;
if (json.success()) {&lt;br /&gt;
	strcpy(mqtt_server, json[&amp;quot;mqtt_server&amp;quot;]);&lt;br /&gt;
	mqtt_port = atoi(json[&amp;quot;mqtt_port&amp;quot;])&lt;br /&gt;
}&lt;br /&gt;
| lang = c&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* Project Website: https://arduinojson.org/&lt;/div&gt;</summary>
		<author><name>Leo</name></author>
	</entry>
</feed>