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.

So, when I installed, opkg also pulled down and installed all of the following. Are they all needed?

libpthread
librt
libusb-1.0
libusb-compat

The following are what I am installing in my image builder builds. It would be good to know which are needed and which are not. I'm assuming the above are definitely needed but there was no mention of 'already installed and up to date' for example on any of the following. Meaning, maybe I don't need those?

kmod-usb-core
kmod-usb2
kmod-ledtrig-usbdev
kmod-usb-ohci
kmod-usb-hid

So if I installed the right packages and now have a working build, I could copy usbtemp to my image builder builds and TEMPer would work?

I'd love to better understand why nothing seemed to work and yet it was actually compiling and it installed.

As an update, I've been playing with both the image builder and the buildroot and while I love the ease of image builder, I can see why/how buildroot will be better but the learning curve might be beyond me and the time I have available.

Using image builder, I added all of the packages needed but wasn't able to add the temper package because when the error comes up, it kills the build. What I've done (for now) is to copy the package into files/temp so that it's there once I fire up the device since I have no idea how to automatically make it part of the install.

In buildroot, I'm still trying to figure out why things don't work too good even though it seems I am adding the proper modules etc, then compiling.

By the way, if not mentioned in this thread. The reason the old TERMer wasn't being seen is that it is a USB 1.0 device and the tp-link I am using is a 2.0 device. I solved this by using a 2.0 hub between the tp-link and the usb device. Then the tp-link could see the device. I tested this on two different device types and it worked.

projects wrote:

So, when I installed, opkg also pulled down and installed all of the following. Are they all needed?

libpthread
librt
libusb-1.0
libusb-compat

You definetely need libusb-compat. I tried without and it didn't even compile.
libusb-compact selects libusb-1.0, which selects librt + libpthread.

-> Yes, they are all needed for temper to work.


projects wrote:

Meaning, maybe I don't need those?

kmod-usb-core
kmod-usb2
kmod-ledtrig-usbdev
kmod-usb-ohci
kmod-usb-hid

kmod-usb-core ->     Kernel support for USB. -> won't work without.
kmod-usb2 -> Kernel support for USB2 (EHCI) controllers -> unsure, if needed, since temper is an USB1 device, not an USB2 device. Try it without.
kmod-ledtrig-usbdev -> Kernel module to drive LEDs based on USB device presence/activity. -> certainly not needed in your case.
kmod-usb-ohci -> probably needed
kmod-usb-hid -> unsure if needed. Is temper actually a HID?


projects wrote:

So if I installed the right packages and now have a working build, I could copy usbtemp to my image builder builds and TEMPer would work?

Yep!

Run lsmod to see what modules are running.  Modules built integral to the kernel may not appear in the installed kmod-xxx list.

Installing ohci or uhci (depending on your hardware, but you never need both) may allow a direct connection of a USB1 device.

hello

i have a TemPer1.2 on OpenWrt 3.14.25 r43530 (tp-link 1043nd v1) and i have this issue :

root@OpenWrt:~# temper
Found device: 05e3:0608
Found device: 1d6b:0002
Found device: 0c45:7401
TemperCreate: Success

root@OpenWrt:~# usbtemp -f
TemperCreateFromDeviceNumber: Success


root@OpenWrt:~# dmesg |  grep -i usb
[    4.000000] usbcore: registered new interface driver usbfs
[    4.010000] usbcore: registered new interface driver hub
[    4.010000] usbcore: registered new device driver usb
[    4.020000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    4.040000] ehci-platform ehci-platform: new USB bus registered, assigned bus number 1
[    4.080000] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00
[    4.080000] hub 1-0:1.0: USB hub found
[    4.090000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    4.410000] usb 1-1: new high-speed USB device number 2 using ehci-platform
[    4.570000] hub 1-1:1.0: USB hub found
[    5.020000] usb 1-1.2: new low-speed USB device number 3 using ehci-platform
[   11.620000] input: RDing TEMPerV1.2 as /devices/platform/ehci-platform/usb1/1-1/1-1.2/1-1.2:1.0/0003:0C45:7401.0001/input/input0
[   11.640000] hid-generic 0003:0C45:7401.0001: input,hidraw0: USB HID v1.10 Keyboard [RDing TEMPerV1.2] on usb-ehci-platform-1.2/input0
[   11.660000] hid-generic 0003:0C45:7401.0002: hiddev0,hidraw1: USB HID v1.10 Device [RDing TEMPerV1.2] on usb-ehci-platform-1.2/input1
[   11.670000] usbcore: registered new interface driver usbhid
[   11.680000] usbhid: USB HID core driver
[   11.700000] usbcore: registered new interface driver usbserial
[   11.700000] usbcore: registered new interface driver usbserial_generic
[   11.710000] usbserial: USB Serial support registered for generic
[   11.910000] usbcore: registered new interface driver cp210x
[   11.910000] usbserial: USB Serial support registered for cp210x


