ccwienk / temper

Simple python for accessing TEMPer USB thermometers
MIT License
35 stars 27 forks source link

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

Open UltimateSolar opened 8 months ago

UltimateSolar commented 8 months ago

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)

nigels-com commented 8 months ago

Possible duplicate of PR #24

UltimateSolar commented 8 months ago

Hello,

thanks for looking into it.

now got a different error.

hostnamectl; # tested on Operating System: Ubuntu 22.04.3 LTS Kernel: Linux 5.15.0-91-generic Architecture: x86-64 Hardware Vendor: QEMU (as kvm vm :D with usb forwarding :D)

su - root apt install python3-serial git clone https://github.com/greg-kodama/temper.git

./temper.py -l|grep TEMP Bus 001 Dev 012 3553:a001 TEMPer2

./temper.py --force 3553:a001 --json [ { "vendorid": 13651, "productid": 40961, "manufacturer": "PCsensor", "product": "TEMPer2", "busnum": 1, "devnum": 3, "devices": [ "hidraw1", "hidraw2" ], "port": "1-3", "firmware": "TEMPer2_V4.1\u0000\u0000\u0000\u0000", "hex_firmware": "54454d506572325f56342e3100000000", "hex_data": "808008534e200000800106974e200000", "error": "Unknown firmware TEMPer2_V4.1\u0000\u0000\u0000\u0000: b'808008534e200000800106974e200000'" } ]

hostnamectl; # also tested with Operating System: Debian GNU/Linux 12 (bookworm) Kernel: Linux 6.1.0-17-amd64 Architecture: x86-64

./temper.py --force 3553:a001 --json [ { "vendorid": 13651, "productid": 40961, "manufacturer": "PCsensor", "product": "TEMPer2", "busnum": 1, "devnum": 12, "devices": [], "port": "1-6.4", "error": "no hid/tty devices available" } ]

UltimateSolar commented 8 months ago

is this firmware check required for the values to be read?

ok now also getting the same error with Debian


./temper.py --force 3553:a001 --json
[
    {
        "vendorid": 13651,
        "productid": 40961,
        "manufacturer": "PCsensor",
        "product": "TEMPer2",
        "busnum": 1,
        "devnum": 12,
        "devices": [
            "hidraw3",
            "hidraw4"
        ],
        "port": "1-6.4",
        "firmware": "TEMPer2_V4.1\u0000\u0000\u0000\u0000",
        "hex_firmware": "54454d506572325f56342e3100000000",
        "hex_data": "808008534e200000800106974e200000",
        "error": "Unknown firmware TEMPer2_V4.1\u0000\u0000\u0000\u0000: b'808008534e200000800106974e200000'"
    }
]
UltimateSolar commented 8 months ago

how to interpret this data? :D hex_data str: 8080086c4e200000800106974e200000 (https://pcsensor.cn/ SHOULD PAY YOU FOR THIS! OR AT LEAST SHIP 100x TEMPer2)

did not fix anything:


apt-get install python3-hid
apt-get install python3-usb
biochem-fan commented 8 months ago

You have to use the TEMPer2_V4.1 branch:

git clone https://github.com/greg-kodama/temper.git
git checkout TEMPer2_V4.1
UltimateSolar commented 8 months ago

THANKS IT WORKS! :) :+1: THANKS!

git clone https://github.com/greg-kodama/temper.git
cd temper/
git checkout TEMPer2_V4.1
git pull; # not required?
./temper.py --force 3553:a001 --json

[
    {
        "vendorid": 13651,
        "productid": 40961,
        "manufacturer": "PCsensor",
        "product": "TEMPer2",
        "busnum": 1,
        "devnum": 6,
        "devices": [
            "hidraw3",
            "hidraw4"
        ],
        "port": "1-6.4",
        "firmware": "TEMPer2_V4.1",
        "hex_firmware": "54454d506572325f56342e3100000000",
        "hex_data": "808008274e2000008001078b4e200000",
        "internal temperature": 20.87,
        "external temperature": 19.31
    }
]
UltimateSolar commented 8 months ago

made a little script that will write a daily log file including the time :)

vim /scripts/TEMPer2.sh
#!/bin/bash
# take meassurement with TEMPer2 USB thermometer every 3sec

LOGFILE=/scripts/$(date '+%Y-%m-%d').TEMPer2.log;
while true;
do
    printf "\n$(date '+%Y-%m-%d===%H:%M:%S')\n" | tee -a $LOGFILE;
    ./temper.py --json|tee -a $LOGFILE;
    sleep 3;
    clear;
done