diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..638c8d2a4f126823299db9c14b149df08d613908
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+bin
+build
+lib
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000000000000000000000000000000000000..a03c5e9b0237b304c5baf174644ac2af45ebf03b
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,35 @@
+image: docker.io/labrobotica/labrobotica
+
+stages:
+  - build
+  - test
+  - deploy
+
+build-package:
+  stage: build
+  script:
+#  Uncomment to install dependencies
+#    - apt update
+#    - apt -y iri-<package_name>-dev
+    - apt update
+    - apt -y install iri-iriutils-dev
+    - mkdir -pv build
+    - cd build
+    - cmake -D CMAKE_BUILD_TYPE=RELEASE -DCPACK_PACKAGE_VERSION=$CI_COMMIT_TAG ..
+    - make package -j $(nproc)
+  artifacts:
+    paths:
+      - build/*.deb
+    expire_in: 2 weeks
+  only:
+    - tags
+    
+update_repo:
+  stage: deploy
+  script:
+    - cd build
+    - "scp -i /root/.ssh/iriLabKeyNopwd -r *comm*.deb irilabo@147.83.76.226:packages/"
+    - "ssh irilabo@147.83.76.226 -i /root/.ssh/iriLabKeyNopwd -tt /home/irilabo/repo_scripts/update_repo.sh comm"
+  only:
+    - tags
+
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1360f82cdcf8e1d7062eeceea7788e2e7419d952..29e1065439fd78ce5486d99f8b6a9148a44baa23 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,18 +8,7 @@ endif(COMMAND cmake_policy)
 
 # The project name and the type of project
 PROJECT(comm)
-
-SET(CPACK_PACKAGE_VERSION "1.0.0")
-SET(CPACK_PACKAGE_VERSION_MAJOR "1")
-SET(CPACK_PACKAGE_VERSION_MINOR "0")
-SET(CPACK_PACKAGE_VERSION_PATCH "0")
-IF (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)")
-  SET (X86 TRUE)
-  SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
-ELSE ()
-  SET (X86 FALSE)
-  SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386")
-ENDIF()
+SET(PACKAGE_NAME comm)
 
 SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)
 SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib)
@@ -84,16 +73,29 @@ ELSE(UNIX)
   )
 ENDIF(UNIX)
 
+IF (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)")
+  SET (X86 TRUE)
+  SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
+ELSE ()
+  SET (X86 FALSE)
+  SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386")
+ENDIF()
 
 IF (UNIX)
-  SET(CPACK_PACKAGE_FILE_NAME "iri-${PROJECT_NAME}-dev-${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
-  SET(CPACK_PACKAGE_NAME "iri-${PROJECT_NAME}-dev")
-  SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Part of IRI-laboratory libraries. More information at http://wikiri.upc.es/index.php/Robotics_Lab")
-  SET(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
+  SET(CPACK_PACKAGE_FILE_NAME "iri-${PACKAGE_NAME}-dev-${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
+  SET(CPACK_PACKAGE_NAME "iri-${PACKAGE_NAME}-dev")
+  SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Part of IRI-laboratory libraries. More information at https://gitlab.iri.upc.edu/labrobotica/labrobotica_how_to")
+  SET(CPACK_PACKAGING_INSTALL_PREFIX /usr)
   SET(CPACK_GENERATOR "DEB")
-  SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "labrobotica@iri.upc.edu")
-  SET(CPACK_SET_DESTDIR "ON")  # Necessary because of the absolute install paths
- SET(CPACK_DEBIAN_PACKAGE_DEPENDS "iri-iriutils-dev (>= 1.0~${DISTRIB})")
+  SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "labrobotica - labrobotica@iri.upc.edu")
+
+# Uncomment to add the necessary mantainer scripts
+  SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/scripts/debian/postinst;${CMAKE_SOURCE_DIR}/scripts/debian/prerm")
+
+# Uncomment to add dependencies comma separated
+# SET(CPACK_DEBIAN_PACKAGE_DEPENDS "iri-<package_name>-dev (>= 1.0~${DISTRIB})")
+  SET(CPACK_DEBIAN_PACKAGE_DEPENDS "iri-iriutils-dev (>= 1.0~${DISTRIB})")
+
   INCLUDE(CPack)
 ELSE(UNIX)
   ADD_CUSTOM_COMMAND(
diff --git a/Findcomm.cmake b/Findcomm.cmake
index deab1a931b0feef46b2c088e6d0bb2f9776d4f11..89d37a3d65d000bd52730de6fa01c696c9c8b198 100644
--- a/Findcomm.cmake
+++ b/Findcomm.cmake
@@ -1,17 +1,19 @@
-FIND_PATH(comm_INCLUDE_DIR comm.h commexceptions.h rs232.h rs232exceptions.h ftdiserver.h ftdimodule.h ftdiexcetpions.h socket.h socketclient.h socketserver.h socketexceptions.h /usr/include/iridrivers /usr/local/include/iridrivers)
+FIND_PATH(comm_INCLUDE_DIRS comm.h commexceptions.h cqueue.h rs232.h rs232exceptions.h ftdiserver.h ftdimodule.h ftdiexcetpions.h socket.h socketclient.h socketserver.h socketexceptions.h socketudp.h can.h virtual_can.h /usr/local/include/iri/comm /usr/include/iri/comm)
 
-
-FIND_LIBRARY(comm_LIBRARY
+FIND_LIBRARY(comm_LIBRARIES
     NAMES comm
-    PATHS /usr/lib/iridrivers /usr/local/lib /usr/local/lib/iridrivers) 
+    PATHS /usr/local/lib/iri/comm /usr/lib/iri/comm)
+
+SET(comm_INCLUDE_DIR ${comm_INCLUDE_DIRS})
+SET(comm_LIBRARY    ${comm_LIBRARIES})
 
-IF (comm_INCLUDE_DIR AND comm_LIBRARY)
+IF (comm_INCLUDE_DIRS AND comm_LIBRARIES)
    SET(comm_FOUND TRUE)
-ENDIF (comm_INCLUDE_DIR AND comm_LIBRARY)
+ENDIF (comm_INCLUDE_DIRS AND comm_LIBRARIES)
 
 IF (comm_FOUND)
    IF (NOT comm_FIND_QUIETLY)
-      MESSAGE(STATUS "Found comm library: ${comm_LIBRARY}")
+      MESSAGE(STATUS "Found comm library: ${comm_LIBRARIES}")
    ENDIF (NOT comm_FIND_QUIETLY)
 ELSE (comm_FOUND)
    IF (comm_FIND_REQUIRED)
diff --git a/ReadMe.md b/ReadMe.md
index 1471e56d6e7552e165883a26ee2ca3ad625d777b..36e9e3a64793d67e45e795a750fdfa0b8032cdcd 100644
--- a/ReadMe.md
+++ b/ReadMe.md
@@ -3,12 +3,16 @@ Comm library                         {#mainpage}
 
 ## Description
 
-This set of drivers for standard communication devices. This library offers a
+It is a set of drivers for standard communication devices. This library offers a
 generic communication device which can be used to create drivers for new
 communication devices easily: it is only necessary to implement the low level,
 operating system dependent functions, all the other features are already
 implemented.
 
+<details><summary>Detailed description</summary>
+<p>
+
+
 The main features of all communication devices are:
 
 * Data is automatically received and stored into a data FIFO by an internal thread.
@@ -35,7 +39,7 @@ devices with any of the following FTDI chips:
             - FT245B
             - FT8U232AM
             - FT8U245AM
-This driver can also be used with USB devices that appear as virtual serial
+. This driver can also be used with USB devices that appear as virtual serial
 ports in the host computer. In this case it is also possible to use the serial
 port driver
 
@@ -46,8 +50,57 @@ the following event for each of the connections:
             - new connection
             - disconnection
             - reception of new data
+. Both the client and server can be used with other implementations of the POSIX sockets.
+
+* **can bus**: This driver provides a simple and easy to use interface for CAN bus communication protocol.
+This driver allows the user to open and configure a CAN port and send and receive data to and from it.
+It also provides the possibility of create a Virtual Can that dumps the content of a file on a specific rate.
+
+</p>
+</details>
+
+
+## Installation
+
+* Add the labrobotica repository if it is not already added:
+
+``` sudo sh -c 'echo "deb [arch=amd64] http://147.83.76.226/~irilabo/packages xenial main" > /etc/apt/sources.list.d/labrobotica_repo.list' ```
+
+``` wget -O - http://147.83.76.226/~irilabo/labrobotica_repo.gpg.key | sudo apt-key add - ```
+
+* Install the package:
 
-Both the client and server can be used with other implementations of the POSIX sockets.
+``` sudo apt update && sudo apt install iri-comm-dev ```
+
+## Scripts
+
+When using a CAN to usb adapter, it's neccesary to run *scripts/can.sh*.
+This script has the following dependency:
+
+  - [can-utils](https://elinux.org/Can-utils)
+
+To install it:
+
+ ```sudo apt install can-utils```
+ 
+It's also provided a script named *unbind_ftdi_udev.sh* to unload the *ftdi_sio* module and other to undo it (*undo_unbind_ftdi_udev.sh*)
+
+## Disclaimer  
+
+Copyright (C) 2009-2018 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+Mantainer IRI labrobotics (labrobotica@iri.upc.edu)
+
+This package is distributed in the hope that it will be useful, but without any warranty. It is provided "as is" without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the program is with you. should the program prove defective, the GMR group does not assume the cost of any necessary servicing, repair  or correction.
+
+In no event unless required by applicable law the author will be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use the program (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the program to operate with any other programs), even if the author has been advised of the possibility of such damages.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>
+
+## For developers
+
+<details><summary>click here</summary>
+<p>
 
 ## Dependencies
 
@@ -65,9 +118,9 @@ This package also requires of the following IRI libraries:
 
 * [iriutils](https://gitlab.iri.upc.edu/labrobotica/algorithms/iriutils "iriutils gitlab page"), a set of basic tools.
 
-## Compilation and installation
+## Compilation and installation from source
 
-Download this repository and create a build folder inside:
+Clone this repository and create a build folder inside:
 
 ``` mkdir build ```
 
@@ -82,7 +135,7 @@ The RELEASE build mode optimizes for speed. To build in this mode execute instea
 
 The release mode will be kept until next time cmake is executed.
 
-``` make ``` 
+``` make -j $(nproc)``` 
 
 In case no errors are reported, the generated libraries (if any) will be located at the
 _lib_ folder and the executables (if any) will be located at the _bin_ folder.
@@ -92,8 +145,8 @@ To do that, execute
 
 ``` make install ```
 
-as root and the shared libraries will be copied to */usr/local/lib/iridrivers* directory
-and the header files will be copied to */usr/local/include/iridrivers* dierctory. At
+as root and the shared libraries will be copied to */usr/local/lib/iri/comm* directory
+and the header files will be copied to */usr/local/include/iri/comm* dierctory. At
 this point, the library may be used by any user.
 
 To remove the library from the system, exceute
