Skip to content

Commit 9e55a7d

Browse files
author
jfm92
committed
Improving micro-ROS 6lowpan tutorial
1 parent 2e099c8 commit 9e55a7d

2 files changed

Lines changed: 59 additions & 11 deletions

File tree

_data/docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
- tutorials/advanced/6lowpan_nuttx_rpi
4747
- tutorials/advanced/tracing
4848
- tutorials/advanced/microros_nuttx_bsp
49+
- tutorials/advanced/microros_6lowpan_tutorial
4950

5051
- title: Demos
5152
docs:

_docs/tutorials/advanced/microros_6lowpan_tutorial/index.md

Lines changed: 58 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ title: Micro-ROS 6LoWPAN Guide
33
permalink: /docs/tutorials/advanced/microros_6lowpan_tutorial/
44
---
55

6-
On this guide we will show how to use Micro-ROS over 6LoWPAN communication.
6+
In this guide, we will show how to use Micro-ROS over 6LoWPAN communication.
77

88
# What is 6LoWPAN?
99

10-
6LoWPAN is acronym base of IPv6 over Low -Power Wireless Personal Area Networks. This communication protocol allows wireless communication over IEEE 802.15.4 based network using IPv6. Some of the main advantage are:
11-
- Easy to route from radio devices to the Internet, thanks to ussage of the IP packets.
10+
6LoWPAN is an acronym base of IPv6 over Low -Power Wireless Personal Area Networks. This communication protocol allows wireless communication over IEEE 802.15.4 based network using IPv6. Some of the main advantages are:
11+
- Easy to route from radio devices to the Internet, thanks to the usage of the IP packets.
1212
- Easy to use on UDP and TCP server/clients.
13-
- Protocol designed for low power and constrain devices. Perfect for Micro-ROS remote sensors.
13+
- A protocol designed for low power and constrained devices. Perfect for Micro-ROS remote sensors.
1414

1515
# What do you need to try?
1616

@@ -22,7 +22,7 @@ At this moment this communication protocol is only available for NuttX RTOS. You
2222

