Giter VIP home page Giter VIP logo

Comments (17)

padelt avatar padelt commented on August 19, 2024

You mean the device has both an onboard as well as a cable-bound
external temperature sensor?
I am not aware of how that would work and I think the code does not
handle that at the moment.
That said - it should be possible to extract the data, maybe there are
more USB endpoints in your case.
Changing the code will be trial&error and sheer luck as the USB
interaction is a blackbox at least for me personally.

Can you provide another link to the product? The one you sent merely
shows a picture with no description.

-- Philipp

from temper-python.

heig avatar heig commented on August 19, 2024

Hi, thank you for your answer :)
Yeah it has two seperate sensors. I have found another information page: http://www.pcsensor.com/index.php?_a=product&product_id=160

from temper-python.

padelt avatar padelt commented on August 19, 2024

Thanks, that was helpful. It is a total shot in the dark, but if
possible could you capture a dump of the USB communication?
There is USBPCap for Windows that does the heavy lifting of writing a
pcap file.
The tool is here:
http://desowin.org/usbpcap/index.html

Once installed & rebooted, start it from "C:\Program
Files\USBPcap\USBPcapCMD.exe", select the most appropriate number in the
first column of the device tree and let it write a file, e.g. heig-19.pcap.
Then (unplug and) plug in the temper device and start reading using the
logger tool that comes with it.
Ctrl+C ends the capture. Please send me the file (or attach it to this
issue if that is possible) to autosort-github at philipp dot adelt dot net.
Also include the readings in that time (screenshot or text) so we can
correlate the data with the output.

I have never done that before but in theory the dump should show the
complete interaction between the software (that temper-python must
emulate) and the temper device.

-- Philipp

from temper-python.

heig avatar heig commented on August 19, 2024

Hi Philipp, i sent you the files via mail. Thanks again :)

from temper-python.

padelt avatar padelt commented on August 19, 2024

Thanks, got the files.
I do not have time to reverse engineer that right now, but it looks promising.
The device basically sends data from one endpoint, just like the ones I know and it seems to embed both temperatures in the same transfer, have a look here:
https://docs.google.com/spreadsheets/d/13pr1AK4CbSLBmcVBdw6WMunYdmL6VmFfINaOruiYeWM/edit?usp=sharing
If anyone wants to tinker with the code and needs more of the dump, let me know.

from temper-python.

amorphic avatar amorphic commented on August 19, 2024

Holy crap, there's an 8-sensor version too:

http://www.pcsensor.com/index.php?_a=product&product_id=177

It would be good to come up with an interface which would support polling of 2 or more sensors, maybe something like:

def get_temperature(self, format='celsius', sensor_no=1):

But whoever codes support for this should probably have a 2+ sensor TEMPer to test with. Perhaps we could ask the manufacturers to donate one?

from temper-python.

heig avatar heig commented on August 19, 2024

Hi,
unfortunately I have no idea of coding so I cannot help you guys. But I can ask the Manufacture for a donation.

But if i get it correct, what you are basically saying, is that the new code shouldn't just support the two sensor version but an "n"-Sensor Version without hard coded stuff for the 2-Sensor version?

Thank you for your support so far!

from temper-python.

amorphic avatar amorphic commented on August 19, 2024

I've just sent a message to the people at PCSensor asking if they'd be willing to donate one of their 8-thermometer units to our project. I'll update this thread if/when they reply.

from temper-python.

amorphic avatar amorphic commented on August 19, 2024

Here's what I got back form PCSensor. They're not willing to donate any hardware 😦...

Dear James,
I am sorry not reply you so quickly .Thanks for your email .
TEMPer8_H8 (http://www.pcsensor.com/index.php?_a=product&product_id=177 )
It can connect 8pcs sensors at the same time . you can purchase it from our website , we cannot offer the free sample to you .so sorry !
if you want to develop own program , you can purchase our DLL file . it costs $45 .

in addition , you can select anothe product . 1W_D2 (http://www.pcsensor.com/index.php_a=product&product_id=13 ) . You can have a look .
if you want to develop own program,you can come to here (http://www.maxim-ic.com/ ) to find the DLL >file. we use the IC come from this company .

Maybe it will give you some help !
Have a nice day !

Nice of them to offer to sell me a DLL for $45 though! 😉

from temper-python.

ps-jay avatar ps-jay commented on August 19, 2024

My early testing indicates that we can get the external sensor by altering the data_s array references on this line https://github.com/padelt/temper-python/blob/master/temperusb/temper.py#L172 from: data_s[2:4] to data[4:6].

I'll play more, and see if I can open a pull request for the functionality.

from temper-python.

ps-jay avatar ps-jay commented on August 19, 2024

Quick update:
External sensor plugged in: data = [128, 4, 27, 112, 20, 112, 46, 51]
Unplugged the external sensor: data = [128, 4, 27, 112, 255, 255, 46, 51]

This makes me more confident data[4:6] is the external reading.

from temper-python.

heig avatar heig commented on August 19, 2024

Hi ps-jay, thank you very much for this change :) I will try it out immediatly. I just added the second sensor to my device to test ;)

edit
I just tried it out. sensor=0 and sensor=1 work like a charm :) BUT sensor="all" gives me an error:

/usr/local/bin/temper-poll
Found 1 devices
Traceback (most recent call last):
File "/usr/local/bin/temper-poll", line 9, in
load_entry_point('temperusb==1.2.3', 'console_scripts', 'temper-poll')()
File "/usr/local/lib/python2.7/dist-packages/temperusb-1.2.3-py2.7.egg/temperusb/cli.py", line 78, in main
reading['temperature_f']))
TypeError: float argument required, not list

from temper-python.

ps-jay avatar ps-jay commented on August 19, 2024

Yeah - that make sense - that print statement isn't expecting a list of temperatures.

Lets see if we can get some action on this project over the next few weeks.

@foundbobby has committed some code to select from the cli command switches - we could extend that to support "all", and fix the print statement.

from temper-python.

foundbobby avatar foundbobby commented on August 19, 2024

I originally had it accept all, but saw the error too and removed it. I can add it back if you'd like

from temper-python.

ps-jay avatar ps-jay commented on August 19, 2024

I've update PR #34 ... works for me.
@heig & @foundbobby - have a look.

from temper-python.

ps-jay avatar ps-jay commented on August 19, 2024

Updated PR #34 again.
Please test.

from temper-python.

padelt avatar padelt commented on August 19, 2024

Just checked #34. Works perfectly with my two sensors: two devices with one sensor each. Thanks to everyone for making an even better solution! Please check if attribution in README.md is correct (what about @foundbobby ?) and send a pull request if not!
P.S.: This was joint work from California/USA, Germany and Australia, right? Nice! :)

from temper-python.

Related Issues (20)

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.