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
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.
7
7
8
8
# What is 6LoWPAN?
9
9
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.
12
12
- 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.
14
14
15
15
# What do you need to try?
16
16
@@ -22,7 +22,7 @@ At this moment this communication protocol is only available for NuttX RTOS. You
22
22
23
23
**Important!**
24
24
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.
26
26
27
27
# Configure the board
28
28
@@ -37,25 +37,26 @@ First we're going to connect the Pmodrf2 radio. To do so, follow the next wiring
37
37
-`Board D10` -> `MRF24J40 CS`
38
38
-`Board D8` -> `MRF24J40 INT`
39
39
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.
41
41
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)
42
42
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).
44
44
45
-
From the hardware point, everything is ready.
45
+
Let's continue with the next step
46
46
## Set-up the software
47
47
48
48
To create and flash the firmware, we're going to use the micro-ROS build system.
49
49
50
50
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``.
52
52
53
53
Once you follow all the instructions on the build system, and the board is flashed everything is ready.
54
54
55
55
# How to use it?
56
56
57
57
- 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
+
59
60
```bash
60
61
help usage: help [-v] [<cmd>]
61
62
@@ -70,10 +71,12 @@ Builtin Apps:
70
71
ping6 i8sak uros_6lowpan
71
72
```
72
73
- Now turn-on the Raspberry Pi and execute the micro-ROS hardware bridge tool, by typing the next command:
74
+
73
75
```bash
74
76
./ ~/micro-ROS-HB.sh
75
77
```
76
78
- Once everything is configured, it will return the connection data of the 6LowPAN network:
79
+
77
80
```bash
78
81
lowpan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1280
- 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``.
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
90
126
```
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.
0 commit comments