Tweaking ASUS Zenbook UX305CA on Linux

Lately I was searching for mobile notebook that I could use for remote work. I checked f ThinkPad series but they were huge bricks that have nothing in common with ‘mobile’ word. Then I saw ASUS Zenbook that I didn’t take into account before and it was exactly what I was searching for.

Configuration of Skylake based notebook right now is not straightforward – there are still glitches and small bugs that are waiting to be fixed. I want to sum up what I’ve done after installation. I started with fresh Ubuntu 16.04 to get Debian based distro with possibly latest kernel and patches.

Some SSD tweaks

Change mount options for filesystems on SSD from:

/dev/mapper/ubuntu--vg-root / ext4 errors=remount-ro 0 1

to:

/dev/mapper/ubuntu--vg-root / ext4 discard,noatime,errors=remount-ro 0 1

And move /tmp to RAM with this additional line in /etc/fstab:

tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0

Now add deadline scheduler for root disk – edit /etc/rc.local and add this line before exit 0:

echo deadline > /sys/block/sda/queue/scheduler
echo 1 > /sys/block/sda/queue/iosched/fifo_batch

I have configured swap but I don’t want to use it too much and setting low swappines sysctl option will help. Run this as root:

echo "vm.swappiness = 1" > /etc/sysctl.d/90-swappines.conf
sysctl -p /etc/sysctl.d/90-swappines.conf

Power usage tweaks

I’ve installed laptop-mode-tools to achieve lower power usage on battery. So:

apt-get install -y laptop-mode-tools

By default it’s cutting hard CPU performance on battery (half performance, no turbo) so I fixed this by changing /etc/laptop-mode/conf.d/intel_pstate.conf section On battery:

#On battery
BATT_INTEL_PSTATE_PERF_MIN_PCT=0 # Minimum performance, in percent
BATT_INTEL_PSTATE_PERF_MAX_PCT=100 # Maximum performance, in percent
BATT_INTEL_PSTATE_NO_TURBO=0 # Disable "Turbo Boost"?

Laptop mode tools won’t start automatically so we may integrate them with pm-utils (that are already installed on Ubuntu) to get it running when needed. We have to create new config file:

sudo touch /etc/pm/sleep.d/10-laptop-mode-tools
sudo chmod a+x /etc/pm/sleep.d/10-laptop-mode-tools

with content like this:

case $1 in
    hibernate)
        /etc/init.d/laptop-mode stop
        ;;
    suspend)
        /etc/init.d/laptop-mode stop
        ;;
    thaw)
        /etc/init.d/laptop-mode start
        ;;
    resume)
        /etc/init.d/laptop-mode start
        ;;
    *)
        echo Something is not right.
        ;;
esac

Now I will enable ALPM for SATA in AHCI mode optimizations:

echo SATA_ALPM_ENABLE=true | sudo tee /etc/pm/config.d/sata_alpm

And some kernel parameters in /etc/default/grub:

GRUB_CMDLINE_LINUX="pcie_aspm=force"

(config with additional drm.vblankoffdelay=1 i915.semaphores=1 worked for me on Ubuntu 16.04 but on 16.10 caused system stability problems so I don’t recommend it now)

After changes update grub with:

update-grub

You may use powertop to nail power heavy processes. There is also powerstat to benchmark power usage through time – I have:

sudo pm-powersave true
powerstat

......

Summary:
System: 4.49 Watts on average with standard deviation 0.46 

It’s really nice. I should be able to run about 8~9h! Sweet!

Source:
https://www.reddit.com/r/linux/comments/3ia8ta/review_of_ubuntu_on_asus_ux305fa/
https://help.ubuntu.com/community/PowerManagement/ReducedPower#Using_less_power_with_laptop-mode-tools
https://help.ubuntu.com/community/AsusZenbook
https://wiki.ubuntu.com/Kernel/PowerManagementALPM

Disable touchpad when writing

It’s crazy annoying when you tap touchpad during writing text and lose focus on editor window. There is solution for that, it’s even installed by default on Ubuntu and it’s called: syndaemon. It’s started by default like this:


syndaemon -i 1.0 -t -K -R

1 second feels too small for me. I will adjust it to 2s. There is no easy way to do this. I created script to run on login:


#!/bin/bash
killall syndaemon
syndaemon -d -i 2.0 -t -K -R

Now better 🙂

VD-PAU

I installed vdpauinfo tool to see if it’s working:

apt-get install -y vdpauinfo

It wasn’t:

