OpenWrt Forum Archive

Topic: 'TEMPer' USB thermometer with openwrt

The content of this topic has been archived between 17 Apr 2018 and 1 May 2018. Unfortunately there are posts – most likely complete pages – missing.

Anyone ever use this or a similar device to nab the external temperature?
Is the USB port alive by default for example? I'm building my own using Image Builder.

I usually test on TL-WR703N devices but haven't been able to find enough info on how to do this.

Thanks for any leads you can offer.

Havn't tested this device, but other methods for reading temperature / other environmental measurements:

- 1 wire: DS18B20 or OW-ENV-THPL + DS9490R USB-to-1wire adapter + owfs
- WS2300 weatherstation + open2300

Notes:
- owfs has some flaws, but is working pretty well with the right countermeasures. Quite fast, compared to open2300.
- open2300: painfully slow. Reading the full content of the weatherstation takes somewhere between 3,5...5minutes. There are faster ways, but they are also more error prone.

To answer your question: Yes, USB port is alive by default.

Regarding TEMPer: Nice small device.
Found some info in the comments of a similar device (http://www.amazon.de/USB-Sensor-Thermog … B009RETJIO) -> Someone uses it under debian with the following drivers Google: "github petervojtek usb-thermometer")

If you manage to get this thing going with openwrt, please let us know!

Sure, I would be happy to post my findings once I know more.
It just happens I have some of these TEMPer devices which is why I wanted to use one.
I don't need full weather station input, just the devices external temperature would be fun to know.

Interesting that the USB device is live. When I connect the TEMPer, it's light doesn't come on and nothing new shows up in /dev or dmesg.

Oh, you already have some of them! That changes the game smile

Look here: https://github.com/petervojtek/usb-thermometer

usb-thermometer: TEMPer1 and TEMPer1F

How to run it

    clone this repository
    $ sudo apt-get install libusb-dev
    $ make
    connect the thermometer
    $ sudo ./pcsensor

The output looks like:

2014/10/30 07:00:36 Temperature 73.96F 23.31C

Seems that's what you're  looking for, right?

tmo26 wrote:

Oh, you already have some of them! That changes the game smile

Look here: https://github.com/petervojtek/usb-thermometer

usb-thermometer: TEMPer1 and TEMPer1F

How to run it

    clone this repository
    $ sudo apt-get install libusb-dev
    $ make
    connect the thermometer
    $ sudo ./pcsensor

The output looks like:

2014/10/30 07:00:36 Temperature 73.96F 23.31C

Seems that's what you're  looking for, right?

Unbelievable. I searched for two hours trying to find something but no luck what so ever. Yes, that's what I am looking for. I thought it would be interesting to see how this works.

So now, my question would be... I'm using image builder so do I copy the source files onto a debian box then make the files, then put the resulting file into my build?

I tried that but make is giving me;
Makefile:5: *** missing separator.  Stop.

Ooops, all the files came down as html when I used wget. Maybe that's why smile

projects wrote:

Unbelievable. I searched for two hours trying to find something but no luck what so ever.

Pure luck of mine. Who would have thought to find that really helpful hint to github in an amazon product comment?-)
I would have expected that everywhere but there.

So now, my question would be... I'm using image builder so do I copy the source files onto a debian box then make the files, then put the resulting file into my build?

Uhm, that's where I quit. Compiling from source is a class I havn't taken yet, but I'd guess that it's not that simple...

I got the files onto a debian server, made sure they contain the right data and hit 'make'

Makefile:8: *** missing separator (did you mean TAB instead of 8 spaces?).  Stop.

Doh!!!!

I too am not that well versed in compiling stuff.

FYI;

‘missing separator (did you mean TAB instead of 8 spaces?). Stop.’

This means that make could not understand much of anything about the makefile line it just read. GNU make looks for various separators (:, =, recipe prefix characters, etc.) to indicate what kind of line it’s parsing. This message means it couldn’t find a valid one.

One of the most common reasons for this message is that you (or perhaps your oh-so-helpful editor, as is the case with many MS-Windows editors) have attempted to indent your recipe lines with spaces instead of a tab character. In this case, make will use the second form of the error above. Remember that every line in the recipe must begin with a tab character (unless you set .RECIPEPREFIX; see Special Variables). Eight spaces do not count. See Rule Syntax.