2323
**Important!**
2424
You can find a guide of how to set-up the Micro-ROS hardware bridge on the next link: [uROS hardware bridge guide](https://github.com/micro-ROS/micro-ROS-bridge_RPI/blob/new_bridge_tools/Readme.md)
25-
On the micro-ROS hardware bridge guide you can find everything that you need to set-up this device base.
25+
On the micro-ROS hardware bridge guide, you can find everything that you need to set-up this device base.
2626

2727
# Configure the board
2828

@@ -37,25 +37,26 @@ First we're going to connect the Pmodrf2 radio. To do so, follow the next wiring
3737
- `Board D10` -> `MRF24J40 CS`
3838
- `Board D8` -> `MRF24J40 INT`
3939

40-
The ``D`` reference to the Arduino header pins of the board.
40+
The ``D`` letter, reference to the Arduino header pins of the board.
4141
To help on the set-up process, you can find the pinout of the radio on the next link: [PmodRF2 pinout](https://reference.digilentinc.com/reference/pmod/pmodrf2/start)
4242

43-
The last point, is connect a mini-USB cable to the OTG2 USB port (The USB port next to the Ethernet port).
43+
The last point is to connect a mini-USB cable to the OTG2 USB port (The USB port next to the Ethernet port).
4444

45-
From the hardware point, everything is ready.
45+
Let's continue with the next step
4646
## Set-up the software
4747

4848
To create and flash the firmware, we're going to use the micro-ROS build system.
4949

5050
You can find the instructions on the next link: [Micro-ROS build system](https://github.com/micro-ROS/micro-ros-build/blob/dashing/micro_ros_setup/README.md).
51-
For this particular guide, is necessary to use the branch ``dashing`` and use the configuration profiel ``uros_6lowpan``.
51+
For this particular guide, it is necessary to use the branch ``dashing`` and use the configuration profile ``uros_6lowpan``.
5252

5353
Once you follow all the instructions on the build system, and the board is flashed everything is ready.
5454

5555
# How to use it?
5656

5757
- Turn on the Olimex-STM32-E407 board and open the NSH console on a terminal.
58-
- Check if all the applications are ready by typing ``?`` on the console. It should the return the next:
58+
- Check if all the applications are ready by typing ``?`` on the console. It should then return the next:
59+
5960
```bash
6061
help usage: help [-v] [<cmd>]
6162

@@ -70,10 +71,12 @@ Builtin Apps:
7071
ping6 i8sak uros_6lowpan
7172
```
7273
- Now turn-on the Raspberry Pi and execute the micro-ROS hardware bridge tool, by typing the next command:
74+
7375
```bash
7476
./ ~/micro-ROS-HB.sh
7577
```
7678
- Once everything is configured, it will return the connection data of the 6LowPAN network:
79+
7780
```bash
7881
lowpan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1280
7982
inet6 fe80::b482:ca65:743b:b6bd prefixlen 64 scopeid 0x20<link>
@@ -86,8 +89,52 @@ lowpan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1280
8689
1) Add new 6LoWPAN micro-ROS device 3) Create UDP micro-ROS Agent 5) Create Serial micro-ROS Agent server
8790
2) Create UDP 6LoWPAN micro-ROS Agent 4) Create TCP micro-ROS Agent 6) Quit
8891
#?
92+
```
93+
- The value **inet6** is the IPV6 direction of the Raspberry Pi over the 6LoWPAN interface. Copy it, because is necessary on further steps.
94+
95+
- Go to the Olimex-STM32-E407 board and execute the micro-ROS 6lowpan application, by typing the next command: ``uros_6lowpan <Agent_IP> <Agent_Port> <pub/sub>
96+
- Agent_IP: In this field, you should write the IP of the Agent, on this specific example, the IP that you copy on the previous step.
97+
- Agent_PORT: Write the port that you want to open for micro-ROS communications.
98+
- pub/sub: If you write **pub**, it will create a micro-ROS publisher, which will publish an integer numbers up to one thousand. Otherwise, if you write **sub** it will create a subscriber that will be subscribe to the ``std_msgs_msg_Int32`` topic.
99+
100+
- Once you execute the app, it will ask you if you want to configure the 6LoWPAN network. (Necessary to configure each time that you reboot the board)
101+
- Introduce your ID. It must be a hexadecimal number between 0 and FF.
102+
- This will return connection data, you should save the ``inet_6_addr`` and ``HWaddr``.
89103
104+
```bash
105+
nsh> uros_6lowpan fe80::bc81:c3b9:5c14:1ab 8888 pub
106+
Do you want to configure the 6lowpan network? (Y/N)
107+
ifdown wpan0...OK
108+
i8sak: resetting MAC layer
109+
i8sak: starting PAN
110+
Introduce your 6LowPan ID (It must between 00 and FF (Hex))
111+
i8sak: accepting all assoc requests
112+
i8sak: daemon started
113+
ifup wpan0...OK
114+
Connection data
115+
wpan0 Link encap:6LoWPAN HWaddr 00:be:ad:de:00:de:fa:00 at UP
116+
inet6 addr: fe80::2be:adde:de:fa00/64
117+
inet6 DRaddr: ::/64
118+
119+
RX: Received Fragment Errors
120+
00000000 00000000 00000000
121+
IPv6 Dropped
122+
00000000 00000000
123+
TX: Queued Sent Errors Timeouts
124+
00000000 00000000 00000000 00000000
125+
Total Errors: 00000000
90126
```
91-
- Copy the value **inet6**, this will usefull on the next steps, because the IPV6 direcction of the RPI on the 6LoWPAN network.
127+
- After this step, the application on the Olimex board will be blocked waiting for a user input confirming that the Agent on the hardware bridge is ready to receive data.
128+
129+
- Come back to the hardware bridge, now we're going to add a new 6lowpan device. Push ``1 + enter``. (Note: This step is only necessary if you're attaching for the first time a new device)
130+
- First, introduce the IPV6 of the Olimex board (inet6_addr)
131+
- Introduce the hardware address of the Olimex board (Hwaddr).
132+
- Now the device is registered and ready to establish communication.
133+
- The final step on the hardware bridge is to execute the micro-ROS Agent, to do so, push ``2 + enter`` and introduce the port to use.
134+
135+
- Finally, on the Olimex board, push ``y`` to confirm that everything is ready and it will start the micro-ROS application.
136+
137+
138+
92139
93140

0 commit comments

Comments
 (0)