Measuring temperature using OpenWRT

See my x86 solution for measuring temperature here!

I’m using USB Temper devices again, but this time they are a newer revision, so the previous app with the source code I modified doesn’t work anymore. I downloaded this source code from here (look at the comments) and modified that so I can define from which USB bus and dev I want the temperature readings from. I had to cross compile this for the router (TP-Link MR3220) running OpenWRT. You can download my modified pcsensor source from here. UPDATE (2013/10/13): here’s an updated, cleaner code with a rewritten webpage.

First I needed the OpenWRT toolchain, which you can get by compiling the OpenWRT buildroot. Here’s a good tutorial how you can compile buildroot. There are also some notes in the OpenWRT wiki about cross compilation.

For the pcsensor app to work, I needed libusb 0.1. I downloaded the source code of v0.1.12, extracted it and created a script called doconfig in the libusb source code directory:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
TOOLCHAIN_PATH=/home/nonoo/Work/openwrt/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.5-linaro_uClibc-0.9.32
export CC=$TOOLCHAIN_PATH/bin/mips-openwrt-linux-gcc
export LD=$TOOLCHAIN_PATH/bin/mips-openwrt-linux-ld
export NM=$TOOLCHAIN_PATH/bin/mips-openwrt-linux-nm
export CXX=$TOOLCHAIN_PATH/bin/mips-openwrt-linux-c++
export AR=$TOOLCHAIN_PATH/bin/mips-openwrt-linux-ar
export OBJDUMP=$TOOLCHAIN_PATH/bin/mips-openwrt-linux-objdump
export RANLIB=$TOOLCHAIN_PATH/bin/mips-openwrt-linux-ranlib
export STRINGS=$TOOLCHAIN_PATH/bin/mips-openwrt-linux-strings
export STRIP=$TOOLCHAIN_PATH/bin/mips-openwrt-linux-strip
export AS=$TOOLCHAIN_PATH/bin/mips-openwrt-linux-as
export CFLAGS=-I$TOOLCHAIN_PATH/include
export LDFLAGS=-L$TOOLCHAIN_PATH/lib
export STAGING_DIR=$TOOLCHAIN_PATH
./configure --host mips-openwrt-linux --prefix=/home/nonoo/Work/openwrt/opt

After running it, I created a domake file also:

1
2
3
4
#!/bin/bash
TOOLCHAIN_PATH=/home/nonoo/Work/openwrt/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.5-linaro_uClibc-0.9.32
export STAGING_DIR=$TOOLCHAIN_PATH
make $*

I ran domake; domake install and then I got the libusb libs under /home/nonoo/Work/openwrt/opt/lib. The STAGING_DIR variable you see above is needed for the toolchain compiler. I already added these cross compiling stuff to pcsensor’s Makefile. If you want to compile it on x86, just use my older Temper app’s Makefile.

libusb is needed on the router as well, so install it with opkg install -d pendrive libusb and run ldconfig.

Dp 2012-07-13 13:23:52

Szia !
Nagyon érdekel a megoldásod,én is opwnwrt alá szeretném beüzemelni majd USB hubon keresztül.
Van esetleg javaslatod melyik USb-Temper devicet érdemes rendelnenm a driveredhez (pcsensor-1.0.0-multi-nonoo.tar.bz2) Úgy látom elég nagy a szórás a firmware verziókban a hozzászólások alapján.
Köszönöm a segítségedet előre is !
Üdvözlettel:
D. Péter

Nonoo 2012-07-13 16:37:40

Szerintem az eddig megjelent összes Temper eszközhöz van már driver, nekem két fajta van, de mindegyiket sikerült beüzemelnem. Neten találsz drivert.

 
 
TomTomNavigator 2013-07-02 21:48:33

I managed to install the Buildroot and compiled libusb.
But what do I have to modify in the Makefile for pcsensor? Can you give some support?

 
Pingback by Blog J.Schweiss | Measuring Temperature 2013-12-11 12:43:21

[…] Using OpenWRT (Dragino or Arduino YUN) Source […]

 
Dong 2013-12-31 03:56:56

Hellpful info. Fortunate me I found your web site unintentionally, and
I’m stunned why this coincidence didn’t took place earlier!
I bookmarked it.

 
tarot card reading free 2014-02-24 12:17:45

Tarot is not used to make a decision your big lifestyle decisions
and answer your simple ‘yes/no’ questions as numerous of you may
feel, Tarot ought to be employed as a information to help you make the selection yourself This is why the
question being questioned in a tarot reading is of considerably importance.

There are actually two various varieties of Tarot readings:

Open Readings and Concern Readings

Open Readings:

Open up reading through just implies the tarot studying will tackle more
substantial aspects of your daily life, not for smaller sized troubles or to reply certain inquiries.
This is usually performed when coming into a new chapter of your existence, this sort of as: Starting up a new family members, Acquiring
married or graduating from college. Open up readings can be directed
for a particular topic, e.g. Overall health or Associations and
many others.. To help the reading go in that direction and give you a common notion of
what is going on at that stage in your lifestyle and to manual you to make the correct selections.

Concern Readngs

Questions readings are virtually the precise opposite of
open readings. Concern readings tackle a particular problem
or facet in your life. As described above, it is not intended to answer your query with a ‘Yes’ or a ‘No’ , but
to information you in a path to make the decision
for oneself. This provides back again the idea of how crucial the question
getting questioned is.

The best way to outline how a tarot reading works, is to knowledge
it for your self. We are right here to educate and give people with a new information.

Experience your cost-free tarot looking through by clicking right here:
http://afreetarotreading.blogspot.com

 
Name (required)
E-mail (required - never shown publicly)
Webpage URL
Comment:
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.

Click for dp.nonoo.hu »

About me

Nonoo
I'm Nonoo. This is my blog about music, sounds, filmmaking, amateur radio, computers, programming, electronics and other things I'm obsessed with. ... »

Twitter

Listening now

My favorite artists

Facebook