i don't get any temperature. what am I doing wrong?

(Last edited by catap on 8 Dec 2014, 11:08)

You're using the wrong temper hardware with this version of the temper software.

Your hardware: 0C45:7401
Hardware required for this software: 1130:660c

Short overview of my findings:

- TEMPer1 Kavaler: http://relavak.wordpress.com/2009/10/17 … ux-driver/ (1130:660c)
- TEMPer1 Vojtek: https://github.com/petervojtek/usb-thermometer (0c45:7401) (Note: Identical to Chapman)
- TEMPer1 Chapman: https://github.com/petechap/usb-thermometer (0c45:7401) infosource (Note: Identical to Vojtek)
- TEMPer2 Leroux: https://github.com/s-leroux/TEMPer2 (0c45:7401; 0c45:7402)
- TEMPer2 sokkalf: https://github.com/sokkalf/TEMPer2 (modified Leroux)
- pcsensor-temper: https://github.com/padelt/pcsensor-temper (0c45:7401)
- pcsensor2: https://github.com/nonoo/pcsensor2 (0c45:7401)
- TEMPer for OpenWRT: https://dev.openwrt.org/ticket/10577 → see attachment (1130:660c)
- TEMPerHUM: https://github.com/olegstepura/temper-hum-hid (0x1130:0x660c)
- TEMPered: https://github.com/edorfaus/TEMPered (0c45:7401; 0c45:7402; 1130:660c)
- temper-python:  https://github.com/padelt/temper-python (see also https://pypi.python.org/pypi/temperusb/1.2.3) (0c45:7401)

thx


Any idea how to make him work on my OpenWRT ?

catap wrote:

thx


Any idea how to make him work on my OpenWRT ?

Sure.. just follow what I just went through and find the right source for your build.

Once the package is compiled, you can install it like any other package.

tmo26 wrote:

Once the package is compiled, you can install it like any other package.

Then the next question would be...

Once I have installed my new build onto the device, I only need to run the installer to install the temper package once right? So basically, I just need to run something like 'opkg /temp/temper' in a one time way.

mk24 wrote:

Run lsmod to see what modules are running.  Modules built integral to the kernel may not appear in the installed kmod-xxx list.

Installing ohci or uhci (depending on your hardware, but you never need both) may allow a direct connection of a USB1 device.

Is it a problem to have both? I don't mind using a hub, I have other things I'm wanting to connect and try out.

projects wrote:

>Look here: https://github.com/petervojtek/usb-thermometer
>usb-thermometer: TEMPer1 and TEMPer1F

Anyone know if the project supports the external gadget and/or what it is?

http://www.ebay.com/itm/PCsensor-USB-di … 4ae05de057

Although vojteks version supports TEMPer1F, it doesn't seem to support TEMPer1F_1H.
Looking at https://github.com/petervojtek/usb-ther … pcsensor.c you'll recognize, that there's only temperature mentioned, no humidity.

Do you need the *external* humidity sensor? If you can live without that: See TEMPerHUM -> http://pcsensor.com/index.php?_a=produc … uct_id=178
Corresponding software: https://github.com/olegstepura/temper-hum-hid

Yes, I didn't see that either.

I don't *need* humidity, I'm just trying to learn by coming up with needs smile
I am somewhat interested in weather however so I'd love to interface to something which would give all the typical temp/moisture/pressure readings etc.

However, the trick for me is to find things which are dirt cheap. Not having a *need* means being interested if I can keep all of my curiosities cheap.

Yeah, finally my TEMPer devices arrived!

Downside: They are 0c45:7401 -> doesn't work with the given TEMPer version.

Hmpf... now I have to get some other TEMPer version running that supports 0c45:7401, which is not as easy as the version for 1130:660c...

Cooool, got it working with my 0c45:7401 :-D

Sources: https://github.com/petervojtek/usb-thermometer.git

Place the sources and the Makefile in package/utils/temper7401.

OpenWRT Makefile (based on [1]):

include $(TOPDIR)/rules.mk
PKG_NAME:=temper7401
PKG_RELEASE:=1

PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk

define Package/temper7401
        SECTION:=utils
        CATEGORY:=Utilities
        TITLE:=Temper Usb Temper Hid reading tool
        DEPENDS:=+libusb-compat
endef