@@ -108,27 +161,21 @@ To generate the documentation execute the following command:
 
 ## How to use it
 
-To use this library in an other library or application, in the CMakeLists.txt file, first it is necessary to locate if the library has been installed or not using the following command
+To use this library in another library or application, in the CMakeLists.txt file, first it is necessary to locate if the library has been installed or not using the following command
 
-``` FIND_PACKAGE(<library name>) ```
+``` FIND_PACKAGE(comm) ```
 
 In the case that the package is present, it is necessary to add the header files directory to the include directory path by using
 
-``` INCLUDE_DIRECTORIES(${<librray name>_INCLUDE_DIR}) ```
+``` INCLUDE_DIRECTORIES(${comm_INCLUDE_DIR}) ```
 
 and it is also necessary to link with the desired libraries by using the following command
 
-``` TARGET_LINK_LIBRARIES(<executable name> ${<library name>_LIBRARY}) ```
+``` TARGET_LINK_LIBRARIES(<executable name> ${comm_LIBRARY}) ```
 
-## Disclaimer  
+## Examples
 
-Copyright (C) 2009-2018 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
-Mantainer IRI labrobotics (labrobotica@iri.upc.edu)
-
-This package is distributed in the hope that it will be useful, but without any warranty. It is provided "as is" without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the program is with you. should the program prove defective, the GMR group does not assume the cost of any necessary servicing, repair  or correction.
-
-In no event unless required by applicable law the author will be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use the program (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the program to operate with any other programs), even if the author has been advised of the possibility of such damages.
-
-You should have received a copy of the GNU Lesser General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>
+There are several examples that show how to use the different classes.
 
