Skip to main content
Gz_it
Associate III
November 27, 2020
Question

How to use S2-LP with contiki?

  • November 27, 2020
  • 11 replies
  • 4278 views

Hi All;

I would like to know how to use S2-LP with contiki. I saw border-router, serial sniffer, udp client and udp server are example code. I don't saw sensor node to example code. Could you please advice me about how to build sensor node project with STM32CubeIDE?

Best regards.

This topic has been closed for replies.

11 replies

MGREL
ST Employee
January 26, 2021

Hello,

X-CUBE-SUBG2 integrates contiki-NG stack ("os" folder, currently only CSMA MAC is validated, not TSCH).

It provides 3 applications coming with Contiki-NG: UDP Client and Server (from "rpl-udp" example) and Border Router (from "rpl-border-router" example).

It also deliver Serial Sniffer application in order to be able to capture RF packets.

Which specific example are you referring to?

In general, if you start from a given example, say UDP Client, you can modify it by replacing the application code (udp-client.c) with the new one(s) from the Contiki-NG examples folders.

Gz_it
Gz_itAuthor
Associate III
January 26, 2021

Hello @MGREL​ ;

Thank you for your reply.

I would like an example code for sensor node send the data( MESH ) to Border Router. Could you please advice me this issue?

Thank you,

Best regards.

Tesla DeLorean
Guru
January 26, 2021

This is probably getting beyond a functionality demo and into an actual final application. Perhaps work with the FAE responsible for your account, they might be able to assist directly, or suggest local contractors with suitable experience in developing end-to-end solution.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
MGREL
ST Employee
January 26, 2021

Hello,

if you want to send data through the Border Router from 6LowPAN network to a IPv6 host you can do as described in the documentation:

https://www.st.com/resource/en/user_manual/dm00674239-getting-started-with-xcubesubg2-sub1-ghz-rf-software-expansion-for-stm32cube-stmicroelectronics.pdf

page 28, i.e. you need to recompile the UDP Client to send data to a specific address (the one that you pass to the Border Router via tunslip6 or wpcapslip6 application) and use a UDP Server that runs on the host (PC) in order to receive the data.

This scenario is conceptually similar to UDP Client and Server, since the UDP Server sets itself as root of the RLP tree, just like the Border Router, and the UDP Client in the default configuration sends data to the RPL tree root.

Mesh (multi-hop) is enabled by default with rpl lite protocol.

Gz_it
Gz_itAuthor
Associate III
January 28, 2021

Hello @MGREL​ ;

Thank you for your reply.

I am try this your solution. My network is not mesh tropology. show photo below

0693W000007CyFrQAK.jpgThis photo. Client 2 should send the data to Client 1 then Client1 send the data from Client 2 to Border router.

0693W000007CyG6QAK.jpgThis photo to show message client 1.

0693W000007CyGfQAK.jpg 

Could you please advice me to make mesh tropology with S2-LP ( Client mesh example )?

Thank you,

Best regards.

MGREL
ST Employee
January 28, 2021

Hello,

if you configured both the UDP Clients to send data to "aaaa::1" address it is normal that you see the UDP messages on the UDP Server running on the host, this regardless the fact that the network topology is star or mesh.

To try to setup a mesh (multi-hop) you can try to setup a linear topology with the second node in the radio range of only the first node:

BR ------- NODE1 -]------ NODE2

Where ']' is the end of BR's radio range.

Not sure if I replied to your question...

Gz_it
Gz_itAuthor
Associate III
February 4, 2021

Hello @MGREL​ ;

Could you advise me for parameter in Border Router example code to keep message from client?

Thank you,

Best regards.

MGREL
ST Employee
February 4, 2021

Hello,

if you mean UDP Messages they are not sent "to" the Border Router but to one of the addresses of the UDP Server, in this scenario the Border Router forwards these messages over the serial line to the host PC.

Since the "console" of the border router is actually the wpcapslip6 tool, you can invoke it with some verbosity (-v).

