contiki | official git repository for Contiki , the open source OS

 by   contiki-os C Version: 3.0 License: Non-SPDX

kandi X-RAY | contiki Summary

kandi X-RAY | contiki Summary

contiki is a C library typically used in Internet of Things (IoT), Raspberry Pi applications. contiki has no bugs and it has medium support. However contiki has 6 vulnerabilities and it has a Non-SPDX License. You can download it from GitHub.

Contiki is an open source operating system that runs on tiny low-power microcontrollers and makes it possible to develop applications that make efficient use of the hardware while providing standardized low-power wireless communication for a range of hardware platforms. Contiki is used in numerous commercial and non-commercial systems, such as city sound monitoring, street lights, networked electrical power meters, industrial monitoring, radiation monitoring, construction site monitoring, alarm systems, remote house monitoring, and so on.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              contiki has a medium active ecosystem.
              It has 3548 star(s) with 2589 fork(s). There are 430 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 476 open issues and 528 have been closed. On average issues are closed in 497 days. There are 169 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of contiki is 3.0

            kandi-Quality Quality

              contiki has 0 bugs and 0 code smells.

            kandi-Security Security

              OutlinedDot
              contiki has 6 vulnerability issues reported (0 critical, 6 high, 0 medium, 0 low).
              contiki code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              contiki has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              contiki releases are not available. You will need to build from source code and install.
              It has 61172 lines of code, 3750 functions and 464 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of contiki
            Get all kandi verified functions for this library.

            contiki Key Features

            No Key Features are available at this moment for contiki.

            contiki Examples and Code Snippets

            No Code Snippets are available at this moment for contiki.

            Community Discussions

            QUESTION

            Remove route in Contiki
            Asked 2022-Feb-15 at 07:34

            I am trying to remove a route in Contiki if attack is detected. I am using struct route_entry *e; route_remove(e);

            But I am getting the following error: undefined reference to 'route_remove'.

            ...

            ANSWER

            Answered 2022-Feb-15 at 07:32

            route_remove is a Rime network stack function. By default, Contiki is built with uIP (IPv6) network stack, which does not have this function.

            To remove a route when the IPv6 network stack is used, call this function:

            void uip_ds6_route_rm (uip_ds6_route_t *route).

            Source https://stackoverflow.com/questions/71116713

            QUESTION

            Dropping only UDP packets in RPL
            Asked 2022-Feb-09 at 05:35

            1)I am trying to drop only UDP packets in RPL in Contigi-ng OS.
            I modified the code in/contiki/core/net/tcpip.c as:

            ...

            ANSWER

            Answered 2022-Feb-09 at 05:35

            You should change uip6.c in the "os/net/ipv6/uip6.c" path. please see this paper :A Reference Implementation for RPL Attacks Using Contiki-NG and COOJA. This is good reference for implementing attacks in Contiki-ng.

            Source https://stackoverflow.com/questions/70920234

            QUESTION

            Radio payload limitation for Cooja mote of Contiki-ng
            Asked 2021-Dec-16 at 08:18

            Consider an RPL network as shown in below. In this network node 1 is the root of the DODAG. Node 2 is the sender and sends unicast UDP packets toward receiver nodes (nodes 3-18). The DODAG is working in the non-storing mode and I am using Cooja mote of Contiki-NG to perform this simulation.

            The problem is that the packets can only be reach to nodes that are placed up to 12 hops away (node 13 in this example). When the sender wants to send a packet for node 16 for example, we got the following warning by 6lowpan and the packet is dropped at the root: "Not enough packetbuf space to compress header (112 bytes, 92 left). Aborting." (line #706 sicslowpan.c) I investigated the problem and found that the root creates the source routing header correctly and the header is added to the packet without any problem. However, the problem comes from the MAC layer and radio interface. The packet is larger than MAX_PAYLOAD_LEN of radio driver. So the radio driver cannot handle the packet. The Contiki-ng has the nullradio driver by itself, but I think the radio driver and its parameters is defined by the platform. I need to mitigate this limitation. Is it possible to modify the parameters in Cooja mote source code? If yes how I can do that?

            ...

            ANSWER

            Answered 2021-Dec-16 at 08:18

            There are at least two, potentially three buffer size bottlenecks that determine the max size of a packet that can be send and processed with Contiki-NG network stack; three

            1. The size of the radio's packet buffer. This is normally determined by the hardware of the radio, and normally can be read by asking for RADIO_CONST_MAX_PAYLOAD_LEN parameter of the NETSTACK_RADIO driver.

            2. The size of the packet buffer. This is by default 125 bytes - small enough to fit in the payload of a standard IEEE 802.15.4 packet (for which the max PHY layer payload is 127 bytes) when a 2 byte FCS is added. The packetbuf size can be changed by the defining a different value of PACKETBUF_CONF_SIZE.

            3. If you use IPv6, then also the size of the uIP buffer. This is defined as UIP_CONF_BUFFER_SIZE and is by default quite large (1280 bytes) to be compatible with the IPv6 MTU defined by the relevant RFCs. However, some platforms set it a smaller value to save memory.

            If you use simulated Cooja nodes, then the radio packet's buffer can be changed in software, by defining a different COOJA_RADIO_CONF_BUFSIZE value in the project-conf.h or in the Makefile. The default value is 125 bytes (so that when 2 byte FCS is added, the size is the max PHY layer payload of an IEEE 802.15.4 radio).

            To solve your problem on Cooja you can try adding in project-conf.h:

            Source https://stackoverflow.com/questions/70314260

            QUESTION

            Contiki ng: how to lower power consumption?
            Asked 2021-Aug-06 at 13:14

            Im currently developing a low power IoT node based on Contiki-ng running on a TI CC1350 launchpad board. My problem is that my power consumption is always >6mA.

            Compiling and running the energest example I can see the MCU radio is always listening, no matter if I compile with MAKE_MAC = MAKE_MAC_NULLMAC and MAKE_NET = MAKE_NET_NULLNET. Running MAKE_MAC = MAKE_MAC_TSCH or MAKE_MAC = MAKE_MAC_CSMA increases consumption by around 2mA as the CPU is always active, but the radio is never duty cycled.

            Is there a way of reducing current consumption for Contiki-ng on this platform?

            ...

            ANSWER

            Answered 2021-Aug-06 at 13:14

            With Contiki-NG, you have two options:

            1. Use CSMA or NullMAC and turn off the radio from the application code with NETSTACK_RADIO.off().
            2. Use TSCH and make sure the schedule has some idle slots. The radio is going to turn off automatically once the node has joined a TSCH network.

            If you the latter, still see big consumption, and you're sure about your code, submit an issue to the Contiki-NG git - there can be an energy consumption bug in the OS specific to the CC1350 board.

            Source https://stackoverflow.com/questions/68681978

            QUESTION

            how to divide two intengers and get a result with decimal numbers?
            Asked 2021-Jul-09 at 02:47

            I'm doing a project in Contiki to a Zolertia module where I need to calculate the risk of a wildfire to occur.

            To calculate this risk the formula used is Risk = Temperature / Humidity.
            The result of Risk it's a decimal value and there are 5 different values range to classify this Risk: 0-0.49 , 0.5-0.99, 1-1.49, 1.5-1.99, >=2.

            My problem is that I can't get decimal results. When I run it in the terminal it shows the value of Temperature and the value of Humidity but just a blank space in the value of Risk.

            My code is:

            ...

            ANSWER

            Answered 2021-Jul-09 at 02:18

            I have a few suggestions:

            1. Specify the literals with either a trailing 'f' or add a decimal place in

            temp = rand() % 45; hum = rand() % (85-5)+5;

            1. Declare temp and hum as floats and then cast the result of rand()

            Source https://stackoverflow.com/questions/68310066

            QUESTION

            is it possible to call a web service from cooja?
            Asked 2021-Apr-09 at 12:26

            is it possible to call a web service from cooja? May be I can read from border-router then call web service (via python script for example). I can ping border-router but I dont know how to read from node or write to node in cooja.I am new to contiki-ng and cooja. thanks in advance

            ...

            ANSWER

            Answered 2021-Apr-09 at 12:26

            You can try the websense example at the folder ~/contiki/examples/ipv6/sky-websense

            Source https://stackoverflow.com/questions/66732962

            QUESTION

            Problems with shifting int value
            Asked 2021-Apr-06 at 16:24

            So I tried to follow an example from: Fixed Point Arithmetic in C Programming, but I get the following error left shift count >= width of type.

            I did find others having this issue here on stackoverflow but I don't understand this error?

            ...

            ANSWER

            Answered 2021-Apr-06 at 16:24

            The example in the question you link to is written for a C implementation in which int is 32 bits. In the C implementation you are using, the int type appears to be 16 bits, and this is too short for 16-bit shifts. You will need to adjust the code to use shorter shifts or a wider integer type.

            Each integer type has a width, which is the number of bits used to represent it, including a sign bit (if the type is signed) and the value bits but excluding padding bits.

            The error message “left shift count >= width of type” says amount of the left shift is greater than or equal to the width of the integer type you are shifting. For example, if you shift a 16-bit number 16 bits left, you shift all bits out of the integer, and there are none left. The C standard essentially treats this as overflow: It does not define the behavior. So the compiler is warning you.

            Since the code in the question does not exactly match the error messages in the question, we cannot be sure, but one possibility is you are compiling for target in which the int type is 16 bits wide, so the SHIFT_AMOUNT of 16 bits is too much. Note that shifting an int is also problematic because of the sign bit and how shifts of signed integers are defined in the C standard. It is usually preferable to use an unsigned type when shifting.

            Possible remedies include:

            • Check your shift amount. Using 16 for a 16-bit int results in a somewhat extreme fixed-point type. You may want a smaller shift amount.
            • Use a larger integer type, perhaps long.
            • Use a wider type for the shift and convert back. For example, if long is 32 bits, you could define SHIFT_MASK to be ((int) ((1l << SHIFT_AMOUNT) - 1)).
            • If SHIFT_AMOUNT is known to be at least one, but not more than 16, then avoid exceeding the width of the type by using a shorter shift with a left operand already shifted a bit: ((2 << SHIFT_AMOUNT-1) - 1).
            • Split the operation into two shifts: ((1 << SHIFT_AMOUNT/2 << SHIFT_AMOUNT-SHIFT_AMOUNT/2) - 1).

            Note the above options do not deal with the signedness issue. You would need to clarify the context for further advice on that.

            Source https://stackoverflow.com/questions/66972143

            QUESTION

            Float Calculation in Cooja
            Asked 2021-Mar-30 at 14:40

            I'm using RPL in Contiki 3.0 and I need to make some calculations where the results are float. But instead of giving me the result in float, it is only calculating the integer number for example: 5/2 = 2.0 instead of 2.5. How can I get the right answer? I can not print float or double in Contiki 3.0 so I'm using this code to convert float into a string:

            ...

            ANSWER

            Answered 2021-Mar-30 at 13:50

            Because 5/2 is a form of integer division, what you put in you get out, meaning that if you put in 5/2 you will only get an integer back, in the form of 2.

            To fix this, make your 5/2 is 5/2.0 so that it is read in as a float, and that will make sure that you will get an answer that is a floating-point decimal.

            Source https://stackoverflow.com/questions/66872070

            QUESTION

            How does contiki os map an IP address to a MAC address
            Asked 2021-Mar-19 at 08:43

            How does contiki os map an IP address to a MAC address, and where is this stored?

            I know the basics of ICMPv6 and RPL but once the network is built, when sending an IPv6 packet, how is the MAC address of the next hop known? I assume that a Neighbor Solicitation message is not sent every time. Also, on Cooja, the only ICMPv6 messages I see are RPL messages.

            I tried to find the answer by grep, google search and in the doc but I couldn't find it.

            ...

            ANSWER

            Answered 2021-Mar-19 at 08:43

            There is a uIP neighbor data structure called uip_ds6_nbr_t. These structures are kept in Contiki neighbor tables. When the mapping from an IPv6 address to a MAC address is needed, the code first calls uip_ds6_nbr_lookup(ipv6_address) to find the neighbor, then uses the neighbor to find the link-layer address, by calling the function uip_ds6_nbr_get_ll(nbr).

            Source https://stackoverflow.com/questions/66704863

            QUESTION

            Contiki ng cant find reference to rpl_set_root()
            Asked 2021-Mar-16 at 14:56

            Im trying to run code that was written for contiki3.x on contiki-ng, I get a compilation error stating undefined reference to `rpl_set_root', eventhough I include "net/routing/rpl-classic/rpl.h". Wen i open the source code rpl-classic/rpl.h and rpl-classic/rpl.c i can see the dunction clearly being there

            The following code produces the compilation error.

            uip_ds6_addr_add(&ipaddr, 0, ADDR_MANUAL);

            ...

            ANSWER

            Answered 2021-Mar-16 at 14:56

            By default Contiki-NG has RPL-lite enabled, which does not have this function.

            To switch to RPL classic, add this line to application's Makefile:

            Source https://stackoverflow.com/questions/66656966

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install contiki

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/contiki-os/contiki.git

          • CLI

            gh repo clone contiki-os/contiki

          • sshUrl

            git@github.com:contiki-os/contiki.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link