The JSON format is a text message composed of a succession of a name and associated value. 1
Here is an example of a JSON object coming from a LoRaWAN server. 2
JSON object is always delimited with curly braces. 3
Then inside we have the names and the values. At the bottom of this JSON object 4
for example, we have the name "description" and the associated value is "Device 1 OTAA description" 5
just above, the name "name" : the associated value, which is "Device 1 OTAA name" in 6
our example. 7
All values are string, but it can be a number, a boolean value, true or false, or another JSON object. 8
Look, for example, the first item as this name "ids" and the value is a Jason object starting from here 9
to there. 10
But often when we ask a server to send a JSON object with the information we need, it's not printed 11
like this, but instead it's like that. 12
Actually, this is the same message. 13
But the second one has been pretty pointed. To pretty print a 14
JSON object. 15
We need to use the JQ command. 16
If you don't have it installed on your MobaXTerm terminal, then you can do it with the MobApt package 17
manager button. 18
Then you need to search for the package. 19
JQ This one. 20
Once you've press this button, then follow the step and the JQ command will be available. 21
Now let's send a command to my LoRaWAN server. 22
I will use this command. 23
Don't worry. 24
We'll explain the content later. 25
But if we hit enter, then the result is not very readable. 26
However, if we type the same command and we add the vertical bar and JQ at the end, then the result 27
is perfect. 28
And that's what we'll often use.