From Contiki
Jump to: navigation, search

Back to Main Page

Permission denied

If you try to connect to a mote and receive a permission error, you may need to add yourself to the dialout group. The error may look something like the following:

/home/user/contiki/tools/sky/serialdump-linux -b115200 /dev/ttyUSB0
connecting to /dev/ttyUSB0 (115200)
/dev/ttyUSB0: Permission denied
make: *** [login] Error 255

Use the following command (replace <username> with your account):

sudo adduser <username> dialout


sudo usermod -a -G dialout <username>

These two commands are equivalent. They both will add username to the dialout group. You will then have to re-login to or reboot your computer for the changes to take effect. You should now have read/write permissions to your USB serial devices. It is not necessary to remove any packages.

Issue with make login

If you are trying to execute the serial-dump application (contiki/tools/sky/serialdump-linux) and see the message: "No such file or directory" or "Command not found", it means that you are running in a 64-bit operating system that does not have proper 32-bit libraries installed. Since serialdump-linux is a pre-compiled 32-bit tool you need to execute the following command to install the necessary libraries:

sudo apt-get install ia32-libs

On newer versions of Ubuntu, try:

sudo apt-get install libc6-i386

If the above does not work

Then, try few commands like:

 ldd serialdump-linux

The output look similar to the following:

 ldd serialdump-linux =>  (0xf772d000) => /lib32/ (0xf75b4000)
       /lib/ (0xf772e000)

Then it means that you have to install 32-bit packages. Remember to add i386 architecture or you won't be able to install 32-bit packages:

 sudo dpkg --add-architecture i386
 sudo apt-get update
 sudo apt-get install ia32-libs
Input/output error

If you try to connect to a mote and receive an Input/output error as shown below,

 /contiki/examples/hello-world$ sudo -s make login
 using saved target 'sky'
 ../../tools/sky/serialdump-linux -b115200
 connecting to /dev/ttyS0 (115200) [OK]
 could not get options: Input/output error
 make: *** [login] Error 255

Then it means that VirtualBox cannot detect the mote connected to the USB interface.

This issue can be fixed by making a minor change in the VM settings.

In the VirtualBox Manager, select the 'Contiki' VM.

Settings-> USB-> Add new USB Filter with all fields set to the values of the selected USB device

and select the mote to be added. You will have to restart the VM for the changes to take effect.

Problem running Cooja

If you have a problem regarding using the correct version of Java, please check that your default Java compiler is set correctly. You can use the following command:

 sudo update-alternatives --config java
Problem with compiling in Cooja

If you get an error in the linking there may be 2 possible places u need to check to correct them.

           relocation truncated to fit: R_MSP430_16_BYTE against `no symbol'
           collect2: ld returned 1 exit status
           make: *** [] Error 1

First, check the line near 132 in file : contiki/cpu/msp430/Makefile.msp430

which looks like the following

        CFLAGSNO = -Wall -mmcu=$(CC_MCU) -g $(CFLAGSWERROR)

and delete the option “-g”.

The line should look like :

       CFLAGSNO = -Wall -mmcu=$(CC_MCU) $(CFLAGSWERROR)

Use the second one if the first doesnot work.

Second one is go to the Makefile of the currently compiling program and remove the line which looks similar to the following.

       CFLAGS += -g

Attribute Error while Interfacing with Python

After installing sky-shell on Tmote sky, if you encounter the following error on running python

 /contiki/examples/sky-shell$ python
 Traceback (most recent call last):
   File "", line 2, in <module>
     import serial
   File "/home/user/contiki/examples/sky-shell/" , line 3 , in <module>
     ser = serial.Serial(
 AttributeError: 'module' object has no attribute 'Serial'

Then delete 'serial.pyc' if exists and rename '' to anything other than 'serial'.

Cause of Problem: Error occurs when you import 'something' when your python file name is ''.