define Package/temper7401/description
 temper7401 is a tool for reading temperature from TEMPer USB temperature sensors.
 This version only works with devices with USB ID 0c45:7401 (TEMPerV1.4).
 Sources: https://github.com/petervojtek/usb-thermometer.git
endef

define Build/Prepare
        mkdir -p $(PKG_BUILD_DIR)
        $(CP) ./src/* $(PKG_BUILD_DIR)/
endef

define Package/temper7401/install
        $(INSTALL_DIR) $(1)/bin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/pcsensor $(1)/bin/
endef

$(eval $(call BuildPackage,temper7401))

Note: I named the package temper7401, in order to distinguish it from other temper-programs, which are capable of reading other sensors (e.g. 1130:660c)

root@DIR-505-2:~# pcsensor -l1
2015/01/14 21:34:31 Temperature 79.25F 26.25C
2015/01/14 21:34:32 Temperature 79.70F 26.50C
2015/01/14 21:34:33 Temperature 81.05F 27.25C
2015/01/14 21:34:34 Temperature 82.85F 28.25C
2015/01/14 21:34:35 Temperature 84.20F 29.00C
2015/01/14 21:34:36 Temperature 84.88F 29.38C
2015/01/14 21:34:37 Temperature 85.55F 29.75C
2015/01/14 21:34:38 Temperature 86.00F 30.00C
2015/01/14 21:34:39 Temperature 86.45F 30.25C
2015/01/14 21:34:40 Temperature 86.90F 30.50C
2015/01/14 21:34:41 Temperature 88.03F 31.13C

root@DIR-505-2:~# pcsensor -vcl1
lvr_winusb with Vendor Id: c45 and Product Id: 7401 found.
iProduct: TEMPerV1.4
Detach failed: No such file or directory[2]
Continuing anyway
Detach failed: No such file or directory[2]
Continuing anyway
01 01 00 00 00 00 00 01
01 80 33 01 00 00 00 00
80 02 1a a0 65 72 46 31
01 82 77 01 00 00 00 00
82 01 00 a0 65 72 46 31
01 86 ff 01 00 00 00 00
54 45 4d 50 65 72 46 31
2e 34 4d 50 65 72 46 31
01 80 33 01 00 00 00 00
80 02 1a a0 65 72 46 31
2015/01/14 21:44:40 Temperature 26.63C
01 80 33 01 00 00 00 00
80 02 1a a0 65 72 46 31
2015/01/14 21:44:41 Temperature 26.63C
01 80 33 01 00 00 00 00
80 02 1a a0 65 72 46 31
2015/01/14 21:44:42 Temperature 26.63C
01 80 33 01 00 00 00 00
80 02 1a a0 65 72 46 31
2015/01/14 21:44:43 Temperature 26.63C

[1] https://dev.openwrt.org/raw-attachment/ … temper.zip

(Last edited by tmo26 on 14 Jan 2015, 21:44)

I was thinking of picking up another one but I got sidetracked. I would like to find one that has more sensors, like temp, moisture, maybe barometric pressure, etc.

I doubt that you will find a cheap multi-sensor device. Humidity and pressure sensors can be quite costly... You see, already the TEMPerHUM costs a multiple of the TEMPer.

Not so small, not directly USB, but somewhat cheap available on ebay: Lacrosse WS2300.
Temp, Humidity, Pressure for roundabout 25,- Euro. Works with open2300, which is available in OpenWRT. Needs USB-> RS232 Adapter (FTDI or PL2303). Good value for money.

If you find a small multisensor USB device: Please let me know, I'm always interested in this topic!

When I looked back when we started this thread, the best I could find was around $60/$100 if I recall so yes, it would not be cost effective for playing around with but maybe for some other purpose.

My second TEMPer device arrived today: It's a TEMPERHUM1V1.2 (0c45:7402).
I managed to compile https://github.com/joeyloman/atmoslog, but the values I get back seem to be incorrect (e.g. I don't have 100% humidity here smile

Still some work to do, but almost halfway there!

tmo26 wrote:

For my datacollection, which hardware works with which software: Can you please post the output of the following commands?

lsusb
lsusb -v -d 1130: | head -n 20

Sorry, didn't get any notification. Are you wanting me to do the above?

Yes please!

hmmm...

root@OpenWrt:~# lsusb
-ash: lsusb: not found
root@OpenWrt:~# lsusb -v -d 1130: | head -n 20
-ash: lsusb: not found

I'm sure this is the build you sent me because I never install any service other than ssh.

(Last edited by projects on 31 Jan 2015, 17:38)

Sorry, posts 76 to 75 are missing from our archive.