Some warning regarding tabs vs. spaces found on the net:

"A last word of warning on this matter: copy-pasting from this blogpost will almost certainly mess things up (convert tabs to spaces, etc), so please double check the source after copying it."

Yes, I checked and it looks ok but I'll have to look closer.

Everything I am doing is based on Image Builder. I'm not sure I can play with this if it means having to install yet another build method.

AFAIK the ImageBuilder just assembles precompiled packages to a single firmware file.

Compiling the TEMPer software is nothing like that, it's compiling from source, i.e. compiling via OpenWRT SDK, not with the imagebuilder.

Somebody already compiled TEMPer for OpenWRT:
https://dev.openwrt.org/ticket/10577

It is based on "Temper.c by Robert Kavaler (c) 2009 (relavak.com)"

zip file in the attachment contains the sources and an OpenWRT Makefile.
Looks like a very good starting point!

tmo26 wrote:

Somebody already compiled TEMPer for OpenWRT:
https://dev.openwrt.org/ticket/10577

It is based on "Temper.c by Robert Kavaler (c) 2009 (relavak.com)"

zip file in the attachment contains the sources and an OpenWRT Makefile.
Looks like a very good starting point!

Tried this just now. Seemed to compile ok, no errors.

The resulting binaries;
-rwxr-xr-x    1 root     root         12778 Dec  1 21:18 temper
-rwxr-xr-x    1 root     root         14613 Dec  1 21:18 usbtemp

# ./usbtemp -h
./usbtemp: line 1: syntax error: unexpected "("

# ./temper -h
./temper: line 1: syntax error: unexpected "("

Guess I am missing something smile

One more piece of software for TEMPer: pcsensor2: https://github.com/nonoo/pcsensor2

I should stop searching, this is getting confusingly many versions %-)

How are you finding all these? I typically find a lead, use that lead, etc. Seems like you might be looking for 'usb pcsensor temperature' now? I was looking with openwrt in the keywords to find info specific to openwrt.

(Last edited by projects on 1 Dec 2014, 22:45)

Errm... to be honest: I don't know anymore in detail smile
Just googling around, following some links, picking up new keywords, further googling...
Takes some time as you can see, but today I have time and the topic is interesting smile

BTW: If you want temperature + humidity: TEMPerHUM

https://github.com/olegstepura/temper-hum-hid

(Last edited by tmo26 on 1 Dec 2014, 22:57)

projects wrote:

It just happens I have some of these TEMPer devices which is why I wanted to use one.

Could you post a picture of your TEMPer? There seem to be dozens of versions out there in the wild...

tmo26 wrote:

Errm... to be honest: I don't know anymore in detail smile
Just googling around, following some links, picking up new keywords, further googling...
Takes some time as you can see, but today I have time and the topic is interesting smile

BTW: If you want temperature + humidity: TEMPerHUM

https://github.com/olegstepura/temper-hum-hid

That's pretty cool too. I would not mind ordering another type but I'm hoping someone who knows how to compile and include these things into my builds will respond.

Problem after problem. I notice that when I connect the TEMPer, it's lights don't go on. I then tried a couple of USB sticks and nothing again. Seems my USB port is not even alive on this device.

Solution w/o compiling from source: https://github.com/padelt/temper-python

BUT:
- restricted to TEMPer devices with USB VID/PID 0C45:7401
- needs Python (python alone about 1,9MB)

BTW: Just ordered 2 TEMPer + 1 TEMPerHUM on aliexpress. Hopefully they arrive for x-mas smile

Guess that won't work for me since I don't have python installed and don't have the space for it.
Unless of course, you mean only to build to a binary on a regular machine, then copy the binaries over to the tp-link?

Does the newer TEMPer require phyton as well?

The units I have don't report model numbers and only say 'PCsensor Temper'

(Last edited by projects on 2 Dec 2014, 13:51)

No, temper-python is used instead of the compile-from-source solution. temper-python will not result in binaries as with compile-from-source.

temper-python is no requirement of any TEMPer devices, but only another way to get the temperature readings from it (instead of getting them via compiled binaries).

Indeed, this solution can only work for you if you either already have python installed or you have the space available to install python, which obviously isn't the case with a 703.