Git Product home page Git Product logo

temper's People

Contributors

andrerenaud avatar bartnv avatar c72578 avatar corsac-s avatar dr1fter avatar e-minguez avatar eode avatar gardener2 avatar jaesivsm avatar jirka-h avatar johnjamesmiller avatar mjarmstr avatar mrj avatar nemslinux avatar neofob avatar nigels-com avatar owenbrakeparallelsystems avatar urwen avatar wiryonolau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

temper's Issues

Select device by other mean

Hey,
i just received a TEMPer2 and a TEMPerGold device, and both are identified by the same USB ids: 1a86:e025 which means it's not really useful to select a device using its id. Maybe it'd make sense to select by name or something like that?

unidentifiable version of TEMPer

temper.py -l
Bus 001 Dev 009 1130:660c   PCsensor Temper ['hidraw1', 'hidraw2']

When running ./temper.py receive the following traceback:

root@john-desktop:/home/john/temper/pcsensor-temper# python3 /usr/local/lib/python3.9/dist-packages/temper.py --force 1130:660c --verbose
Firmware query: b'0186ff0100000000'
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/temper.py", line 436, in <module>
    main()
  File "/usr/local/lib/python3.9/dist-packages/temper.py", line 433, in main
    sys.exit(temper.main())
  File "/usr/local/lib/python3.9/dist-packages/temper.py", line 426, in main
    results = self.read(args.verbose)
  File "/usr/local/lib/python3.9/dist-packages/temper.py", line 343, in read
    results.append({ **info, **usbread.read() })
  File "/usr/local/lib/python3.9/dist-packages/temper.py", line 270, in read
    return self._read_hidraw(self.device)
  File "/usr/local/lib/python3.9/dist-packages/temper.py", line 178, in _read_hidraw
    firmware = self._read_hidraw_firmware(fd, self.verbose)
  File "/usr/local/lib/python3.9/dist-packages/temper.py", line 158, in _read_hidraw_firmware
    raise RuntimeError('Cannot read device firmware identifier')
RuntimeError: Cannot read device firmware identifier

TEMPer2_V4.1 support?

Hi everyone, thanks for the work for adding support for Linux for the PC sensors.

My PC sensor, I just bough, has a humidity and temperature sensor with a black serial cable that connects to the sticks. I also has a red button with TXT written on it as well temperature range.

Running ./temper.py -l I get

Bus 001 Dev 001 1d6b:0002   xHCI Host Controller ['hidraw1', 'hidraw2', 'hidraw3', 'hidraw4', 'hidraw5']
Bus 001 Dev 004 04ca:3016    
Bus 001 Dev 005 1bcf:2ca0   HD WebCam 
Bus 001 Dev 011 093a:2510   USB Optical Mouse ['hidraw1']
Bus 001 Dev 024 03f0:034a   HP Elite USB Keyboard ['hidraw2', 'hidraw3']
Bus 001 Dev 027 3553:a001   TEMPer2 ['hidraw4', 'hidraw5']
Bus 002 Dev 001 1d6b:0003   xHCI Host Controller 

But ./temper.py doesn give any ouput.
I tried sudo ./temper.py --force 3553:a001 and I got:

Bus 001 Dev 027 3553:a001 TEMPer2_V4.1 Error: Unknown firmware TEMPer2_V4.1: b'80800bf64e200000'

Can anyone give me a hint in how to add support to this new version. Then I will gladly make a PR for that.

Thanks a lot

Firmware compatibility issue [Jetson J3010 & PCSensor TEMPER1F V4.1]

I have installed and used the Pypi package 'temper_py' in the Jetson J3010 device, to read the sensor (PCSensor: TEMPER1F V4.1) values.
This sensor is connected through USB HUB. When running the program, it raised a firmware compatibility issue, Please instruct us to avoid this.
Here I attached screenshots for your reference.
J3010_TEMPER1F_V4 1

Can't get the Temper2 (3353:a001) to work