# vdpauinfo 
display: :0   screen: 0
Failed to open VDPAU backend libvdpau_va_gl.so: cannot open shared object file: No such file or directory
Error creating VDPAU device: 1

I checked this library and couldn’t find it – it wasn’t installed. Easy fix:

apt-get install -y libvdpau-va-gl1

Check again:

# vdpauinfo 
display: :0   screen: 0
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
API version: 1
Information string: OpenGL/VAAPI/libswscale backend for VDPAU

Video surface:

name   width height types
-------------------------------------------
420     1920  1080  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 
422     1920  1080  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 
444     1920  1080  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 

Decoder capabilities:

name                        level macbs width height
----------------------------------------------------
MPEG1                          --- not supported ---
MPEG2_SIMPLE                   --- not supported ---
MPEG2_MAIN                     --- not supported ---
H264_BASELINE                  51 16384  2048  2048
H264_MAIN                      51 16384  2048  2048
H264_HIGH                      51 16384  2048  2048
VC1_SIMPLE                     --- not supported ---
VC1_MAIN                       --- not supported ---
VC1_ADVANCED                   --- not supported ---
MPEG4_PART2_SP                 --- not supported ---
MPEG4_PART2_ASP                --- not supported ---
DIVX4_QMOBILE                  --- not supported ---
DIVX4_MOBILE                   --- not supported ---
DIVX4_HOME_THEATER             --- not supported ---
DIVX4_HD_1080P                 --- not supported ---
DIVX5_QMOBILE                  --- not supported ---
DIVX5_MOBILE                   --- not supported ---
DIVX5_HOME_THEATER             --- not supported ---
DIVX5_HD_1080P                 --- not supported ---
H264_CONSTRAINED_BASELINE      51 16384  2048  2048
H264_EXTENDED                  --- not supported ---
H264_PROGRESSIVE_HIGH          --- not supported ---
H264_CONSTRAINED_HIGH          --- not supported ---
H264_HIGH_444_PREDICTIVE       --- not supported ---
HEVC_MAIN                      --- not supported ---
HEVC_MAIN_10                   --- not supported ---
HEVC_MAIN_STILL                --- not supported ---
HEVC_MAIN_12                   --- not supported ---
HEVC_MAIN_444                  --- not supported ---

Output surface:

name              width height nat types
----------------------------------------------------
B8G8R8A8          8192  8192    y  
R8G8B8A8          8192  8192    y  
R10G10B10A2       8192  8192    y  
B10G10R10A2       8192  8192    y  
A8                8192  8192    y  

Bitmap surface:

name              width height
------------------------------
B8G8R8A8          8192  8192
R8G8B8A8          8192  8192
R10G10B10A2       8192  8192
B10G10R10A2       8192  8192
A8                8192  8192

Video mixer:

feature name                    sup
------------------------------------
DEINTERLACE_TEMPORAL             -
DEINTERLACE_TEMPORAL_SPATIAL     -
INVERSE_TELECINE                 -
NOISE_REDUCTION                  -
SHARPNESS                        -
LUMA_KEY                         -
HIGH QUALITY SCALING - L1        -
HIGH QUALITY SCALING - L2        -
HIGH QUALITY SCALING - L3        -
HIGH QUALITY SCALING - L4        -
HIGH QUALITY SCALING - L5        -
HIGH QUALITY SCALING - L6        -
HIGH QUALITY SCALING - L7        -
HIGH QUALITY SCALING - L8        -
HIGH QUALITY SCALING - L9        -

parameter name                  sup      min      max
-----------------------------------------------------
VIDEO_SURFACE_WIDTH              -  
VIDEO_SURFACE_HEIGHT             -  
CHROMA_TYPE                      -  
LAYERS                           -  

attribute name                  sup      min      max
-----------------------------------------------------
BACKGROUND_COLOR                 -  
CSC_MATRIX                       -  
NOISE_REDUCTION_LEVEL            -  
SHARPNESS_LEVEL                  -  
LUMA_KEY_MIN_LUMA                -  
LUMA_KEY_MAX_LUMA                -

Looks better now… But not impressive, there’s only H264 support.

I’ve tried it in VLC but it was crashing from time to time the whole VLC (leaving it running in background). Time to test VA-API 🙂

VA-API

Like earlier I have to install one tool to see what we have: vainfo

apt-get install -y vainfo

Checking what we have on system:


$ vainfo 
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.39 (libva 1.7.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Skylake - 1.7.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Simple            :	VAEntrypointEncSlice
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264MultiviewHigh      :	VAEntrypointVLD
      VAProfileH264MultiviewHigh      :	VAEntrypointEncSlice
      VAProfileH264StereoHigh         :	VAEntrypointVLD
      VAProfileH264StereoHigh         :	VAEntrypointEncSlice
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointEncPicture
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileVP8Version0_3          :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice

It requires package i965-va-driver to work but on my system it was instal(ed (probably during VDPAU installation as dependency).

It was working almost fine… In VLC on my machine VA-API on X11 was drawing through all desktops. VA-API DRM was working better… But crashed my X11 server after few minutes of watching ;/

OpenCL

You may thing: for what the hell you need OpenCL on such tiny machine? I doesn’t care – I want it 🙂

First install clinfo package:

apt-get install -y clinfo

And run it:

# clinfo 
Number of platforms                               0

Not too much 😀

For Intel GPU/CPU OpenCL support we will need beignet package:

apt-get install -y beignet

# clinfo 
Number of platforms                               1
  Platform Name                                   Intel Gen OCL Driver
  Platform Vendor                                 Intel
  Platform Version                                OpenCL 1.2 beignet 1.1.1
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_spir cl_khr_icd
  Platform Extensions function suffix             Intel

  Platform Name                                   Intel Gen OCL Driver
Number of devices                                 1
  Device Name                                     Intel(R) HD Graphics Skylake ULX GT2
  Device Vendor                                   Intel
  Device Vendor ID                                0x8086
  Device Version                                  OpenCL 1.2 beignet 1.1.1
  Driver Version                                  1.1.1
  Device OpenCL C Version                         OpenCL C 1.2 beignet 1.1.1
  Device Type                                     GPU
  Device Profile                                  FULL_PROFILE
  Max compute units                               24
  Max clock frequency                             1000MHz
  Device Partition                                (core)
    Max number of sub-devices                     1
    Supported partition types                     None, None, None
  Max work item dimensions                        3
  Max work item sizes                             512x512x512
  Max work group size                             512
  Preferred work group size multiple              16
  Preferred / native vector sizes                 
    char                                                16 / 8       
    short                                                8 / 8       
    int                                                  4 / 4       
    long                                                 2 / 2       
    half                                                 0 / 8        (cl_khr_fp16)
    float                                                4 / 4       
    double                                               0 / 2        (n/a)
  Half-precision Floating-point support           (cl_khr_fp16)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Single-precision Floating-point support         (core)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Double-precision Floating-point support         (n/a)
  Address bits                                    32, Little-Endian
  Global memory size                              2147483648 (2GiB)
  Error Correction support                        No
  Max memory allocation                           1073741824 (1024MiB)
  Unified memory for Host and Device              Yes
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       1024 bits (128 bytes)
  Global Memory cache type                        Read/Write
  Global Memory cache size                        8192
  Global Memory cache line                        64 bytes
  Image support                                   Yes
    Max number of samplers per kernel             16
    Max size for 1D images from buffer            65536 pixels
    Max 1D or 2D image array size                 2048 images
    Max 2D image size                             8192x8192 pixels
    Max 3D image size                             8192x8192x2048 pixels
    Max number of read image args                 128
    Max number of write image args                8
  Local memory type                               Global
  Local memory size                               65536 (64KiB)
  Max constant buffer size                        134217728 (128MiB)
  Max number of constant args                     8
  Max size of kernel argument                     1024
  Queue properties                                
    Out-of-order execution                        No
    Profiling                                     Yes
  Prefer user sync for interop                    Yes
  Profiling timer resolution                      80ns
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            Yes
    SPIR versions                                 
  printf() buffer size                            1048576 (1024KiB)
  Built-in kernels                                __cl_copy_region_align4;__cl_copy_region_align16;__cl_cpy_region_unalign_same_offset;__cl_copy_region_unalign_dst_offset;__cl_copy_region_unalign_src_offset;__cl_copy_buffer_rect;__cl_copy_image_1d_to_1d;__cl_copy_image_2d_to_2d;__cl_copy_image_3d_to_2d;__cl_copy_image_2d_to_3d;__cl_copy_image_3d_to_3d;__cl_copy_image_2d_to_buffer;__cl_copy_image_3d_to_buffer;__cl_copy_buffer_to_image_2d;__cl_copy_buffer_to_image_3d;__cl_fill_region_unalign;__cl_fill_region_align2;__cl_fill_region_align4;__cl_fill_region_align8_2;__cl_fill_region_align8_4;__cl_fill_region_align8_8;__cl_fill_region_align8_16;__cl_fill_region_align128;__cl_fill_image_1d;__cl_fill_image_1d_array;__cl_fill_image_2d;__cl_fill_image_2d_array;__cl_fill_image_3d;
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Device Extensions                               cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_fp16 cl_khr_spir cl_khr_icd

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Intel Gen OCL Driver
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Success [Intel]
  clCreateContext(NULL, ...) [default]            Success [Intel]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  Success (1)
    Platform Name                                 Intel Gen OCL Driver
    Device Name                                   Intel(R) HD Graphics Skylake ULX GT2
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  Success (1)
    Platform Name                                 Intel Gen OCL Driver
    Device Name                                   Intel(R) HD Graphics Skylake ULX GT2

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.2.8
  ICD loader Profile                              OpenCL 1.2
	NOTE:	your OpenCL library declares to support OpenCL 1.2,
		but it seems to support up to OpenCL 2.1 too.

Source:
https://wiki.archlinux.org/index.php/GPGPU#Intel

Suspend/Hibernate on lid close

Default configuration of Ubuntu 16.04 was that after I close lid screen was blocked and LCD disabled. But system was still working normally – I strongly prefer to hibernate in such case and use no battery at all.

I achieved that with systemd-logind. Edit /etc/systemd/logind.conf and uncomment line with HandleLidSwitch:

[Login]
HandleLidSwitch=suspend
HandleLidSwitchDocked=ignore

Now restart systemd-logind service with:

systemctl restart systemd-logind.service 

Problem with function keys

Function keys were mostly working but not always like I expected. For example when I disable touchpad – it’s not disabled 🙂

I found that module asus-nb-wmi is responssible for that and it’s still buggy. So I disabled it at all with:

echo "blacklist asus-nb-wmi" > /etc/modprobe.d/blacklist-ux305.conf

Volume UP/DOWN/MUTE are still working fine – that’s enough for me. Rest could be configured with some keyboard shortcuts – more info here.

TODO/Issues

I still face some bugs:

  • I could see occasional flickering from time to time. Rather after running notebook for some time than overheating/overloading it. This may be driver issue or maybe SNA acceleration method – I have to experiment a little to get this solved.
    Looks like disabling Virtualization support and VT-d in BIOS helped. It’s not final solution but for now I don’t need it… A lot 😉
  • Tapping sometimes behave strange, for ex. tap to click stops to work and I have to use touchpad buttons for that. I think this may be related to syndaemon configuration because it started after I tuned it.
    It was that. My hack for syndaemon broke touchpad. I will play with this a little more later.
  • I like to use copy by selection and paste by middle click on my desktop – I’m addicted to this option but it’s not working on my laptop. I’m not sure if this will be convenient enough on touchpad to use.
    To right click just tap with two fingers, to middle click (third button) tap with three fingers. Copy/paste is again easy like before.

If you found errors in my text of know better solutions for described problems, please tell in comments.

Manual installation of Docker on Debian/Ubuntu

I've played with Docker a little in it early days but didn't stick for longer with it. It's stable now so I wanted to check how it's running now.

I really can't accept this method of installation:

$ curl -fsSL https://get.docker.com/ | sh

I think that world is going to it's end when I see such scritps… I prefer to do this manually, knowing exactly what I have to do.

Install prerequisites:

apt-get update
apt-get install -y apt-transport-https ca-certificates

Purge old packages if you used them:

apt-get purge lxc-docker*
apt-get purge docker.io*

Add GPG key:

apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

Add repo – use ONLY ONE repo appropriate for your system (lsb_release -a to check):

echo "deb https://apt.dockerproject.org/repo debian-wheezy main" > /etc/apt/sources.list.d/docker.list
echo "deb https://apt.dockerproject.org/repo debian-jessie main" > /etc/apt/sources.list.d/docker.list
echo "deb https://apt.dockerproject.org/repo debian-stretch main" > /etc/apt/sources.list.d/docker.list
echo "deb https://apt.dockerproject.org/repo ubuntu-precise main" > /etc/apt/sources.list.d/docker.list
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /etc/apt/sources.list.d/docker.list

Refresh repos and install Docker:

apt-get update
apt-get install -y docker-engine

Start service if it's not running:

service docker start

Grant access to docker service for non-root user

I don't like to use apps that require me to use root account. Docker even advice not to do so – service is running as root and you should add docker group and user to it to grant access to service socket:

groupadd docker
gpasswd -a ${USER} docker
service docker restart

Now logout, login again and and you should be able to use docker command:

docker version
docker info
docker run hello-world

Have fun 🙂

Source:
https://docs.docker.com/linux/
https://docs.docker.com/engine/installation/

Use www.horizon.tv with Pipelight/Silverlight on Linux/Ubuntu

From few days I have access to UPC’s www.horizon.tv platform – until now it was useless on Linux. But there is Pipelight that will use Wine to emulate Silverlight on Linux and it’s working pretty well – you’re just few commands away from achieving that:

# stop browser
killall firefox
# remove old version if you have it
sudo apt-get remove pipelight

Now configure repos and install packages:

sudo apt-add-repository ppa:pipelight/stable
sudo apt-get update
sudo apt-get install --install-recommends pipelight-multi
sudo pipelight-plugin --update

Enable plugin (run it with sudo for system wide installation):

pipelight-plugin --enable silverlight

Start Firefox and test if plugin is working here: http://bubblemark.com/silverlight2.html

Now enter www.horizon.tv and try it yourself.

P.S.
It works only on Firefox because Chrome do not support NPAPI plugins anymore 🙁

Source:
http://www.webupd8.org/2013/08/pipelight-use-silverlight-in-your-linux.html

Grafana – installation and configuraton with InfluxDB and CollectD on Debian/Ubuntu

Now when you have CollectD and InfluxDB installed you may configure Grafana 🙂

First configure repo with current Grafana version (select your distro):

curl https://packagecloud.io/gpg.key | sudo apt-key add -
deb https://packagecloud.io/grafana/testing/debian/ wheezy main

Now install package (on wheezy I needed to install apt-transport-https to allow installation of packages from repo via HTTPS):

apt-get update
apt-get install -y apt-transport-https
apt-get install -y grafana

By default Grafana will use sqlite database to keep information about users, etc:

[database]
# Either "mysql", "postgres" or "sqlite3", it's your choice
;type = sqlite3
;host = 127.0.0.1:3306
;name = grafana
;user = root
;password =

If that’s ok for you, you may leave it as is. I prefer to configure MySQL database (create user, database, grant permissions to user):

[database]
type = mysql
host = 127.0.0.1:3306
name = grafana
user = grafana
password = mydbpassword

So Grafana should be running on port 3000 by default, now it’s time to connect ex.: http://localhost:3000 (use your host). Now click Data sources on left panel, then Add new on top panel and fill source data like below:

Grafana add data source

Because we didn’t set authorization for InfluxDB you may just type whatever login/password there. Now Test Connection and Save and you should be ready to play with Grafana.

I also used scripted dashboard for Grafana to add easily statistics for my hosts, you may find it here: https://github.com/anryko/grafana-influx-dashboard

Source:
http://docs.grafana.org/installation/debian/

InfluxDB – installation and configuration on Debian/Ubuntu

I wanted/needed some statistics on few my machines. I saw earlier grafana and was impressed so this was starting point. Then I started reading about graphite, carbon and whisper, and then… I found InfluxDB. Project is young but looks promising.

Let’s start! On project page there is no info about repo but it’s available, configure it:

curl -sL https://repos.influxdata.com/influxdb.key | apt-key add -
echo "deb https://repos.influxdata.com/debian wheezy stable" > /etc/apt.sources.list.d/influxdb.conf

for Ubuntu use url like (of course selecting your version):

echo "deb https://repos.influxdata.com/ubuntu wily stable" > /etc/apt.sources.list.d/influxdb.conf

Now install package (on wheezy I needed to install apt-transport-https to allow installation of packages from repo via HTTPS):

apt-get install -y apt-transport-https
apt-get install -y influxdb

Now edit /etc/influxdb/influxdb.conf and uncoment/fill [collectd] section like this:

[collectd]
  enabled = true
  bind-address = ":8096"
  database = "collectd_db"
  typesdb = "/usr/share/collectd/types.db"

You may adjust port to whatever suits you best. database sets InfluxDB database used to store collectd data, and typesdb is file from collectd package defining collectd metrics structure (this is location for Debian) – so you have collectd service installed earlier.

Now you may check if InfluxDB is working fine by connecting to web admin panel, by standard on port 8083.

Source:
https://github.com/influxdata/influxdb/issues/585
https://anomaly.io/collectd-metrics-to-influxdb/