0
1
00:00:00,930 --> 00:00:06,810
The JSON format is a text message composed of a succession of a name and associated value.
1

2
00:00:07,230 --> 00:00:11,250
Here is an example of a JSON object coming from a LoRaWAN server.
2

3
00:00:12,000 --> 00:00:15,570
JSON object is always delimited with curly braces.
3

4
00:00:15,960 --> 00:00:22,800
Then inside we have the names and the values. At the bottom of this JSON object
4

5
00:00:22,800 --> 00:00:31,740
for example, we have the name "description" and the associated value is "Device  1 OTAA description"
5

6
00:00:31,920 --> 00:00:41,250
just above, the name "name" : the associated value, which is "Device  1 OTAA name" in
6

7
00:00:41,250 --> 00:00:42,130
our example.
7

8
00:00:42,150 --> 00:00:50,490
All values are string, but it can be a number, a boolean value, true or false, or another JSON object.
8

9
00:00:50,520 --> 00:00:58,980
Look, for example, the first item as this name "ids" and the value is a Jason object starting from here
9

10
00:00:59,220 --> 00:01:00,270
to there.
10

11
00:01:00,930 --> 00:01:07,350
But often when we ask a server to send a JSON object with the information we need, it's not printed
11

12
00:01:07,350 --> 00:01:10,170
like this, but instead it's like that.
12

13
00:01:10,710 --> 00:01:13,170
Actually, this is the same message.
13

14
00:01:13,170 --> 00:01:17,220
But the second one has been pretty pointed. To pretty print a
14

15
00:01:17,460 --> 00:01:18,450
JSON object.
15

16
00:01:18,450 --> 00:01:20,970
We need to use the JQ command.
16

17
00:01:21,180 --> 00:01:26,670
If you don't have it installed on your MobaXTerm terminal, then you can do it with the MobApt package
17

18
00:01:26,670 --> 00:01:27,780
manager button.
18

19
00:01:29,330 --> 00:01:31,570
Then you need to search for the package.
19

20
00:01:31,580 --> 00:01:34,040
JQ This one.
20

21
00:01:34,730 --> 00:01:40,610
Once you've press this button, then follow the step and the JQ command will be available.
21

22
00:01:41,240 --> 00:01:43,940
Now let's send a command to my LoRaWAN server.
22

23
00:01:44,090 --> 00:01:45,830
I will use this command.
23

24
00:01:45,860 --> 00:01:46,730
Don't worry.
24

25
00:01:46,730 --> 00:01:48,710
We'll explain the content later.
25

26
00:01:48,980 --> 00:01:53,600
But if we hit enter, then the result is not very readable.
26

27
00:01:53,810 --> 00:02:01,190
However, if we type the same command and we add the vertical bar and JQ at the end, then the result
27

28
00:02:01,190 --> 00:02:02,420
is perfect.
28

29
00:02:02,780 --> 00:02:04,550
And that's what we'll often use.
