Skip to content

Commit 03da7ab

Browse files
authored
Merge pull request #45 from micro-ROS/feature/6lowpan_tutorial
Adding 6lowpan tutorial to the webpage
2 parents 6515ff9 + 4941103 commit 03da7ab

3 files changed

Lines changed: 26 additions & 19 deletions

File tree

_data/docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- tutorials/advanced/nuttx_getting_started
1717
- tutorials/advanced/debugging-gdb-openocd
1818
- tutorials/advanced/debugging-vscode
19+
- tutorials/advanced/6lowpan_nuttx_rpi
1920

2021
- title: Concepts
2122
docs:

_docs/tutorials/advanced/6lowpan_nuttx_rpi/index.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# How to set 6lowpan communication between Raspbian and Nuttx.
1+
---
2+
title: 6LOWPAN communications between NuttX and a Raspberry Pi
3+
permalink: /docs/tutorials/advanced/6lowpan_nuttx_rpi/
4+
---
5+
26

37
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.
48

@@ -9,7 +13,7 @@ This guide will show how to set-up a Raspberry Pi 3 (RPI) running Raspbian and a
913
- Olimex-STM32-E407 board.
1014
- Two PMODRF2 module which are base on the MRF24J40 module.
1115
- 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).
1317
## How to set-up 6lowpan RPI?
1418

1519
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
2630
| CS | 26 | 1 |
2731

2832
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)
30-
[- PMODRF2 pionut.](https://reference.digilentinc.com/reference/pmod/pmodrf2/start)
33+
- [Raspberry Pi 3 pinout.](https://i.pinimg.com/originals/84/46/ec/8446eca5728ebbfa85882e8e16af8507.png)
34+
- [PMODRF2 pionut.](https://reference.digilentinc.com/reference/pmod/pmodrf2/start)
3135

32-
Once you've set all the wires, power-on the RPI and download the next repository inside the RPI.
33-
https://github.com/micro-ROS/micro-ROS-bridge_RPI
36+
Once you've set all the wires, power-on the RPI and download the next repository inside the RPI:
37+
- https://github.com/micro-ROS/micro-ROS-bridge_RPI
3438

3539
Execute the next command:
3640
```sudo ./micro-ROS-bridge_RPI/RPI_6lowpan/script.sh```
3741

38-
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:
3943
```dmesg | grep mrf24j40```
4044

4145
And if everything is fine, it should return the next:
@@ -56,9 +60,9 @@ The last point is to set-up the network.
5660
Now the RPI is ready to send and receive messages from a NuttX board or another RPI.
5761

5862

59-
## How to set-up 6lowpan NuttX?
63+
## How to set-up 6lowpan in NuttX?
6064

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.
6266

6367
- `Board D13` -> `MRF24J40 SCLK`
6468
- `Board D12` -> `MRF24J40 MISO`
@@ -68,7 +72,7 @@ First, we need to do the connections between the Olimex board and the PMODRF2 mo
6872

6973
Once the wiring is finished, we need to compile and upload the firmware. Type the next commands:
7074

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:
7276
`./scripts/configure.sh olimex-stm32-e407 mrf24j40-6lowpan`
7377

7478
Compile:
@@ -115,9 +119,10 @@ Builtin Apps:
115119
udp_6lowpan ping6 i8sak
116120
```
117121
118-
We're going to configure the network. Execute udp_6lowpan.
122+
We're going to configure the network. Execute `udp_6lowpan`.
119123
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.**
121126
122127
Then will ask you if you want to set this board as a coordinator or as a node.
123128
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
156161

157162
```
158163
159-
** At this point the network is ready to work!**
164+
**At this point the network is ready to work!**
160165
161166
Finally type ``quit`` two times to close the app and come back to the main menu.
162167
@@ -227,7 +232,7 @@ As you can see there is two IP in this network interface. But you need to rememb
227232
`fe80::9c6e:87a5:eb60:84d0``
228233

229234
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``
231236

232237
At this point, the RPI is ready to receive incoming packages.
233238

@@ -278,23 +283,23 @@ The Linux 6lowpan utility needs to have a ping response before sending a data pa
278283
If this does not work, do as follow:
279284
280285
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:
282287
```bash
283288
$ ip neigh # a bunch of address shall appear including yours (if you send a
284289
message already)
285290
fe80::2be:adde:de:fa00 dev lowpan0 FAILED
286291
$ sudo ip neigh delete fe80::2be:adde:de:fa00 dev lowpan0 # Remove it.
287292
```
288293
289-
Then once delete add the Nuttx device it permanently (until reboot):
294+
Then, once deleted, add the Nuttx device it permanently (until reboot):
290295
291296
```bash
292297
$ sudo ip neigh add fe80::2be:adde:de:fa00 dev lowpan0 00:be:ad:de:00:de:fa:00 # Add it with the
293298
corret Hardware address.
294299
```
295300
296301
### 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:
298303
```bash
299304
wpan0 Link encap:6LoWPAN HWaddr 00:be:ad:de:00:de:fa:00 at UP
300305
inet6 addr: fe80::2be:adde:de:fa00/64
@@ -322,7 +327,7 @@ Sent 0000 0000 0000 0000
322327
323328
For us is important to remember the **inet6_addr** which is: ``fe80::2be:adde:de:fa00``
324329
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.
326331
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.
327332
328333
```bash
@@ -336,7 +341,7 @@ Listening on 61616 for input packets
336341
337342
### Raspbian Part:
338343
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``
340345
341346
And execute with root privileges the next app: ``send_demo``.
342347
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:

_docs/tutorials/advanced/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ The aim of this section os to give a deeper insight of the different layers micr
88
TOC
99

1010
* [Getting started with Nuttx](/docs/tutorials/advanced/nuttx_getting_started/)
11+
* [Nuttx/Raspberry Pi 6lowpan Communications tutorial](/docs/tutorials/advanced/6lowpan_nuttx_rpi/)

0 commit comments

Comments
 (0)