Hello,
I am trying to use this script with new Temper2 usb key (https://thepihut.com/products/temper2-usb-dual-temperature-sensor)

After runing setup when I try to run

:/tmp/temper# python temper.py --verbose --json
[]

I am using raspberry pi and usb is detected as bellow.

:/tmp/temper# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 3553:a001 PCsensor TEMPer2
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

:/tmp/temper# python temper.py -l
Bus 001 Dev 001 1d6b:0002 xHCI Host Controller
Bus 001 Dev 002 2109:3431 USB2.0 Hub
Bus 001 Dev 003 3553:a001 TEMPer2
Bus 002 Dev 001 1d6b:0003 xHCI Host Controller

I also tried to add

if vendorid == 0x3553 and productid == 0xa001:
return True

to temper.py and then it returns

:/tmp/temper# python temper.py --verbose --json
[
{
"vendorid": 13651,
"productid": 40961,
"manufacturer": "PCsensor",
"product": "TEMPer2",
"busnum": 1,
"devnum": 3,
"devices": [],
"port": "1-1.1",
"error": "no hid/tty devices available"
}
]

what am I doing wrong?

"stuck" temperature reading

Hi, I noticed I sometime get the same temperature reading for multiple hours using TEMPER2 external sensor:

pcsensordual_TEMPer2-day

I'm unsure if it's something in the firmware or in the way it's queried with Python. It looks a bit like that โ€œoldโ€ issue in a different project: padelt/temper-python#61

Not sure there's anything which can be done at the software level but in case some other people experience that and/or have a workaround, I'd be interested.

Unknown firmware TEMPerGold_V3.4

Hi, it seems I have a slightly different model, mis-matched USB ID too?... I'm afraid I'm not too familiar with python, but I'm very happy to try to help... I see there was a guy with TEMPerGold_V3.3 who got it working, but no PR as yet... I guess they are probably related versions? Physically, it is the metal device with the thermometer printed on it.

root@trinity:/home/james# python3 temper.py --json
[
{
"vendorid": 6790,
"productid": 57381,
"manufacturer": "PCsensor",
"product": "TEMPerGold",
"busnum": 1,
"devnum": 12,
"devices": [
"hidraw6",
"hidraw7"
],
"port": "1-5.1",
"firmware": "TEMPerGold_V3.4",
"hex_firmware": "54454d506572476f6c645f56332e3420",
"hex_data": "80800c674e200000",
"error": "Unknown firmware TEMPerGold_V3.4: b'80800c674e200000'"
}
]

Bus 001 Dev 012 1a86:e025 * TEMPerGold ['hidraw6', 'hidraw7']

Any calibration / offset support

I bought two TEMPerX232 (V2.5) USB devices and they appear to work fine, but their temp difference is often off by 1.5 degrees between each other:

$ sudo ./temper.py
Bus 002 Dev 014 1a86:5523 TEMPerX232_V2.5 25.10C 77.18F 37% - - -
Bus 002 Dev 015 1a86:5523 TEMPerX232_V2.5 26.29C 79.32F 37% - - -

Is there a way to define an offset for one or both the cards so the readings are closer to reality?

Only root can run it?

Sorry for a total newbee question but why do I need SU rights to run this script? Without SUDO i get an permission denied error

[Testers Needed] Using non blocking I/O

I have been looking at the code and noticed that its was using select is an odd way.
The oddity is that the fd is not set O_NONBLOCK.

The end result of using O_NONBLOCK is that the code will report the temperatures as soon the sensor reports them.
Takes 0.386s vs the old code taking 0.558s. Tested with a TEMPer2.

If you are interest in my refactors let me know and I will raise a PR.

My refactor is in barry-scott@772d8c0.

Testers Needed

  • TEMPer 0c45:7401 TEMPerF1.4 I Metal
  • TEMPer 413d:2107 TEMPerGold_V3.1 I Metal
  • TEMPerHUM 413d:2107 TEMPerX_V3.1 I I White plastic
  • TEMPer2 413d:2107 TEMPerX_V3.3 I,E White plastic
  • TEMPer2 1a86:e025 TEMPer2_V3.7 I,E White plastic with red button
  • TEMPer1F 413d:2107 TEMPerX_V3.3 E White plastic
  • TEMPerX232 1a86:5523 TEMPerX232_V2.0 I,E I White plastic
  • TEMPer1V1.1 0c45:7401 TEMPer1F1.1Per1F E Metal

Tests Passing

  • TEMPer 0c45:7401 TEMPerF1.4 I Metal
  • TEMPer 413d:2107 TEMPerGold_V3.1 I Metal
  • TEMPerHUM 413d:2107 TEMPerX_V3.1 I I White plastic
  • TEMPer2 413d:2107 TEMPerX_V3.3 I,E White plastic
  • TEMPer2 1a86:e025 TEMPer2_V3.7 I,E White plastic with red button
  • TEMPer1F 413d:2107 TEMPerX_V3.3 E White plastic
  • TEMPerX232 1a86:5523 TEMPerX232_V2.0 I,E I White plastic
  • TEMPer1V1.1 0c45:7401 TEMPer1F1.1Per1F E Metal

Broken pipe

Hello,
on raspberry PI, the response I have is:
sudo python ./temper.py
Traceback (most recent call last):
File "/home/admin/scripts/./temper.py", line 472, in
main()
File "/home/admin/scripts/./temper.py", line 469, in main
sys.exit(temper.main())
^^^^^^^^^^^^^
File "/home/admin/scripts/./temper.py", line 462, in main
results = self.read(args.verbose)
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/admin/scripts/./temper.py", line 379, in read
results.append({ **info, **usbread.read() })
^^^^^^^^^^^^^^
File "/home/admin/scripts/./temper.py", line 304, in read
return self._read_hidraw(self.device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/admin/scripts/./temper.py", line 181, in _read_hidraw
firmware = self._read_hidraw_firmware(fd, self.verbose)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/admin/scripts/./temper.py", line 149, in _read_hidraw_firmware
os.write(fd, query)
BrokenPipeError: [Errno 32] Broken pipe

and the response if requesting a --list is
sudo python ./temper.py --list
Bus 001 Dev 001 1d6b:0002 xHCI Host Controller ['hidraw0']
Bus 001 Dev 002 2109:3431 USB2.0 Hub ['hidraw0']
Bus 001 Dev 003 1a86:e025 * TEMPerX232 ['hidraw0']
Bus 002 Dev 001 1d6b:0003 xHCI Host Controller
Bus 002 Dev 012 1058:107c Elements 107C

not sure why. Thanks for your kind support

Support for TEMPer2_V3.9

Hi,

To make this device work, I modified:

if info['firmware'][:12] in [ 'TEMPerX_V3.1', 'TEMPerX_V3.3', 'TEMPer2_V3.9' ]:

to include the V3.9 version, and:

if vendorid == 0x1a86 and productid == 0xe025:
return True

to recognise the corresponding USB id (1a86:e025).

This trick works for temperature, but not for humidity:

Bus 001 Dev 031 1a86:e025 TEMPer2_V3.9 28.93C 84.07F - - - -

is it possible to add full compatibility for this device? can I help in any way?

Thanks in advance

TEMPer2_V4.1 Error: Unknown firmware TEMPer2_V4.1: b'808009e94e200000800109084e200000'

Hello,
thanks for your Open Source software.

it lists nicely

/temper.py -l
Bus 001 Dev 003 3553:a001 TEMPer2 ['hidraw1', 'hidraw2']

./temper.py --json
[]

but then

/temper.py --force 3553:a001
Bus 001 Dev 003 3553:a001 TEMPer2_V4.1 Error: Unknown firmware TEMPer2_V4.1: b'808009e94e200000800109084e200000'

PS: WHY IS IT SO HARD TO GET GNU LINUX TALK TO A THERMOMETER?
(it would probably easier to build an https://duckduckgo.com/?t=ffab&q=arduino+weather+station)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.