This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

6LOWPAN(Contiki) RPL Modes

Other Parts Discussed in Thread: CC2538, CC2650, CC2650STK, CC2531EMK

Hi,

As I know, In zigbee there are 3 types of nodes.
1- Coordinator: Every network must have 1 coordinator. It starts and coordinates the wireless network.
2- End Device: It cannot route packets. If there is no rf link between end device and coordinator a Router can be used, then router acts as repeater.
3- Router: Can route packets.

Coordinator and Router should be connected to mains powered. End devices can be supplied by battery.

But I couldnot find detailed explanation of contiki(6lowpan) node types. I only found this text github.com/.../RPL-modes
and e2e.ti.com/.../1496090
I learned that 6lowpan also has 3 types of nodes (Mesh, leaf and feather)
I have some questions about these node types

1- Can anyone explain or give a link to a resource which explains this topic.

2- how can i choose mode of rf node at contiki source code. Is there a #define that is used to select mode

3- Suppose that mesh rf nodes dont need to be connected to internet. So there is no Border router(6lbr). How can i do it. Can you suggest an example project in contiki.
   All rf Nodes will be battery powered but are not connected to internet. I need nodes acts as repeater(router). What will be the current consumption of the battery powered nodes.   
   at the link e2e.ti.com/.../1496090
  Mr Jonas says that "We are looking at about 450uA when waiting for packets. (measured including the active RX period) this is measured with the default 8Hz channel check rate. "
 But if nodes consumes 450ua continous current.  at 1 year we need  3,942mah battery capacity (450ua * 24 hours * 365 days =  3,942 mah  ~= 4 amperhours capacity battery)
And this current value is for only rf communication(not total board consumption).
 For 5 years we need 20 Ah battery. I think current consumption is very high. I think it should be around 10 or 20 microampers for 5 years of battery life.
How can i reduce 450ua to a lower value. Is it possible ? Can I use 2Hz channel check rate.

4- As an addition to 3rd question, suppose mesh networked nodes are running at the field. I go to field a rf sniffer node. And I want to send a command to any node or read sensors values from the nodes
    How can I do this. should rf sniffer node join the mesh network to be able to do this.

5- Suppose I have 2 nodes which doesnt connect internet also. I want to send rf data from 1 node to another and vice versa. Which example code should I use.  (For example for zigbee I
configure 1 node as coordinator, then other node as router or end device)