+</p>
+</details>
\ No newline at end of file
diff --git a/src/can/can.h b/include/can/can.h
similarity index 100%
rename from src/can/can.h
rename to include/can/can.h
diff --git a/src/can/virtual_can.h b/include/can/virtual_can.h
similarity index 100%
rename from src/can/virtual_can.h
rename to include/can/virtual_can.h
diff --git a/src/comm.h b/include/comm.h
similarity index 100%
rename from src/comm.h
rename to include/comm.h
diff --git a/src/commexceptions.h b/include/commexceptions.h
similarity index 100%
rename from src/commexceptions.h
rename to include/commexceptions.h
diff --git a/src/cqueue.h b/include/cqueue.h
similarity index 100%
rename from src/cqueue.h
rename to include/cqueue.h
diff --git a/src/serial/rs232.h b/include/serial/rs232.h
similarity index 100%
rename from src/serial/rs232.h
rename to include/serial/rs232.h
diff --git a/src/serial/rs232exceptions.h b/include/serial/rs232exceptions.h
similarity index 100%
rename from src/serial/rs232exceptions.h
rename to include/serial/rs232exceptions.h
diff --git a/src/sockets/socket.h b/include/sockets/socket.h
similarity index 100%
rename from src/sockets/socket.h
rename to include/sockets/socket.h
diff --git a/src/sockets/socketclient.h b/include/sockets/socketclient.h
similarity index 100%
rename from src/sockets/socketclient.h
rename to include/sockets/socketclient.h
diff --git a/src/sockets/socketexceptions.h b/include/sockets/socketexceptions.h
similarity index 100%
rename from src/sockets/socketexceptions.h
rename to include/sockets/socketexceptions.h
diff --git a/src/sockets/socketserver.h b/include/sockets/socketserver.h
similarity index 100%
rename from src/sockets/socketserver.h
rename to include/sockets/socketserver.h
diff --git a/src/sockets/socketudp.h b/include/sockets/socketudp.h
similarity index 100%
rename from src/sockets/socketudp.h
rename to include/sockets/socketudp.h
diff --git a/src/usb_ftdi/ftdiexceptions.h b/include/usb_ftdi/ftdiexceptions.h
similarity index 100%
rename from src/usb_ftdi/ftdiexceptions.h
rename to include/usb_ftdi/ftdiexceptions.h
diff --git a/src/usb_ftdi/ftdimodule.h b/include/usb_ftdi/ftdimodule.h
similarity index 100%
rename from src/usb_ftdi/ftdimodule.h
rename to include/usb_ftdi/ftdimodule.h
diff --git a/src/usb_ftdi/ftdiserver.h b/include/usb_ftdi/ftdiserver.h
similarity index 100%
rename from src/usb_ftdi/ftdiserver.h
rename to include/usb_ftdi/ftdiserver.h
diff --git a/scripts/add_manufacturer_to_group_udev.sh b/scripts/add_manufacturer_to_group_udev.sh
new file mode 100755
index 0000000000000000000000000000000000000000..aa672485fd54eded3a8aa83a701c8a530a363267
--- /dev/null
+++ b/scripts/add_manufacturer_to_group_udev.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+echo "--- add_manufacturer_to_group_udev.sh ---"
+
+MANUFACTURER="Segway"
+GROUP="dialout"
+FILE="99-manufacturer-${MANUFACTURER}-to-group-${GROUP}.rules"
+UDEV_PATH="/etc/udev/rules.d"
+
+usage() {
+  echo "Usage: $0 [-m <manufacturer>] [-g <group>] [-f <file> ]"
+  echo " -m  specify manufacturer  id. Default Segway"
+  echo " -g  specify group id.         Default dialout"
+  echo " -f  specify udev file.        Default 99-segway-to-dialout-group.rules"
+  exit 1
+  }
+  
+while getopts ":hm:g:f:" arg; do
+  case $arg in
+    m)  MANUFACTURER=$OPTARG
+        FILE="99-manufacturer-${MANUFACTURER}-to-group-${GROUP}.rules"
+        ;;
+    g)  GROUP=$OPTARG
+        FILE="99-manufacturer-${MANUFACTURER}-to-group-${GROUP}.rules"
+        ;;
+    f)  FILE=$OPTARG;;
+    h) usage;;
+    *) usage;;
+  esac
+done
+shift $((OPTIND-1))
+
+FILE="$UDEV_PATH/$FILE"
+
+echo "  Add udev rule so MANUFACTURER=${MANUFACTURER} devices are added to GROUP=${GROUP}."
+echo "  Adding new lines to udev rule file: ${FILE}"
+
+LINE0="SUBSYSTEM==\"usb\", ATTR{manufacturer}==\"${MANUFACTURER}\", GROUP=\"${GROUP}\""
+
+sudo touch $FILE
+grep -qF -- "$LINE0" "$FILE" || echo "$LINE0" | sudo tee -a "$FILE" > /dev/null
+
+sudo service udev restart
+echo "  Need to unplug-plug devices for changes to take effect"
diff --git a/scripts/can.sh b/scripts/can.sh
new file mode 100755
index 0000000000000000000000000000000000000000..93fed3acba28091940cd5510a99955f558bfbd52
--- /dev/null
+++ b/scripts/can.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+set -e
+
+DEVICE=
+NAME=
+
+usage() {
+  echo "Usage: $0 [-d <device>] [-n <name>]"
+  echo " -d  specify device route."
+  echo " -n  specify human friendly device's name."
+  exit 1
+  }
+  
+while getopts ":hd:n:" arg; do
+  case $arg in
+    d) DEVICE=$OPTARG;;
+    n) NAME=$OPTARG;;
+    h) usage;;
+    *) usage;;
+  esac
+done
+shift $((OPTIND-1))
+
+#check if device parameter is filled up
+if [ ! "${DEVICE}" ]
+then
+  echo "No device provided, aborting ..."
+  usage
+  exit 1
+fi
+
+#check if name parameter is filled up
+if [ ! "${NAME}" ]
+then
+  echo "No name provided, aborting ..."
+  usage
+  exit 1
+fi
+
+#Can
+sudo slcand -o -s6 -S3000000 $DEVICE $NAME
+sudo ifconfig $NAME up
+
+exit 0
diff --git a/scripts/debian/postinst b/scripts/debian/postinst
new file mode 100755
index 0000000000000000000000000000000000000000..193597eea3704becc4e75fbe5b6288783853baac
--- /dev/null
+++ b/scripts/debian/postinst
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+set -e
+
+case "$1" in
+  configure)
+    #echo "  Calling script"
+    #/var/lib/dpkg/info/iri-comm-dev.hello_world
+
+    if [ ! -z "$SUDO_USER" ]; then
+      echo "  Addind user to dialout group..."
+      sudo usermod -a -G dialout $SUDO_USER
+      echo "  Done."
+    fi
+
+    echo "  Adding 99-iri-comm-ftdi udev rule..."
+    FILE="/lib/udev/rules.d/99-iri-comm-ftdi.rules"
+    LINE0="#The following line allow the users on dialout to access SUBSYSTEM:VENDOR:PRODUCT=usb|usb_device:0403:6001 devices"
+    LINE1="SUBSYSTEM==\"usb|usb_device\", ATTRS{idVendor}==\"0403\", ATTRS{idProduct}==\"6001\", GROUP=\"dialout\""
+
+    sudo touch $FILE
+    grep -qF -- "$LINE0" "$FILE" || echo "$LINE0" | sudo tee -a "$FILE" > /dev/null
+    grep -qF -- "$LINE1" "$FILE" || echo "$LINE1" | sudo tee -a "$FILE" > /dev/null
+
+    #sudo udevadm control --reload-rules
+    sudo service udev restart
+    echo "  Done. It's necessary to unplug-plug devices for changes to take effect."
+
+    echo "  Adding iri-scripts-path.sh to /etc/profile.d..."
+    FILE="/etc/profile.d/iri-scripts-path.sh"
+    sudo echo "# Expand PATH to include the directory where IRI scripts go." > $FILE
+    sudo echo "iri_script_path=\"/usr/local/share/iri:/usr/share/iri\"" >> $FILE
+    sudo echo "if [ -n \"\${PATH##*\${iri_script_path}}\" -a -n \"\${PATH##*\${iri_script_path}:*}\" ]; then" >> $FILE
+    sudo echo "    export PATH=\$PATH:\${iri_script_path}" >> $FILE
+    sudo echo "fi" >> $FILE
+    echo "  Done. It's necessary a log out for changes to take effect."
+    
+  ;;
+  abort-upgrade)
+
+  ;;
+  abort-remove)
+
+  ;;
+  abort-deconfigure)
+
+  ;;
+esac   
+
+# usermod -a -G dialout $SUDO_USER
+# deluser $SUDO_USER dialout
+
+# 
+
+# echo "SUBSYSTEM==\"usb|usb_device\", ATTRS{idVendor}==\"0403\", ATTRS{idProduct}==\"6001\", GROUP=\"dialout\"" > /etc/udev/rules.d/99-ftdi.rules
+
+# udevadm control --reload-rules
+# service udev restart
+
+exit 0
diff --git a/scripts/debian/prerm b/scripts/debian/prerm
new file mode 100644
index 0000000000000000000000000000000000000000..0ad26db1be77a2bef43d6c0f40dab52d02e1dfe8
--- /dev/null
+++ b/scripts/debian/prerm
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+set -e
+
+case "$1" in
+  remove)
+    echo "  Removing 99-iri-comm-ftdi udev rule..."
+    FILE="/lib/udev/rules.d/99-iri-comm-ftdi.rules"
+    sudo rm -f $FILE
+
+    sudo udevadm control --reload-rules
+    sudo service udev restart
+    echo "  Done. Need to unplug-plug devices for changes to take effect"
+
+  ;;
+  upgrade)
+
+  ;;
+  deconfigure)
+
+  ;;
+  failed-upgrade)
+
+  ;;
+esac    
+
+exit 0
diff --git a/scripts/unbind_ftdi_udev.sh b/scripts/unbind_ftdi_udev.sh
new file mode 100755
index 0000000000000000000000000000000000000000..9a3a12bf09886c6744d900091f06d2a38e7ca51c
--- /dev/null
+++ b/scripts/unbind_ftdi_udev.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+echo "--- unbind_ftdi_udev.sh ---"
+
+# VENDOR=${1:-0403}
+# PRODUCT=${2:-6001}
+# SERIAL=${3:-A600eB1Y}
+# FILE=${4:-99-ftdi.rules}
+
+VENDOR="0403"
+PRODUCT="6001"
+SERIAL="A600eB1Y"
+FILE="99-ftdi-unbind-by-serial.rules"
+
+  # SERIAL DABO: A600eB1Y
+  # SERIAL TIBI: A600eByq
+  # SERIAL TEO:  A900WSG1
+
+usage() {
+  echo "Usage: $0 [-v <vendor>] [-p <product>] [-s <serial>] [-f <file> ]"
+  echo " -v  specify vendor  id.    Default 0403"
+  echo " -p  specify product id.    Default 6001"
+  echo " -s  specify serial number. Default A600eB1Y"
+  echo " -f  specify udev file.     Default 99-ftdi-unbind-by-serial.rules"
+  exit 1
+  }
+  
+while getopts ":hv:p:s:f:" arg; do
+  case $arg in
+    v)  VENDOR=$OPTARG;;
+    p) PRODUCT=$OPTARG;;
+    s)  SERIAL=$OPTARG;;
+    f)    FILE=$OPTARG;;
+    h) usage;;
+    *) usage;;
+  esac
+done
+shift $((OPTIND-1))
+
+
+FILE=/etc/udev/rules.d/$FILE
+
+echo "  Add udev rule so VENDOR:PRODUCT:SERIAL=${VENDOR}:${PRODUCT}:${SERIAL} devices do not load ftdi_sio driver."
+echo "  Adding new lines to udev rule file: ${FILE}"
+
+LINE0="#The following 2 lines make VENDOR:PRODUCT:SERIAL=${VENDOR}:${PRODUCT}:${SERIAL} devices not load ftdi_sio driver"
+LINE1="ATTRS{idVendor}==\"${VENDOR}\", ATTRS{idProduct}==\"${PRODUCT}\", ATTRS{serial}==\"${SERIAL}\", MODE:=\"0666\""
+LINE2="ATTRS{idVendor}==\"${VENDOR}\", ATTRS{idProduct}==\"${PRODUCT}\", ATTRS{serial}==\"${SERIAL}\", RUN+=\"/bin/sh -c 'echo \$kernel > /sys/bus/usb/drivers/ftdi_sio/unbind'\""
+
+sudo touch $FILE
+grep -qF -- "$LINE0" "$FILE" || echo "$LINE0" | sudo tee -a "$FILE" > /dev/null
+grep -qF -- "$LINE1" "$FILE" || echo "$LINE1" | sudo tee -a "$FILE" > /dev/null
+grep -qF -- "$LINE2" "$FILE" || echo "$LINE2" | sudo tee -a "$FILE" > /dev/null
+
+sudo service udev restart
+echo "  Need to unplug-plug devices for changes to take effect"
\ No newline at end of file
diff --git a/scripts/undo_unbind_ftdi_udev.sh b/scripts/undo_unbind_ftdi_udev.sh
new file mode 100755
index 0000000000000000000000000000000000000000..6d25f0b0eb9f776af2cb7ce3b36f961d9797686a
--- /dev/null
+++ b/scripts/undo_unbind_ftdi_udev.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+# SERIAL=${3:-A600eB1Y}
+# FILE=${4:-99-ftdi.rules}
+
+SERIAL="A600eB1Y"
+FILE="99-ftdi.rules"
+
+  # SERIAL DABO: A600eB1Y
+  # SERIAL TIBI: A600eByq
+  # SERIAL TEO:  A900WSG1
+
+usage() {
+  echo "Usage: $0 [-v <vendor>] [-p <product>] [-s <serial>] [-f <file> ]"
+  echo " -s  specify serial number. Default A600eB1Y"
+  echo " -f  specify udev file.     Default 99-ftdi.rules"
+  exit 1
+  }
+  
+while getopts ":hv:p:s:f:" arg; do
+  case $arg in
+    s)  SERIAL=$OPTARG;;
+    f)    FILE=$OPTARG;;
+    h) usage;;
+    *) usage;;
+  esac
+done
+shift $((OPTIND-1))
+
+
+FILE=/etc/udev/rules.d/$FILE
+
+echo "Undo addition of udev rule so VENDOR:PRODUCT:SERIAL=${VENDOR}:${PRODUCT}:${SERIAL} devices do not load ftdi_sio driver."
+echo "Removing all lines containing SERIAL=${SERIAL} from file: ${FILE}"
+
+LINE0=${SERIAL}
+sudo sed -i "/${LINE0}/d" $FILE
+
+sudo sed -i -E "/idVendor.*$VENDOR.*idProduct.*$PRODUCT.*serial.*$SERIAL.*MODE.*0666\"/d" $FILE
+sudo sed -i -E "/idVendor.*$VENDOR.*idProduct.*$PRODUCT.*serial.*$SERIAL.*RUN.*ftdi_sio\/unbind/d" $FILE 
+
+sudo service udev restart
+echo "Need to unplug-plug devices for changes to take effect"
\ No newline at end of file
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c7170126dadc40f0730388f7f18c69abdb71553a..be1879269595f0193ad4db42a7bc22d5ae04a417 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,80 +1,83 @@
 SET(ftdi_headers ftd2xx.h WinTypes.h)
 SET(ftdi_libs ftd2xx)
 SET(ftdi_local_dir ${CMAKE_SOURCE_DIR}/tools/libftd2)