The reason why I suggest you to test with the UDP Server firmware as well is that the scenario is actually the same except for the forwarding over the serial line, this can help in identifying issues.

Also if you recompile the code without Link Layer security, you can then use the serial sniffer and dump RF packets.

If you mean RPL messages, you have to enable RPL Debug level, this can be done using the console on UDP Client and Server ("log rpl N" where N is the debug level that you want) or recompiling the Border Router with specific DBG level (project-conf.h).

BR

Gz_it
Gz_itAuthor
Associate III
February 6, 2021

Hello, @MGREL​ ;

Thank you for your reply.

I try to your solution. It's work. I saw message from log data but the message is not decode. I can't decryption. Could you please advice about solution this issue?

Thank you,

Best regards.

MGREL
ST Employee
February 8, 2021

To disable Link Layer security and so see packets in clear in Wireshark using the Serial Sniffer you can recompile UDP Client / Server / Border Router after changing

#define LLSEC802154_CONF_ENABLED 1

to

#define LLSEC802154_CONF_ENABLED 0

in contiki-conf.h file

BR

Gz_it
Gz_itAuthor
Associate III
February 9, 2021

Hello, @MGREL​ ;

Thank you for your replay.

I try your advice. It's working. I would like to show a photo below

0693W000007ERalQAG.jpg I would like to turn off the message from Border Router is "Waiting for prefix" and I would like to show the message from client at serial terminal. Show a photo below

0693W000007ERaqQAG.jpg Could you please advice me the solution for this issue ?

Thank you,

Best regards.

Gz_it
Gz_itAuthor
Associate III
February 10, 2021

Hello, @MGREL​ ;

I would like to show a photo. The first time will not work when I open terminal for Border router and terminal for Client.

0693W000007EdWvQAK.jpg 

When I use PowerShell. It's working. I would like to know how I can setup all without PowerShell. Show a photo below

0693W000007EdXyQAK.jpg 

Could you please advice me this issue?

Thank you,

Best regards.

MGREL
ST Employee
February 11, 2021

Hello, I am not sure if I have understood the problem. The Border Router can work only if connected to tunslip6/wpcapslip6 because it needs

  • the parameters to form the network (network prefix and host address)
  • the user space tunnel application to connect to the host protocol stack

so if you use a terminal you just see Border router output that is basically SLIP6 packets (and debug messages if you enable them)

If you don't need to send UDP data to the host PC you can use the UDP Server firmware that implements also the RPL root.

Gz_it
Gz_itAuthor
Associate III
February 13, 2021

Hello @MGREL​ ;

Thank you for your reply.

If I have understood. Could I use UDP Server instead Border router for receive message from client ( MESH Network)?

I try UDP Server. It's point to point.

Thank you,

Best regards.

MGREL
ST Employee
February 16, 2021

UDP Sender firmware is root of the RPL network just like the Border Router, if you can get multihop with the latter you should be able also with the former, the only "issue" is to verify this, maybe you can use the shell (on UDP Client) to see the rpl status, like:

> rpl-status

RPL status:

-- Instance: 0

-- DAG node

-- DAG: fd00::51:3430:5233:8131, version 240

-- Prefix: fd00::/64

-- MOP: Non-storing

-- OF: MRHOF

-- Hop rank increment: 128

-- Default lifetime: 1800 seconds

-- State: Reachable

-- Preferred parent: fe80::51:3430:5233:8131 (last DTSN: 240)

-- Rank: 286

-- Lowest rank: 286 (1024)

-- DTSN out: 240

-- DAO sequence: last sent 241, last acked 241

-- Trickle timer: current 14, min 12, max 20, redundancy 0

Gz_it
Gz_itAuthor
Associate III
February 17, 2021

Hello, @MGREL​ ; 

  Thank you for your reply.

  Could I edit lifetime in UDP Server? I found when the client can't to UDP Server. It can't reconnect. I must to reset the UDP Client board and I don't see UDP client create hop-to-hop.

Could you please advice me to solve this issue?

Thank you,

Best reagards.