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

 
online dating profile 2014-06-08 10:56:22

Or, are you trying to convince him that he should give more or want more from your relationship.
As nice as it is to trust an interesting prospect, you must always be on your guard till you have a
fair idea of who you are dealing with. Mature women don’t want to waste their time or his by playing
games.

 
http://www.guidegdansk.pl/ 2014-06-14 15:54:35

Bulks in the advertisers are primarily private homeowners, letting managers
and property agents. The truth is, people join MLM opportunities because of who introduced them.

A well-developed business plan is a lot like your blueprint for victory.

my website: http://www.guidegdansk.pl/

 
overton roofing company 2014-07-20 15:01:32

In the recent years, the Internet has also
emerged as a dependable source of information for this kind of business.
You must undertake regular inspection of your
roof as you do with the rest of you house. You deserve to have your home looking its
best, so you will want to have your roof, gutter and
deck cleaned by professionals, who do the work to the highest
standards, only use environmentally sound treatment, and provide the best warranty and
lowest prices in the business.

 
evenement fotografie 2014-09-01 18:48:17

Professional photographers have professional equipment.
Now here’s a handy tip to figure out who to recruit.
Here are the three reasons that you should not
sell on Amazon:.

 
www.homeimprovementdaily.com 2014-09-23 06:02:54

May I just say what a comfort to find an individual
who genuinely understands what they are talking
about on the web. You actually realize how to bring a problem
to light and make it important. More and more
people really need to check this out and understand this side of
the story. I can’t believe you are not more popular because you definitely possess the gift.

 
Trackback by summer exchange program 2014-10-11 09:39:22

summer exchange program

Measuring temperature using OpenWRT at dreamport | nonoo.hu

 
download ipa to apk converter 2015-03-12 20:11:14

whoah this weblog is wonderful i like reading your posts.
Stay up the good work! You know, a lot of people are looking around
for this information, you could aid them greatly.

 
Adultfriendlier 2017-04-11 14:01:39

Link exchange is nothing else however it is simply placing the other person’s
weblog link on your page at suitable place and other person will also do similar in support of you.

 
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=""> <s> <strike> <strong> in your comment.

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