-FIND_PATH(FTDI_INCLUDE_DIR ${ftdi_headers} /usr/include/ /usr/local/include/)
+FIND_PATH(FTDI_INCLUDE_DIRS ${ftdi_headers} /usr/include/ /usr/local/include/)
 
-FIND_LIBRARY(FTDI_LIBRARY
+FIND_LIBRARY(FTDI_LIBRARIES
     NAMES ${ftdi_libs}
     PATHS /usr/lib /usr/local/lib)
 
-IF(FTDI_INCLUDE_DIR AND FTDI_LIBRARY)
+IF(FTDI_INCLUDE_DIRS AND FTDI_LIBRARIES)
   #use the already intalled libftd2
   SET(BUILD_FTDI TRUE)
-ELSE(FTDI_INCLUDE_DIR AND FTDI_LIBRARY)
+ELSE(FTDI_INCLUDE_DIRS AND FTDI_LIBRARIES)
   #use the local copies if possible
-  FIND_PATH(FTDI_INCLUDE_DIR ftd2xx.h WinTypes.h ${ftdi_local_dir})
-  MESSAGE(STATUS "INCLUDE ${FTDI_INCLUDE_DIR}" )
-  SET(FTDI_LIBRARY)
+  FIND_PATH(FTDI_INCLUDE_DIRS ftd2xx.h WinTypes.h ${ftdi_local_dir})
+  MESSAGE(STATUS "INCLUDE ${FTDI_INCLUDE_DIRS}" )
+  SET(FTDI_LIBRARIES)
   if (UNIX AND NOT WIN32)
     if (CMAKE_SIZEOF_VOID_P MATCHES "8")
-      FIND_LIBRARY(FTDI_LIBRARY  NAMES ftd2xx PATHS ${ftdi_local_dir}/build/x86_64)
-      MESSAGE(STATUS "LIB64 ${FTDI_LIBRARY}")
+      FIND_LIBRARY(FTDI_LIBRARIES  NAMES ftd2xx PATHS ${ftdi_local_dir}/build/x86_64)
+      MESSAGE(STATUS "LIB64 ${FTDI_LIBRARIES}")
     else (CMAKE_SIZEOF_VOID_P MATCHES "8")
-      FIND_LIBRARY(FTDI_LIBRARY  NAMES ${ftdi_libs} PATHS ${ftdi_local_dir}/build/i386)
-      MESSAGE(STATUS "LIB32 ${FTDI_LIBRARY}")
+      FIND_LIBRARY(FTDI_LIBRARIES  NAMES ${ftdi_libs} PATHS ${ftdi_local_dir}/build/i386)
+      MESSAGE(STATUS "LIB32 ${FTDI_LIBRARIES}")
     endif (CMAKE_SIZEOF_VOID_P MATCHES "8")
   endif (UNIX AND NOT WIN32)  
-  IF(FTDI_INCLUDE_DIR AND FTDI_LIBRARY)
+  IF(FTDI_INCLUDE_DIRS AND FTDI_LIBRARIES)
     SET(BUILD_FTDI TRUE)
     SET(INSTALL_FTDI TRUE)
     SET(FTDI_VER 1.3.6)
     MESSAGE(STATUS "Use local ftdi files")
-  ELSE(FTDI_INCLUDE_DIR AND FTDI_LIBRARY)
+  ELSE(FTDI_INCLUDE_DIRS AND FTDI_LIBRARIES)
     MESSAGE(STATUS "FTDI library won't be build. Impossible to locate the necessary files")     
-  ENDIF(FTDI_INCLUDE_DIR AND FTDI_LIBRARY)
-ENDIF(FTDI_INCLUDE_DIR AND FTDI_LIBRARY)
+  ENDIF(FTDI_INCLUDE_DIRS AND FTDI_LIBRARIES)
+ENDIF(FTDI_INCLUDE_DIRS AND FTDI_LIBRARIES)
+
+SET(FTDI_INCLUDE_DIR ${FTDI_INCLUDE_DIRS})
+SET(FTDI_LIBRARY    ${FTDI_LIBRARIES})
 
 # edit the following line to add all the source code files of the library
 SET(sources ./comm.cpp ./cqueue.cpp ./commexceptions.cpp ./serial/rs232.cpp ./serial/rs232exceptions.cpp  ./sockets/socket.cpp ./sockets/socketclient.cpp ./sockets/socketserver.cpp ./sockets/socketudp.cpp ./sockets/socketexceptions.cpp ./can/can.cpp ./can/virtual_can.cpp)
 # edit the following line to add all the header files of the library
-SET(headers ./comm.h ./cqueue.h ./commexceptions.h ./serial/rs232.h ./serial/rs232exceptions.h ./sockets/socket.h ./sockets/socketclient.h ./sockets/socketserver.h ./sockets/socketudp.h ./sockets/socketexceptions.h ./can/can.h ./can/virtual_can.h)
+SET(headers ../include/comm.h ../include/cqueue.h ../include/commexceptions.h ../include/serial/rs232.h ../include/serial/rs232exceptions.h ../include/sockets/socket.h ../include/sockets/socketclient.h ../include/sockets/socketserver.h ../include/sockets/socketudp.h ../include/sockets/socketexceptions.h ../include/can/can.h ../include/can/virtual_can.h)
 
 IF(BUILD_FTDI)
   SET(sources ${sources} ./usb_ftdi/ftdiserver.cpp ./usb_ftdi/ftdimodule.cpp ./usb_ftdi/ftdiexceptions.cpp)
-  SET(headers ${headers} ./usb_ftdi/ftdiserver.h ./usb_ftdi/ftdimodule.h ./usb_ftdi/ftdiexceptions.h)
+  SET(headers ${headers} ../include/usb_ftdi/ftdiserver.h ../include/usb_ftdi/ftdimodule.h ../include/usb_ftdi/ftdiexceptions.h)
 ENDIF(BUILD_FTDI)
 
-INCLUDE_DIRECTORIES(.)
+INCLUDE_DIRECTORIES(../include)
 
 # edit the following line to find the necessary packages
 FIND_PACKAGE(iriutils REQUIRED)
 
-INCLUDE_DIRECTORIES(${iriutils_INCLUDE_DIR})
+INCLUDE_DIRECTORIES(${iriutils_INCLUDE_DIRS})
 
 # edit the following line to add the necessary include directories
-INCLUDE_DIRECTORIES(./serial ./usb_ftdi ./sockets ./can)
+INCLUDE_DIRECTORIES(../include/serial ../include/usb_ftdi ../include/sockets ../include/can)
 
 IF(BUILD_FTDI)
-  INCLUDE_DIRECTORIES(${FTDI_INCLUDE_DIR})
+  INCLUDE_DIRECTORIES(${FTDI_INCLUDE_DIRS})
 ENDIF(BUILD_FTDI)
 
 ADD_LIBRARY(comm SHARED ${sources})
 
 #edit the following line to add the necessary system libraries (if any)
 
-TARGET_LINK_LIBRARIES(comm ${iriutils_LIBRARY})
+TARGET_LINK_LIBRARIES(comm ${iriutils_LIBRARIES})
 
 IF(BUILD_FTDI) 
-  TARGET_LINK_LIBRARIES(comm ${FTDI_LIBRARY})
+  TARGET_LINK_LIBRARIES(comm ${FTDI_LIBRARIES})
 ENDIF(BUILD_FTDI)
 
 INSTALL(TARGETS comm
   RUNTIME DESTINATION bin
-  LIBRARY DESTINATION lib/iridrivers
-  ARCHIVE DESTINATION lib/iridrivers
+  LIBRARY DESTINATION lib/iri/${PROJECT_NAME}
+  ARCHIVE DESTINATION lib/iri/${PROJECT_NAME}
 )
 
-INSTALL(FILES ${headers} DESTINATION include/iridrivers)
+INSTALL(FILES ${headers} DESTINATION include/iri/${PROJECT_NAME})
 
 INSTALL(FILES ../Findcomm.cmake DESTINATION ${CMAKE_ROOT}/Modules/)
 
@@ -85,4 +88,12 @@ INSTALL(FILES ${ftdi_local_dir}/WinTypes.h DESTINATION include)
 INSTALL(FILES ${FTDI_LIBRARY} DESTINATION lib)
 INSTALL(FILES ${FTDI_LIBRARY}.${FTDI_VER} DESTINATION lib)
 ENDIF(INSTALL_FTDI)
+
+INSTALL(FILES  ../scripts/can.sh 
+               ../scripts/unbind_ftdi_udev.sh 
+               ../scripts/undo_unbind_ftdi_udev.sh
+               DESTINATION share/iri
+               PERMISSIONS OWNER_EXECUTE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE)
+
+
 ADD_SUBDIRECTORY(examples)