Contiki 3.0 on XM1000

In other post, I installer contiki 3.x on xm1000.
Now, we going to install contiki 3.0 (the lastest version).
First, you need to dowload the lastest code from github:

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

Now we need to add xm1000 compatibility to our contiki.
Thanks to DMI  for the xm1000 patch. Without it, you will see the following error:

make: *** No rule to make target 'obj_xm1000/cc2420.o', needed by 'contiki-xm1000.a'.  Stop.

I upgrade his patch with an app to access to the xm1000 sensors.
Download it from https://drive.google.com/file/d/0B7NXiwmWq7jCb3ROSFZZSWliMnc/view?usp=sharing

Now, extract it into contiki folder:

tar xzvf xm1000.tar.gz
cd xm1000
cp -R * $YOUR_CONTIKI_PATH

Go to the apps folder and execute an script that I create to automate the process:

cd $YOUR_CONTIKI_PATH/platform/xm1000/apps/sensors
./install.sh
















Enjoy it!

Comments

  1. Dear NicolƔs,
    Thank you so much for your help, but I'm still having issue here, "upgrade his patch with an app to access to the xm1000 sensors. Download it from https://drive.google.com/file/d/0B7NXiwmWq7jCb3ROSFZZSWliMnc/view?usp=sharing" how can i use the link to upgrade the patch?
    than you.

    ReplyDelete
  2. I upload it to this url: https://transfer.sh/JE9FG/xm1000.tar.gz
    Do the following steps:
    wget https://transfer.sh/JE9FG/xm1000.tar.gz
    tar xzvf xm1000.tar.gz
    cd xm1000
    cp -R * $YOUR_CONTIKI_PATH

    ReplyDelete
  3. Hello NicolƔs,
    Thank you so much, but I'm still getting some error if i run "cd xm1000" something like this "bash: cd: xm1000: No such file or directory"

    thank you

    ReplyDelete
    Replies
    1. Sorry, I didn't create the tar file in a folder.
      Do the following steps:
      wget https://transfer.sh/JE9FG/xm1000.tar.gz
      mkdir xm1000; tar xzvf xm1000.tar.gz -C xm1000
      cd xm1000
      cp -R * $YOUR_CONTIKI_PATH

      Delete
  4. This comment has been removed by the author.

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. Hello NicolƔs,
    Thank you for your help really appreciate. but I'm still having error and couldn't still be able compile the hello-world. the error below is the error I'm having when ever i run "cd $YOUR_CONTIKI_PATH/platform/xm1000/apps/sensors. "./install.sh" in oder to go to the apps folder and execute an script that I create to automate the process:
    "./install.sh. thank you and please don't get tired with me

    user@instant-contiki:~$ cd xm1000
    user@instant-contiki:~/xm1000$ cp -R * $YOUR_CONTIKI_PATH
    user@instant-contiki:~/xm1000$ cd $YOUR_CONTIKI_PATH/platform/xm1000/apps/sensors
    bash: cd: /platform/xm1000/apps/sensors: No such file or directory

    ReplyDelete
  7. I don't know where you have your contiki path, for this reason I called $YOUR_CONTIKI_PATH.
    You need replace it by your contiki path, like /home/user/contiki

    ReplyDelete
  8. thank you very much, is working now

    ReplyDelete
  9. Dear Nicolas,

    I am trying to use xm1000 to read temperature and light and display them using Raspberry Pi2 board.

    I did all the steps. I have now ContikiOs working with Raspberry Pi and Iadded xm1000 compatibility to my contiki.
    I copied the files into contiki folder.
    When I execute the script in sensor folder (install.sh), I get permission error (Permission denied).
    After giving permission (chmod 777 install.sh) and running the script again.
    After 3-4 minutes I got the following errors:

    sensorReading.c:5:30: fatal error: dev/sht11-sensor.h: No such file or directory
    ../../../../Mkefile.include:260: recipe for target 'sensorReading.com' failed
    make: *** [sensorReading.co] Error 1
    using saved target 'xm1000'
    cc sensorReading.c
    sensorReading.c:5:30: fatal error: dev/sht11-sensor.h: No such file or directory
    ../../../../Mkefile.include:260: recipe for target 'sensorReading.com' failed
    make: *** [sensorReading.co] Error 1
    running your application
    using saved target 'xm1000'
    ../../../../tools/xm1000/serialdump-linux-b115200
    make: execvp: ../../../../tools/xm1000/serialdump-linux: permission denied
    ../../../../platform/xm1000/Makefile.common:208: recipe for target 'login' failed
    make: *** [login] Error 127

    And after that with running hello-world.c
    make TARGET=xm1000 savetarget
    make hello-world.upload login

    This is the error:
    ../../../../tools/xm1000/serialdump-linux-b115200
    make: execvp: ../../../../tools/xm1000/serialdump-linux: permission denied
    ../../../../platform/xm1000/Makefile.common:208: recipe for target 'login' failed
    make: *** [login] Error 127

    I would really appreciate if you could help me.
    Thank you very much in advance.

    HZ

    ReplyDelete
    Replies
    1. Did you check if you have this file: dev/sht11-sensor.h ?

      Delete
    2. Yes, I have sht11-sensor.h inside sht11 folder which is inside dev folder

      Delete
    3. But the problem is I can not even run hello-world example in contikios using xm1000.
      Now when I type:
      make TARGET=xm1000 hello-world.upload login

      I have the following error:

      ../../Makefile.include:240: recipe for target 'obj_xm1000/ds2411.o' failed
      make: *** [obj_xm1000/ds2411.o] Error 1

      Delete
    4. It is very extrange, becuase you have the following message:
      sensorReading.c:5:30: fatal error: dev/sht11-sensor.h: No such file or directory.
      That indicates you don't have this file.
      Also, if you have permission issues, maybe you need try with sudo before run make (to execute serialdump-linux as root)

      Delete
    5. Thanks for the reply.
      As I said even I cannot run hello-world example.
      That example does not need sht11-sensor.h file.
      But I see the following error:

      ../../Makefile.include:240: recipe for target 'obj_xm1000/ds2411.o' failed
      make: *** [obj_xm1000/ds2411.o] Error 1

      Any way, I will try to do all the installations again and will let you know about it.

      Thanks a lot.

      Delete
    6. Hi Nicolas,
      I did all the installations again.

      Now when I try to execute ./install.sh, this is the error:

      ../../../../tools/xm1000/serialdump-linux -b115200
      ../../../../tools/xm1000/serialdump-linux: 1: ../../../../tools/xm1000/serialdump-linux: Syntax error: "(" unexpected

      ../../../../platform/xm1000/Makefile.common:208: recipe for target 'login' failed.
      make: *** [login] Error 2

      Thanks for the help in advance.

      Delete
    7. To see where is the problem, open install.sh with an editor and execute each line by separate on your terminal. Which instruccion has an error?

      Delete
    8. The contents of install.sh are as follows:

      make TARGET=xm1000 savetarget
      make sensorReading
      sudo make sensorReading.upload

      echo "running your application"
      #sudo ../../tools/sky/serialdump-linux -b115200 /dev/ttyUSB0
      sudo make login

      When I run the ./install.sh, this is exactly what I see:

      saving Makefile.target
      using saved target 'xm1000'
      make: 'sensorReading' is up to date.
      using saved target 'xm1000'

      msp430-objcopy sensorReading.xm1000 -0 ihex sensorReading.ihex
      make IHEFILE=sensorReading.ihex xm1000-reset xm1000-upload
      make[1]: Entering directory '/home/pi/contiki/platfor/xm1000/apps/sensors'
      using saved target 'xm1000'

      make -k -j 20 xm1000-reset-sequence
      make [2]: Entering directory '/home/pi/contiki/platfor/xm1000/apps/sensors'
      using saved target 'xm1000'
      Done

      make [2]: Leaving directory '/home/pi/contiki/platfor/xm1000/apps/sensors'
      make -j 20 xm1000-upload-sequence
      make [2]: Entering directory '/home/pi/contiki/platfor/xm1000/apps/sensors'
      using saved target 'xm1000'
      Done

      make [2]: Leaving directory '/home/pi/contiki/platfor/xm1000/apps/sensors'
      make [1]: Leaving directory '/home/pi/contiki/platfor/xm1000/apps/sensors'

      rm sensorReading.ihex
      running your application
      using saved target 'xm1000'

      ../../../../tools/xm1000/serialdump-linux -b115200
      ../../../../tools/xm1000/serialdump-linux: 1: ../../../../tools/xm1000/serialdump-linux: Syntax error: "(" unexpected

      ../../../../platform/xm1000/Makefile.common:208: recipe for target 'login' failed.
      make: *** [login] Error 2

      As you see it seems that the first 4 lines of install.sh are executed properly.

      we can see the message: running your application.
      The problem occurs after that line.

      As I see line FIVE is a comment

      #sudo ../../tools/sky/serialdump-linux -b115200 /dev/ttyUSB0

      Am I right?

      Should I change it to something like below and remove # from the beginning ???

      sudo ../../tools/xm1000/serialdump-linux -b115200 /dev/ttyUSB0

      Or what else can be the cause of this problem?

      Thanks for the help in advance.


      Delete
    9. serialdump-linux: Syntax error: "(" unexpected
      Maybe you have a gcc incompatible version to use serialdump-linux.
      Can you execute the following command?
      sudo ./serialdump-linux
      You should see this message if all is well
      connecting to /dev/ttyS0 (57600) [OK]

      Delete
    10. This comment has been removed by the author.

      Delete
    11. When I execute the command i see the following.

      connecting to /dev/ttyS0 (115200)
      open: No such file or directory

      Delete
    12. Wich interface is associated to your sensor? You need to check it first

      Delete
    13. Dear Nicolas,

      How can I check which interface is associated to the sensor?
      Can you help please?

      Thanks in advance.

      Delete
    14. Ok I got it.
      In raspi-config:
      Interfacing options are as follow:

      P1 Camera
      P2 SSH
      P3 VNC
      P4 SPI
      P5 I2C
      P6 Serial
      P7 1-Wire
      P8 Remote GPIO

      The options are only to enable/disable.

      What do I have to do now?

      Delete
    15. When I check /dev ,I cannot see "ttyS0".
      I have tty0 up to tty63
      AND
      ttyAMA0, ttyprintk, ttyUSB0.

      There is no "ttyS0".

      Also in "install.sh" we have something like this:
      #sudo ../../tools/sky/serialdump-linux -b115200 /dev/ttyUSB0

      I guess "ttyS0" should change somewhere to "ttyUSB0".
      But where??

      Any suggestions please??

      Delete
    16. after plug your sensor to your USB device, type dmesg in your terminal and you should see something like this:

      [1118678.936699] usb 1-2: new full-speed USB device number 39 using xhci_hcd
      [1118679.069577] usb 1-2: New USB device found, idVendor=0403, idProduct=6001
      [1118679.069585] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
      [1118679.069590] usb 1-2: Product: MTM-XM1000MSP
      [1118679.069594] usb 1-2: Manufacturer: FTDI
      [1118679.069597] usb 1-2: SerialNumber: MFV5YAPF
      [1118680.103950] usbcore: registered new interface driver usbserial
      [1118680.103963] usbcore: registered new interface driver usbserial_generic
      [1118680.103973] usbserial: USB Serial support registered for generic
      [1118680.106272] usbcore: registered new interface driver ftdi_sio
      [1118680.106286] usbserial: USB Serial support registered for FTDI USB Serial Device
      [1118680.106358] ftdi_sio 1-2:1.0: FTDI USB Serial Device converter detected
      [1118680.106396] usb 1-2: Detected FT232BM
      [1118680.106539] usb 1-2: FTDI USB Serial Device converter now attached to ttyUSB0

      The last line indicates ttyUSB0

      Delete
    17. Hi Nicolas,
      Thanks for the reply.

      Yes, After I type dmesg I see a long list of messages.

      A few last lines are as follows:

      [1232.829655] usb 1-1 . 5: Product: MTM-XM1000MSP
      [1232.829665] usb 1-1 . 5: Manufacturer: FTDI
      [1232.829676] usb 1-1 . 5: SerialNumber: FTWVIZU1
      [1232.851915] ftdi_sio 1-1 . 5:1.0: FTDI USB Serial Device converter detected
      [1232.852268] usb 1-1 . 5: Detected FT232BM
      [1232.854435] usb 1-1 . 5: FTDI USB Serial Device converter now attached to ttyUSB0

      The last line is same as what you have sent me.

      But when I execute ./install.sh or ./serialdump-linux:
      I have the following error:

      connecting to /dev/ttyS0 (115200)
      open: No such file or directory

      It is trying to connect to ttyS0 which is not available I guess.
      I guess ttyS0 should change to ttyUSB0 somewhere!!

      Thanks for the help.



      Delete
    18. For example for ./install.sh :

      This is the error.

      using saved target 'xm1000'
      ../../../../tools/xm1000/serialdump-linux -b115200
      connecting to /dev/ttyS0 (115200)
      open: No such file or directory
      ../../../../platform/xm1000/Makefile.common:208: recipe for target 'login' failed.
      make: *** [login] Error 255.

      I would really appreciate if you could help.

      Delete
  10. Did you try uncomment the commented line?
    sudo ../../tools/sky/serialdump-linux -b115200 /dev/ttyUSB0
    I commented it, because is it redundant, but in your case it seems that it is not.

    ReplyDelete
    Replies
    1. Yes, I did.
      But the same error + one more line of error (command not found). This is the error.

      sudo ../../tools/sky/serialdump-linux: command not found

      using saved target 'xm1000'
      ../../../../tools/xm1000/serialdump-linux -b115200
      connecting to /dev/ttyS0 (115200)
      open: No such file or directory
      ../../../../platform/xm1000/Makefile.common:208: recipe for target 'login' failed.
      make: *** [login] Error 255.

      Delete
    2. Hi Nicolas,

      I changed ttyS0 in serialdump.c into ttyUSB0 and created a new serialdump-linux file.
      Now when I execute ./install.sh, it is trying to connect to ttyUSB0 but the message this time is "Invalid argument" instead of "No such file or directory".

      This is the error:

      using saved target 'xm1000'
      ../../../../tools/xm1000/serialdump-linux -b115200
      connecting to /dev/ttyUSB0 (115200)
      open: Invalid argument
      ../../../../platform/xm1000/Makefile.common:208: recipe for target 'login' failed.
      make: *** [login] Error 255.

      Please let me know if you have any idea about the cause of this error.

      Thanks a lot in advance.

      Delete
  11. Hello, I am trying to work with Contiki 3.0 and XM-1000 platform, I followed all you steps but I still can't upload any program into the platform. When I execute "sudo make TARGET=xm1000 hello-world.upload" I get the following result:

    using saved target 'xm1000'
    msp430-objcopy hello-world.xm1000 -O ihex hello-world.ihex
    make IHEXFILE=hello-world.ihex xm1000-reset xm1000-upload
    make[1]: Entering directory '/home/contiki/contiki/examples/hello-world'
    using saved target 'xm1000'
    make -k -j 20 xm1000-reset-sequence
    make[2]: Entering directory '/home/contiki/contiki/examples/hello-world'
    using saved target 'xm1000'
    Done
    make[2]: Leaving directory '/home/contiki/contiki/examples/hello-world'
    make -j 20 xm1000-upload-sequence
    make[2]: Entering directory '/home/contiki/contiki/examples/hello-world'
    using saved target 'xm1000'
    Done
    make[2]: Leaving directory '/home/contiki/contiki/examples/hello-world'
    make[1]: Leaving directory '/home/contiki/contiki/examples/hello-world'
    rm hello-world.ihex

    I have been trying to solve it but I don't know where the problem is. Do you know any way of fixing this problem? Thank you very much in advance.

    ReplyDelete

Post a Comment

Popular posts from this blog

Exception: Could not find a default OpenFlow controller in Mininet

How to fix Android when developer options are not available for this user

v4l2: open /dev/video0: Permission denied