thanks
Serdar ARSLAN

  • Hi Serdar,

    There are no such thing as a Edn Device in IP world, i.e. the router/parent does not keep messages for a child that is sleeping. This has to be handled at the application layer. Have a look at COAP, it might solve your issue.

    I think the way to set device type (mesh, leaf, and feather) is explained in the wiki you mention. You can do it run time.

    A 6LoWPAN network always have a Edge Router, no matter if it is connected to Internet or not. At least one device need to have the Edge Router role. It can very well be an embedded device like CC2538. This is e.g. described here: github.com/.../CC2538DK-Software-Configuration the /examples/ipv6/rpl-border-router in Contiki should also run out of the box on cc2538.

    In order to further reduce current consumption several things can be made:
    1) Implement tickless mode in Contiki so that the system does not wake up just to find that it got no event to handle.
    2) Use the feather mode and make an application that can receive multicast messages, and use the payload to enter mesh mode at run time.

    I can let you know that we are working on ways to further improve the current consumption for cc26xx in Contiki.

    For your question 4, I would again suggest to look at the feather concept. Feather devices can receive multicast messages and take action.

    For a simple node to node communcation, I suggest to look at /examples/ipv6/rpl-udp or multicast.

    Best,
    Jonas
  • Hi Jonas,

    I couldnt understand somethings. Can you clarify these.

    I think the way to set device type (mesh, leaf, and feather) is explained in the wiki you mention. You can do it run time.

    How can we do it at run time. which commands should I use can you give an example.


    A 6LoWPAN network always have a Edge Router, no matter if it is connected to Internet or not. At least one device need to have the Edge Router role. It can very well be an embedded device like CC2538. This is e.g. described here: github.com/.../CC2538DK-Software-Configuration the /examples/ipv6/rpl-border-router in Contiki should also run out of the box on cc2538.

    we are producing electricty, water, gas, heat meters. I am planning to add cc2650 module to these meters. I have 2 configuration.
    First: I will attach cc2650 module to meters.I will load cc26xx-web-demo to CC2650. meter's host processor will communicate with the cc2650by using uart.
    Net-uart application is suitable for this purpose. meters will send meter datas to a broker. In this set up also I will use beagle bone black(BBB) and 6lbr program. should I use a labtop or desktop computer as default router?

    Second configuration: Meters will not connect to internet. So I will not use BBB.  As I understood I should program one meter's cc2650 with /examples/ipv6/rpl-border-router program.For meter nodes I will use again cc26xx-web-demo program. I will use cc2650 attached hand held unit to read meter datas. Should this attached sniffer(cc2650) join the network to read meter datas.
    How long does it take this joing process.


    In order to further reduce current consumption several things can be made:
    1) Implement tickless mode in Contiki so that the system does not wake up just to find that it got no event to handle.
    2) Use the feather mode and make an application that can receive multicast messages, and use the payload to enter mesh mode at run time.

    How can I do these. Can you explain a bit more. Can you give me a link to a resource which explains device type (mesh, leaf, and feather) concepts.

    Best Regards.
    Serdar ARSLAN

  • Hello,

    By using the commands defined in rpl.h:

    /**
    * RPL modes
    *
    * The RPL module can be in either of three modes: mesh mode
    * (RPL_MODE_MESH), feater mode (RPL_MODE_FEATHER), and leaf mode
    * (RPL_MODE_LEAF). In mesh mode, nodes forward data for other nodes,
    * and are reachable by others. In feather mode, nodes can forward
    * data for other nodes, but are not reachable themselves. In leaf
    * mode, nodes do not forward data for others, but are reachable by
    * others. */
    enum rpl_mode {
    RPL_MODE_MESH = 0,
    RPL_MODE_FEATHER = 1,
    RPL_MODE_LEAF = 2,
    };

    /**
    * Set the RPL mode
    *
    * \param mode The new RPL mode
    * \retval The previous RPL mode
    */
    enum rpl_mode rpl_set_mode(enum rpl_mode mode);

    /**
    * Get the RPL mode
    *
    * \retval The RPL mode
    */
    enum rpl_mode rpl_get_mode(void);

    If you do not need parts of the cc26xx-web-demo it can easily be modified in the /example/cc26xx/cc26xx-web-demo/project-conf.h :

    E.g to only run COAP server, and the 6lbr client (to enable a topology view in ER webserver):

    /* Enable/Disable Components of this Demo */
    #define CC26XX_WEB_DEMO_CONF_MQTT_CLIENT 0
    #define CC26XX_WEB_DEMO_CONF_6LBR_CLIENT 1
    #define CC26XX_WEB_DEMO_CONF_COAP_SERVER 1
    #define CC26XX_WEB_DEMO_CONF_NET_UART 0

    Webserver is not configurable since it does not generate any traffic.

    net-uart will send data received on the serial port to any IPv6 address, if you have enabled NAT64 module in the Edge Router, you can send data out on Internet if you which. You can configure the IP address to send data to via the webserver, for easy testing.

    Default router needs to be entered in the 6LBR config since the router need to have a default route to send packets received which are not in the routing table. The IP address entered need to be a valid IP address in the subnet, it can be any device, as long as it replies to pings.


    For the system when not connected to Internet you are right you can use the suggested edge router application. You need to implement the applicaiton that reads the data, and also the applicaiton that send out the data. This is not done in the examples you are referring to above. I suggest to look at a feather example, it would be a good solution. I.e. all meters can send multicast periodically and the "sniffer" device just picks those messages up. Look at the /examples/ipv6/multicast example on how to send multicast messages. When a FEATHER device receives a multicast with payload "become a mesh device" it can call the rpl_set_mode() to become connected, and send/receive data to any IP address.

    Tickless mode for Contiki is coming in an future release, stay tuned! As soon as I have more information I will share it with you.

    Jonas
  • Hi,

    Let me clarify setup. I will use cc2650 as wireless modem. CC2650 modem board will receive data from uart, then it will send to wireless. And received Wireless data will be send to uart. Suppose I have 10 meters. They will not connect to internet. So network is ad-hoc network. I will load cc2650_web_demo to 9 cc2650 modem boards. Then I will program one cc2650 modem with rpl_border_router program. But I examined rpl_border_router program. It communicates with a computer (slip-bridge). Should I change rpl_border_router program. Should I remove slip-bridge codes from project. Because rpl_border_roter doesnt send packects received from uart to wireless Also I need to add net-uart.c file to project(Does it work automaticly , if I add net-art.c and net-uart.h files to project).

    For second alternative solution for this setup, Suppose I  use cc2650_web_demo program for all modem boards. Can I run 1 modem as root of network. How can I modify cc2650_web_demo program to be able to run as root. Can I do by adding codes like rpl_set_root() functions to cc2650_web_demo project.

    I examined /examples/rpl_udp/udp-server program. Can I use this program for root enabled rf modem. Because it runs as root.

    Thanks

    Serdar ARSLAN

  • You are correct in that the /examples/ipv6/rpl-border-router is made for use with a tunslip interface unning on a host. So when started it is waiting to get a prefix form the host. There is actually an example of a stand alone border router (root) in Contiki already, take a look at /examples/cc2530dk/udp-ipv6/server.c

    The client.c combined with the server.c would more or less do what you are asking for.  

    Jonas

  • Hi Firefighter,
    I am testing Contiki cc26xx-web-demo on CC2650STK and I would likt to use rpl_set_mode(RPL_MODE_LEAF) or rpl_set_mode(RPL_MODE_FEATHER) to make CC2650STK to act as RPL LEAF node or RPL FEATHER node. I put rpl_set_mode(RPL_MODE_LEAF) right in front of while loop in main function of contiki-main.c like the followings.

    /*---------------------------------------------------------------------------*/
    /**
    * \brief Main function for CC26xx-based platforms
    *
    * The same main() is used for both Srf+CC26xxEM as well as for the SensorTag
    */
    int
    main(void)
    {
    ...
    fade(LEDS_ORANGE);

    rpl_set_mode(RPL_MODE_LEAF);

    while(1) {
    uint8_t r;
    do {
    r = process_run();
    watchdog_periodic();
    } while(r > 0);

    /* Drop to some low power mode */
    lpm_drop();
    }
    }


    However, I don't see power consumption of CC2650STK decrease when I connect it to BBB 6lbr with CC2531EMK as SLIP-RADIO. Do you know exactly what I can do to make a CC2650STK act as RPL LEAF node or RPL FEATHER node?
  • Hi,

    Afaik it is not possible to set Leaf mode run-time. Only feather or mesh can be used with the rpl_set_mode(). Leaf mode can be set compile time using the define RPL_CONF_LEAF_ONLY, see rpl-conf.h.

    Also see https://github.com/contiki-os/contiki/wiki/RPL-modes

    Regards,

    Andreas U.

    www.netwurke.com

  • I try to change RPL_LEAF_ONLY to 1 in rpl-conf.h but still see current consumption about 7 mA.

    #ifdef RPL_CONF_LEAF_ONLY

    #define RPL_LEAF_ONLY RPL_CONF_LEAF_ONLY

    #else

    #define RPL_LEAF_ONLY 1

    #endif

    Do I miss anything?

  • I think they intended for you to set the RPL_CONF_LEAF_ONLY to 1 somewhere in your own project. Then rpl-conf.h will apply it. But anyways, what you have there should work (if you not for some reason have RPL_CONF_LEAF_ONLY defined to 0 somewhere else).

    One way to confirm the setting is to capture traffic and see no multicast DIO being transmitted. I don't know why you see 7 mA but I don't think the RPL mode can explain this as afaik it basically only decreases the # of DIOs in this case. (I assume you measure idle). I have seen from my own tests that the gyro draw a lot, try disabling it? And/or disable some of the other features in the demo (see earlier post from Jonas)

    Andreas
  • I will try to disable some of the sensors on CC2650STK to see if I can make current consumption down. By the way, what is the lowest current consumption do you have when you test on Contiki 6LowPAN with CC2650STK?

  • I have only tested with a simple multimeter, but I saw the same as you referenced earlier: ~450uA when idling.

    Andreas