Community
cancel
Showing results for 
Search instead for 
Did you mean: 
sk23
New Contributor II
2,702 Views

measure power consumption on Edison board

Jump to solution

Hi ,

I want to measure power consumption on Edison board and other devices/interface(Wi-Fi ,BT and connected Sensors) .

Is there any way to measure the power on Edison.

I am using http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-edison/about/ meta-intel-edison - Layer for the Intel Edison Development Platform this build.

I want use similar to powertop in ubuntu.(reference https://github.com/fenrus75/powertop GitHub - fenrus75/powertop: The Linux PowerTOP tool -- please post patches to the mailing list instead of using github …

I download powertop2.8 cd powertop2.8

here is the process for power top setup/installation.

./configure

./make

./make install

powertop depends on below modules.

pciutils-devel (is only required if you have PCI)

ncurses-devel (required)

libnl-devel (required)

power top ./configure LOG

checking pkg-config is at least version 0.9.0... yes

checking for NCURSES... yes

checking for PCIUTILS... no

checking for library containing pci_get_dev... no

checking for LIBNL... no

checking for LIBNL... no

checking for LIBNL... no

configure: error: libnl and libnl-genl are required but were not found.

I was unable install PCIUTILS and libnl( debends on other modules like libm )

libnl-1.1 LOG

Included in Compilation:

libnl: Yes -lm

Dependencies:

libm Yes (required)

Please do need full.

0 Kudos
1 Solution
idata
Community Manager
87 Views

Hi guys,

 

 

We found the way to install PowerTOP in the Edison Board. The package is provided in the IOTDK repository ( http://iotdk.intel.com/repos/3.5/iotdk/edison/core2-32), so please try to follow the next steps:

 

 

1. Add on the /etc/opkg/iotkit.conf file the following repos:

 

src iotkit http://iotdk.intel.com/repos/3.5/intelgalactic/opkg/i586/  src iotdk-all http://iotdk.intel.com/repos/3.5/iotdk/edison/all  src iotdk-core2-32 http://iotdk.intel.com/repos/3.5/iotdk/edison/core2-32  src iotdk-edison http://iotdk.intel.com/repos/3.5/iotdk/edison/edison

 

 

2. Run opkg update command.

 

 

3. Install PowerTOP with the command: opkg install powertop.

 

 

4. If you still have problems with libnl and pciutils, force reinstall on those packages:

 

opkg install libnl --force-reinstall  opkg install pciutils --force-reinstall

 

 

I successfully installed PowerTOP with the steps that I gave you, so please try it and let me know if it works for you.

 

 

Thank you for remaining so positive.

 

 

Regards,

 

-Leonardo

View solution in original post

18 Replies
idata
Community Manager
87 Views

Hi IoT_srinivas,

 

 

I found another thread related with measuring power consumption of Edison, you can check the answer in the next link: https://communities.intel.com/thread/56767 https://communities.intel.com/thread/56767, as you can see in the correct answer, the user recommends to do it manually in the hardware.

 

 

About PowerTOP and the problem with PCIUTILS and libnl packages, you can find them in the AlexT's repo so I recommend you to try to install those packages from the following repo: http://alextgalileo.altervista.org/edison-package-repo-configuration-instructions.html

 

 

I hope you find this information useful,

 

 

Regards,

 

-Leonardo
idata
Community Manager
87 Views

Hi IoT_srinivas,

 

 

Was the information helpful? Did you install the packages PCIUTILS and libnl?

 

 

If you need something else don't doubt to ask us.

 

 

Regards,

 

-Leonardo
RKasu
New Contributor I
87 Views

Hi Leonardo,

Yes,Even I'm getting the same error if I'm trying to get the power details through powertop,Cannot able to install pciutils and libnl on the intel edison arduino expansion board. I have tried the IMAGE_INSTALL += "pciutils" and IMAGE_INSTALL += "libnl" in both latest yocto image and meta intel edison image provided in bsp guide ,and flashing on the board,but couldn't download the respective packages on my edison board.I have already followed the steps of Alex's repository too i.e, from http://alextgalileo.altervista.org/edison-package-repo-configuration-instructions.html Edison Package Repo Configuration Instructions but couldn't find the source code and the steps to get the power.Could you please provide the detailed steps of the above repository and source code ?

Could you please provide the necessary steps to find the power for each process that is goingon on the intel edison board in one way or the other.???Any and every help is appreciated.I'm pinning the screenshot of my error message.

 

Thanks and Regards,

Radhika

sk23
New Contributor II
87 Views

Hi Leonardo ,

I try to install the packages PCIUTILS and libnl .I given the steps on above but unable install the package.

Please provide the necessary steps and source code to compile and install.

Regards,

Srinivas

idata
Community Manager
87 Views

Hi guys,

 

 

In the link that I provided you on the first reply there are the steps to download the packages in the repository but I'll try my best to explain this better.

 

 

Once you log in on your Edison, you have to edit the base-feeds.conf file so you can do it with the command cat >> /etc/opkg/base-feeds.conf and add the lines of the repo. Next you download the packages with the command opkg update.

 

 

Then you have to install the packages that you need with the command opkg install , so in this case you have to run the following commands:

 

 

opkg install pciutils opkg install libnl

 

 

You can check the list of the packages installed with the command: opkg list |grep libnl and opkg list |grep pciutils to see that the packages are installed.

 

 

I hope this works for you guys.

 

 

Regards,

 

-Leonardo
sk23
New Contributor II
87 Views

Hi Leonardo ,

Step1 :

root@xxxx:~# opkg install libnl

Package libnl-3-200 (1:3.2.25-r0) installed in root is up to date.

Step2:

opkg list |grep libnl

libnl-3-200 - 1:3.2.25-r0 - A library for applications dealing with netlink sockets A library for

libnl-3-cli - 1:3.2.25-r0 - A library for applications dealing with netlink sockets A library for

libnl-3-dbg - 1:3.2.25-r0 - A library for applications dealing with netlink sockets - Debugging files

libnl-3-dev - 1:3.2.25-r0 - A library for applications dealing with netlink sockets - Development

libnl-3-doc - 1:3.2.25-r0 - A library for applications dealing with netlink sockets - Documentation

libnl-3-genl - 1:3.2.25-r0 - A library for applications dealing with netlink sockets A library for

libnl-3-staticdev - 1:3.2.25-r0 - A library for applications dealing with netlink sockets - Development

libnl-idiag-3-200 - 1:3.2.25-r0 - A library for applications dealing with netlink sockets A library for

libnl-nf-3-200 - 1:3.2.25-r0 - A library for applications dealing with netlink sockets A library for

libnl-route-3-200 - 1:3.2.25-r0 - A library for applications dealing with netlink sockets A library for

Step 3:

opkg install pciutils

Package pciutils (3.2.1-r0) installed in root is up to date.

Step4:

opkg install pciutils

Package pciutils (3.2.1-r0) installed in root is up to date.

Step5:

powertop-2.8/

root@xxxx:~/powertop-2.8# ./configure

checking for a BSD-compatible install... /usr/bin/install -c

checking whether build environment is sane... yes

checking for a thread-safe mkdir -p... /usr/bin/mkdir -p

checking for gawk... gawk

checking whether make sets $(MAKE)... yes

checking whether make supports nested variables... yes

checking for style of include used by make... GNU

checking for g++... g++

checking whether the C++ compiler works... yes

checking for C++ compiler default output file name... a.out

checking for suffix of executables...

checking whether we are cross compiling... no

checking for suffix of object files... o

checking whether we are using the GNU C++ compiler... yes

checking whether g++ accepts -g... yes

checking dependency style of g++... gcc3

checking how to run the C++ preprocessor... g++ -E

checking for grep that handles long lines and -e... /usr/bin/grep

checking for egrep... /usr/bin/grep -E

checking for ANSI C header files... yes

checking for sys/types.h... yes

checking for sys/stat.h... yes

checking for stdlib.h... yes

checking for string.h... yes

checking for memory.h... yes

checking for strings.h... yes

checking for inttypes.h... yes

checking for stdint.h... yes

checking for unistd.h... yes

checking minix/config.h usability... no

checking minix/config.h presence... no

checking for minix/config.h... no

checking whether it is safe to define __EXTENSIONS__... yes

checking whether make supports nested variables... (cached) yes

checking whether NLS is requested... yes

checking for msgfmt... /usr/bin/msgfmt

checking for gmsgfmt... /usr/bin/msgfmt

checking for xgettext... /usr/bin/xgettext

checking for msgmerge... /usr/bin/msgmerge

checking for gcc... gcc

checking whether we are using the GNU C compiler... yes

checking whether gcc accepts -g... yes

checking for gcc option to accept ISO C89... none needed

checking whether gcc understands -c and -o together... yes

checking dependency style of gcc... gcc3

checking build system type... i686-pc-linux-gnu

checking host system type... i686-pc-linux-gnu

checking for ld used by GCC... /usr/i586-poky-linux/bin/ld

checking if the linker (/usr/i586-poky-linux/bin/ld) is GNU ld... yes

checking for shared library run path origin... done

checking for CFPreferencesCopyAppValue... no

checking for CFLocaleCopyCurrent... no

checking for GNU gettext in libc... yes

checking whether to use NLS... yes

checking where the gettext function comes from... libc

checking for ar... ar

checking the archiver (ar) interface... ar

checking how to run the C preprocessor... gcc -E

checking whether we are using the GNU C++ compiler... (cached) yes

checking whether g++ accepts -g... (cached) yes

checking dependency style of g++... (cached) gcc3

checking how to print strings... printf

checking for a sed that does not truncate output... /usr/bin/sed

checking for fgrep... /usr/bin/grep -F

checking for ld used by gcc... /usr/i586-poky-linux/bin/ld

checking if the linker (/usr/i586-poky-linux/bin/ld) is GNU ld... yes

checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B

checking the name lister (/usr/bin/nm -B) interface... BSD nm

checking whether ln -s works... yes

checking the maximum length of command line arguments... 32768

checking whether the shell understands some XSI constructs... yes

checking whether the shell understands "+="... yes

checking how to convert i686-pc-linux-gnu file names to i686-pc-linux-gnu format... func_convert_file_noop

checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop

checking for /usr/i586-poky-linux/bin/ld option to reload object files... -r

checking for objdump... objdump

checking how to recognize dependent libraries... pass_all

checking for dlltool... no

checking how to associate runtime and link libraries... printf %s\n

checking for archiver @FILE support... @

checking for strip... strip

checking for ranlib... ranlib

checking command to parse /usr/bin/nm -B output from gcc object... ok

checking for sysroot... no

checking for mt... no

checking if : is a manifest tool... no

checking for dlfcn.h... yes

checking for objdir... .libs

checking if gcc supports -fno-rtti -fno-exceptions... no

checking for gcc option to produce PIC... -fPIC -DPIC

checking if gcc PIC flag -fPIC -DPIC works... yes

checking if gcc static flag -static works... no

checking if gcc supports -c -o file.o... yes

checking if gcc supports -c -o file.o... (cached) yes

checking whether the gcc linker (/usr/i586-poky-linux/bin/ld) supports shared libraries... yes

checking whether -lc should be explicitly linked in... no

checking dynamic linker characteristics... GNU/Linux ld.so

checking how to hardcode library paths into programs... immediate

checking whether stripping libraries is possible... yes

checking if libtool supports shared libraries... yes

checking whether to build shared libraries... yes

checking whether to build static libraries... yes

checking how to run the C++ preprocessor... g++ -E

checking for ld used by g++... /usr/i586...

idata
Community Manager
87 Views

Hi guys,

 

 

I found how to install the right packages of PCIUTILS and libnl. The commands to install the packages are the following:

opkg install pciutils-dev 

opkg install libnl-dev

And try the ./configure command in the Powertop directory, it should run without problems and the system should found the packages.

 

The next step is to run the make command, but it apparently shows the following error:

 

I think that you're going to get the same error, so I'm investigating to try to fix it, I'll let you know if I find something else. Could you please try to follow my suggestion above to see if your results are the same.

Regards,

 

-Leonardo
sk23
New Contributor II
87 Views

Hi Leonardo ,

I was also facing same error.

please do need full.

idata
Community Manager
87 Views

Hi IoT_srinivas,

 

 

Yes, just like I supossed. Right now I'm working on it.

I'll let you know when I find something else, thank you for your patience.

Regards,

 

-Leonardo
RKasu
New Contributor I
87 Views

Hi Everyone,

I have installed the packages of PCIUTILS and LIBNL and checked the packages by using the commands

opkg list | grep pciutils and opkg list | grep libnl ,I'm getting the version after ./configure from source code of powertop ,I'm facing the same issue of

Checking for PCIUTILS....No

Checking for LIBNL.........No

I'm not knowing why this issue is coming,Please do needful.Any help and Every help is appreciated.

Thanks and Regards,

Radhika

idata
Community Manager
87 Views

Hi Radhika.k,

 

 

The way to install the right packages of PCIUTILS and libnl is in the last reply of my part, please check it and let us know if you later have the other problem that we are currently investigating.

 

 

We appreciate your patience.

 

 

Regards,

 

-Leonardo
idata
Community Manager
88 Views

Hi guys,

 

 

We found the way to install PowerTOP in the Edison Board. The package is provided in the IOTDK repository ( http://iotdk.intel.com/repos/3.5/iotdk/edison/core2-32), so please try to follow the next steps:

 

 

1. Add on the /etc/opkg/iotkit.conf file the following repos:

 

src iotkit http://iotdk.intel.com/repos/3.5/intelgalactic/opkg/i586/  src iotdk-all http://iotdk.intel.com/repos/3.5/iotdk/edison/all  src iotdk-core2-32 http://iotdk.intel.com/repos/3.5/iotdk/edison/core2-32  src iotdk-edison http://iotdk.intel.com/repos/3.5/iotdk/edison/edison

 

 

2. Run opkg update command.

 

 

3. Install PowerTOP with the command: opkg install powertop.

 

 

4. If you still have problems with libnl and pciutils, force reinstall on those packages:

 

opkg install libnl --force-reinstall  opkg install pciutils --force-reinstall

 

 

I successfully installed PowerTOP with the steps that I gave you, so please try it and let me know if it works for you.

 

 

Thank you for remaining so positive.

 

 

Regards,

 

-Leonardo

View solution in original post

RKasu
New Contributor I
87 Views

Thank you very much Leonardo,Its working.

Regards,

Radhika

idata
Community Manager
87 Views

Hi Radhika,

 

 

That's awesome, it was a pleasure to help you.

 

 

Regards,

 

-Leonardo
RKasu
New Contributor I
87 Views

Hi Leonardo,

Thank very much for your help.I'm trying to get the power only from a specific process and I'm writing the commands in the script file like this

# !/bin/bash

powertop time=2 | grep moisture > powertop.txt

cat powertop.txt

and the other program

# !/bin/bash

powertop time=2 >powertop.txt

cat powertop.txt |grep moisture

But there is no output.I have tried using powertop --html = powertop but I'm unable to get the process .Individually I'm able to get wakeups if I'm creating the text file and not killing the process of powertop and in the other terminal I'm able to see the text file., but in script I'm unable to get the wakeups as it is not converting into a text file.Can you please help in creating the script file of a specific process using powertop.

Thanks and Regards,

Radhika.

idata
Community Manager
87 Views

Hi Radhika,

 

 

I have never used PowerTOP so I'm not sure how you can do it. I ran the powertop --help command and I didn't find any option to create the .txt file. As you can see in the help command, PowerTop allows you to export power monitoring results to csv or html format.

 

 

Personally, I would recommend you to try to contact PowerTOP and explain your issue, or you can try to run the script showing the results on csv format with the command powertop --time=2 --csv=test.csv, and later search the process in the file (I'm not sure if moisture is measured with PowerTOP).

 

 

I hope you find this information helpful.

 

 

Regards,

 

-Leonardo
RKasu
New Contributor I
87 Views

Thanks Leonardo,

Its helpful

Regards,

Radhika

idata
Community Manager
87 Views

Hi Radhika,

 

 

It's nice to see that this was helpful for you.

 

 

Have a nice day.

 

 

Regards,

 

-Leonardo
Reply