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
# How to set 6lowpan communication between Raspbian and Nuttx.
7
6
8
7
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.
9
8
@@ -14,7 +13,7 @@ This guide will show how to set-up a Raspberry Pi 3 (RPI) running Raspbian and a
14
13
- Olimex-STM32-E407 board.
15
14
- Two PMODRF2 module which are base on the MRF24J40 module.
16
15
- PC with Ubuntu (It works fine with Ubuntu 16.04)
17
-
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).
18
17
## How to set-up 6lowpan RPI?
19
18
20
19
First, we need to connect the PMODRF2 module to the RPI, so we need to set the next connections:
@@ -31,16 +30,16 @@ First, we need to connect the PMODRF2 module to the RPI, so we need to set the n
31
30
| CS | 26 | 1 |
32
31
33
32
In the next links you can see the pinout of each board:
34
-
[- 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:
44
43
```dmesg | grep mrf24j40```
45
44
46
45
And if everything is fine, it should return the next:
@@ -61,9 +60,9 @@ The last point is to set-up the network.
61
60
Now the RPI is ready to send and receive messages from a NuttX board or another RPI.
62
61
63
62
64
-
## How to set-up 6lowpan NuttX?
63
+
## How to set-up 6lowpan in NuttX?
65
64
66
-
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.
67
66
68
67
-`Board D13` -> `MRF24J40 SCLK`
69
68
-`Board D12` -> `MRF24J40 MISO`
@@ -73,7 +72,7 @@ First, we need to do the connections between the Olimex board and the PMODRF2 mo
73
72
74
73
Once the wiring is finished, we need to compile and upload the firmware. Type the next commands:
75
74
76
-
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`.
124
123
The program will ask you if you want to configure the network. Type **Y** to start the configuration process.
125
-
**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.**
126
126
127
127
Then will ask you if you want to set this board as a coordinator or as a node.
128
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.
@@ -161,7 +161,7 @@ Available commands
161
161
162
162
```
163
163
164
-
**At this point the network is ready to work!**
164
+
**At this point the network is ready to work!**
165
165
166
166
Finally type``quit`` two times to close the app and come back to the main menu.
167
167
@@ -232,7 +232,7 @@ As you can see there is two IP in this network interface. But you need to rememb
232
232
`fe80::9c6e:87a5:eb60:84d0``
233
233
234
234
Go to the place where lives the repo that you downloaded previously. Go to ``micro-ROS-bridge_RPI/RPI_6lowpan/Examples/6lowpan_recv``
235
-
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``
236
236
237
237
At this point, the RPI is ready to receive incoming packages.
238
238
@@ -283,23 +283,23 @@ The Linux 6lowpan utility needs to have a ping response before sending a data pa
283
283
If this does not work, do as follow:
284
284
285
285
Check if the Nuttx address is part within the Linux/Raspbian neighborhood table.
286
-
If it is, remove it:
286
+
If it is saved there, remove it:
287
287
```bash
288
288
$ ip neigh # a bunch of address shall appear including yours (if you send a
289
289
message already)
290
290
fe80::2be:adde:de:fa00 dev lowpan0 FAILED
291
291
$ sudo ip neigh delete fe80::2be:adde:de:fa00 dev lowpan0 # Remove it.
292
292
```
293
293
294
-
Then once delete add the Nuttx device it permanently (until reboot):
294
+
Then, once deleted, add the Nuttx device it permanently (until reboot):
295
295
296
296
```bash
297
297
$ sudo ip neigh add fe80::2be:adde:de:fa00 dev lowpan0 00:be:ad:de:00:de:fa:00 # Add it with the
298
298
corret Hardware address.
299
299
```
300
300
301
301
### NuttX part:
302
-
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:
303
303
```bash
304
304
wpan0 Link encap:6LoWPAN HWaddr 00:be:ad:de:00:de:fa:00 at UP
305
305
inet6 addr: fe80::2be:adde:de:fa00/64
@@ -327,7 +327,7 @@ Sent 0000 0000 0000 0000
327
327
328
328
For us is important to remember the **inet6_addr** which is: ``fe80::2be:adde:de:fa00``
329
329
330
-
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.
331
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.
332
332
333
333
```bash
@@ -341,7 +341,7 @@ Listening on 61616 for input packets
341
341
342
342
### Raspbian Part:
343
343
344
-
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``
345
345
346
346
And execute with root privileges the next app: ``send_demo``.
347
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