You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This guide will show how to set-up a Raspberry Pi 3 (RPI) running Raspbian and an Olimex STM32 E407 board running NuttX to have 6lowpan communication between them.
4
8
@@ -9,7 +13,7 @@ This guide will show how to set-up a Raspberry Pi 3 (RPI) running Raspbian and a
9
13
- Olimex-STM32-E407 board.
10
14
- Two PMODRF2 module which are base on the MRF24J40 module.
11
15
- PC with Ubuntu (It works fine with Ubuntu 16.04)
12
-
16
+
- NuttX source code, you can find a Docker file with all the tools [here](https://github.com/micro-ROS/docker/tree/master/Embedded/NuttX/development/stm32-e407).
13
17
## How to set-up 6lowpan RPI?
14
18
15
19
First, we need to connect the PMODRF2 module to the RPI, so we need to set the next connections:
@@ -26,16 +30,16 @@ First, we need to connect the PMODRF2 module to the RPI, so we need to set the n
26
30
| CS | 26 | 1 |
27
31
28
32
In the next links you can see the pinout of each board:
29
-
[- Raspberry Pi 3 pinout.](https://i.pinimg.com/originals/84/46/ec/8446eca5728ebbfa85882e8e16af8507.png)
If everything goes fine, at the end of the script, the board should restart. After the start-up, type the next command to see if the configuration and the connection are fine:
42
+
If everything goes fine, at the end of the script, the board should restart. After the start-up, type the next command to see if the configuration and the connections are fine:
39
43
```dmesg | grep mrf24j40```
40
44
41
45
And if everything is fine, it should return the next:
@@ -56,9 +60,9 @@ The last point is to set-up the network.
56
60
Now the RPI is ready to send and receive messages from a NuttX board or another RPI.
57
61
58
62
59
-
## How to set-up 6lowpan NuttX?
63
+
## How to set-up 6lowpan in NuttX?
60
64
61
-
First, we need to do the connections between the Olimex board and the PMODRF2 module.
65
+
First, we need to do the connections between the [Olimex board](/docs/hardware_support) and the PMODRF2 module.
62
66
63
67
-`Board D13` -> `MRF24J40 SCLK`
64
68
-`Board D12` -> `MRF24J40 MISO`
@@ -68,7 +72,7 @@ First, we need to do the connections between the Olimex board and the PMODRF2 mo
68
72
69
73
Once the wiring is finished, we need to compile and upload the firmware. Type the next commands:
70
74
71
-
o to the main folder of NuttX and type the command to configure the board:
75
+
Go to the main folder of NuttX and type the command to configure the board:
We're going to configure the network. Execute udp_6lowpan.
122
+
We're going to configure the network. Execute `udp_6lowpan`.
119
123
The program will ask you if you want to configure the network. Type **Y** to start the configuration process.
120
-
**Important note:** If you don't configure the network, the connection won't be possible with other boards.**
124
+
125
+
**Important note: If you don't configure the network, the connection won't be possible with other boards.**
121
126
122
127
Then will ask you if you want to set this board as a coordinator or as a node.
123
128
The difference between a coordinator and a node is that the first one can work as a router, coordinating the network traffic of up to 8 nodes.
@@ -156,7 +161,7 @@ Available commands
156
161
157
162
```
158
163
159
-
**At this point the network is ready to work!**
164
+
**At this point the network is ready to work!**
160
165
161
166
Finally type``quit`` two times to close the app and come back to the main menu.
162
167
@@ -227,7 +232,7 @@ As you can see there is two IP in this network interface. But you need to rememb
227
232
`fe80::9c6e:87a5:eb60:84d0``
228
233
229
234
Go to the place where lives the repo that you downloaded previously. Go to ``micro-ROS-bridge_RPI/RPI_6lowpan/Examples/6lowpan_recv``
230
-
Finally, execute recv_demo telling to open the 61616 port. Type this command: ``./recv_demo 61616``
235
+
Finally, execute `recv_demo` telling to open the `61616` port. Type this command: ``./recv_demo 61616``
231
236
232
237
At this point, the RPI is ready to receive incoming packages.
233
238
@@ -278,23 +283,23 @@ The Linux 6lowpan utility needs to have a ping response before sending a data pa
278
283
If this does not work, do as follow:
279
284
280
285
Check if the Nuttx address is part within the Linux/Raspbian neighborhood table.
281
-
If it is, remove it:
286
+
If it is saved there, remove it:
282
287
```bash
283
288
$ ip neigh # a bunch of address shall appear including yours (if you send a
284
289
message already)
285
290
fe80::2be:adde:de:fa00 dev lowpan0 FAILED
286
291
$ sudo ip neigh delete fe80::2be:adde:de:fa00 dev lowpan0 # Remove it.
287
292
```
288
293
289
-
Then once delete add the Nuttx device it permanently (until reboot):
294
+
Then, once deleted, add the Nuttx device it permanently (until reboot):
290
295
291
296
```bash
292
297
$ sudo ip neigh add fe80::2be:adde:de:fa00 dev lowpan0 00:be:ad:de:00:de:fa:00 # Add it with the
293
298
corret Hardware address.
294
299
```
295
300
296
301
### NuttX part:
297
-
First we need the ip of the board, so type ``ifconfig`` in the main menu. This should return somenthing like this:
302
+
First, we need the ip of the board, so type ``ifconfig`` in the main menu. This should return somenthing like this:
298
303
```bash
299
304
wpan0 Link encap:6LoWPAN HWaddr 00:be:ad:de:00:de:fa:00 at UP
300
305
inet6 addr: fe80::2be:adde:de:fa00/64
@@ -322,7 +327,7 @@ Sent 0000 0000 0000 0000
322
327
323
328
For us is important to remember the **inet6_addr** which is: ``fe80::2be:adde:de:fa00``
324
329
325
-
Execute ``udp_6lowpan`` app, type ``N`` to the configuration request and finally type read, to start the receiving mode.
330
+
Execute ``udp_6lowpan`` app, type ``N`` to the configuration request and finally type `read`, to start the receiving mode.
326
331
Type the port that you want to open, for example, the 61616. And it should look like this mean is waiting for the incoming message.
327
332
328
333
```bash
@@ -336,7 +341,7 @@ Listening on 61616 for input packets
336
341
337
342
### Raspbian Part:
338
343
339
-
Go to the places that lives the previous download repo. Then go to this folder: ``/micro-ROS-bridge_RPI/RPI_6lowpan/Examples/66lowpan_send``
344
+
Go to the places that lives the previous download repo. Then go to this folder: ``/micro-ROS-bridge_RPI/RPI_6lowpan/Examples/6lowpan_send``
340
345
341
346
And execute with root privileges the next app: ``send_demo``.
342
347
These demos have two arguments: The first is the port to open in the destination and the second is the destination IP. An example of this specific demo could be:
0 commit comments