PDA

View Full Version here: : Do you have a TEMPer or TEMPerHum USB device? Making ASCOM driver for it.


luka
24-05-2017, 12:12 PM
Hi,

I am writing an ASCOM driver for the TEMPer or TEMPerHum devices that can be obtained from ebay (http://www.ebay.com.au/itm/152318823468) or other places cheaply. Currently such driver can be used by SGP and the support in APT is coming before the end of the year. I am not sure what other software supports ASCOM ObservingConditions interface as it is relatively new.

The source code for the ASCOM driver will be released as open source with GPL license so anyone can use it as long as they keep their modifications open. I believe this will benefit the community the most.

I got my device yesterday and already got the basic ASCOM driver working. However, I would like to include the other variations of the TEMPer(Hum) devices. To call it variations is actually misleading, really the only similarity sometimes is the misuse of the name. They can have different sensors and talk different protocols and some even appear like identical but incompatible devices.


So, if you have such device I would like to help, my plan is to first find out who has which type of device. Then I would write some basic software that can read temperature/humidity from that particular device, which you will need to test. Once/if this is working the temperature/humidity code will be ported into the ASCOM driver which again will need testing.

First I need to know which type of device you have. To get the information:
On Windows:
1. Connect your device
2. Go to device manager
3. Expand the Human Interface Device section by clicking on little plus or arrow next to it.
4. You may see more than one device there. If you do you will need to find the right one. Start from the top and work your way down until you find the right one. Some devices may even appear more than once.
5. Right click on the device and select properties.
6. Properties window will open. Click on Details on the top.
7. Under Property you will need to scroll down (a lot) and find Bus reported device description and select it. In my case the value is
TEMPer1F_H1_V1.4
Look for something that start with TEMP... this will tell you that you have the right device. If you see something like USB keyboard, that is obviously not it. If you don't have the right device, close the window and go back to step 4 and pick the next one from the device manager.
8. Back under Property select "Hardware Ids" (usually 2nd from top). You will see something like
USB\VID_0C45&PID_7402&.....

In this case VID = 0C45 and the PID = 7402. Note that the numbers are hexadecimal and may include letters A to F.


I will need the description and the two numbers to identify the device.


On linux:
Open shell and run lsusb -v|less |grep TEMP
You should be able to see PID, VID and the device information that I need.



If you can send me those two findings by PM or post here that will get the ball rolling. I will try to find information about your device and, if it is different than the ones I already have and if I can find information how to talk to it, I will send you a small program that will test reading of temperature/humidity (If you don't want to run executables from me I can send you a source code and you can compile it yourself using free Visual Studio from Microsoft).

LaughingBeagles
24-05-2017, 08:50 PM
More than happy to get on board and help.

I too have:

TEMPer1F_H1_V1.4

and
Hardware ID's:

USB\VID_0C45&PID_7402&REV_0001&MI_01
USB\VID_0C45&PID_7402&MI_01

RobF
24-05-2017, 09:11 PM
Next time I fire the rig up I'll go digging.....

luka
25-05-2017, 01:24 PM
Peter, that is the same as mine. I already have a very basic version of the ASCOM driver that I tested with the trial version of SGP. Not sure what other software I can use to test it...


See if I find time do a bit more work on it tonight and will then share it for testing.


Please note that at this stage the driver will work ONLY with this device.



Rob, thank you.

LaughingBeagles
25-05-2017, 07:45 PM
Thanks Rob, looking forward to it.

Pete

luka
26-05-2017, 01:55 AM
Peter, as you probably have identical device to mine, I should mention that the software that came with the device is useless. It gives different readings than the device itself (if you press the button on the device it will type it into whatever software you have open, e.g. word, notepad, excel etc.). My guess is that the software was written for a slightly different device and never updated as it was "close enough".


Also the device itself gives the correct readings. I had to open it to find out which sensor it is using (SHT20) and then to figure out how the manufacturer was manipulating the data. I can confirm that the device is giving identical readings to what I read in the sensor datasheet. No idea what the software does.


I sent you a PM with the first version of the driver for testing.

LaughingBeagles
26-05-2017, 07:36 AM
Thanks Luka,

I've replied to your PM. Will be interesting then to compare outputs given it's the same device as yours.

RobF
27-05-2017, 07:11 PM
This is mine

luka
27-05-2017, 08:25 PM
Thank Rob. Can you also get the "Bus reported device description" from the same screen. Different devices are using the same PID and VID so it is impossible to determine which is which just from that information.

Pete, I forgot to mention that SGP already has TEMPerHum device support (but I don't think it works with our devices). You will need to select "TEMPerHum ASCOM driver" as the device.
Also the first readings will be all zeroes as SGP requests values before the driver manages to get a reading. You will need to wait 30sec for the values to refresh in SGP.

RobF
27-05-2017, 09:01 PM
Added another shot of device name - hope that's what you were after luka?

luka
27-05-2017, 09:51 PM
Excellent, thanks Rob. That is a different device to Pete's and mine. According to the Internet it talks the same protocol but has a different sensor.

At the moment the driver is working only for our devices but I have started adding framework to support multiple devices. The automatic detection is more complex than I initially thought due to variety of these devices. Yours will be added next.

Can you PM me your email address so I can add you to the shared folder with the drivers. No rush, they won't work with your device yet.

rally
27-05-2017, 11:07 PM
I found 2 of mine (which are the same as each other) in original packaging
The devices are labelled as TEMPer1

Hardware ID's:

HID\VID_1130&PID_660C&REV_0150&MI_01
HID\VID_1130&PID_660C&MI_01
HID_DEVICE_UP:0001_U:0003
HID_DEVICE

===============
There were 4 lines of data unlike others that listed 2

In Win10 there was no entry for Bus reported device description
The only property I found anywhere that had the word "Description" was one that said something generic like "HID_Device"

I can send you one if you want to check it out if that helps, just send it back when you're finished.
The installation/setup and ##.msi files were dated 2010 and 2009, some of the other files in the DOTNetFX directory were dated 2004, 2005
So that possibly gives some idea of the vintage

Couldnt find the others which I think were TEMPerHums

Rally

luka
27-05-2017, 11:41 PM
Hi Rally,

Thank you for the info. That is definitely a different device from the rest. I have possibly found some information about that particular device. Let me see if we can get it going, otherwise we can try posting it.

Luka

rally
28-05-2017, 12:55 AM
Luka,

No worries - see how you go
PM me an address when you're ready and I'll send it - at least you will know for sure !

I cant find the others we spoke about by PM - but from correspondence back in Dec 2010 to my astro buddy who at the time we were working on some observatory automation and control together - they were supposed to be the TEMPerNTC model.
Seems they may have sent me the wrong ones and I may or may not have ever got the TEMPerNTC version.
Ill keep checking

LaughingBeagles
28-05-2017, 10:35 AM
Understood mate.

Hoping to get the gear out tonight - weathers good our way so fingers crossed!

RobF
28-05-2017, 10:48 PM
Shall do.

I believe all this device to device variation is what drove the SGP guys mad in the end. Just too hard to keep up, especially if you're charging people for commercial software.

I'm pretty happy with mine and its tracking software - plots humidity and temp all night as well as calculating dew point. Worked well over last couple of weekends here where fog came in on both occasions. Predicted pretty well when that was going to occur.

What are people expecting to get from the ASCOM drive in SGP? Better choice of focusing options?

rally
29-05-2017, 03:00 PM
I thought Id try to open the device in LabView on a Vista machine
Vista has only listed with the first two lines of the 4 lines I found on the Win10 machine

Win is installing its generic HID driver for mine, which doesnt give LabView access to it. So I think I'd need to remove the default MS HID driver and play around to create a VISA driver for it or maybe not bother !

luka
31-05-2017, 01:20 AM
Rob, the tracking software that came with mine is useless. If I press the button on the device it will output the temperature and humidity and the values are about 3 degrees C and 10-20% different than in the tracking software. And the values provided by the device are correct when I compared them to the datasheet.

My guess is that the tracking software was written for another device which uses the same commands for reading but has a different sensor which uses different calibration values. Hence the wrong readings.

I am not sure what people are expecting from the ASCOM driver in SGP. It is a good question...

What I noticed is that people want and are building temperature/humidity loggers and considering the price of these devices and that require no DIY skills (DIY is not for everybody), with the working driver these devices would open the temperature/humidity logging to the masses. That was my thinking.

Rally, all those devices are programmed to come as HID devices. Actually often they appear as two HID devices at the same time. I don't think you can remove the MS HID driver. Can you use LabView to access HID devices? There are MS DLLs with functions that allow low level access. Once you can open it then you will need to send the correct commands to read temperature/humidity and then calibrate the readings. But opening the HID device would be the tricky part.


edit: No progress on the driver in the past few days. Have a backlog of work to do :( Also the sky has been clear and I just got a new (2nd hand) NEQ6 that feels lonely and needs someone to play with it ;)

RobF
31-05-2017, 10:26 PM
Realistically it seems likely the ASCOM model will be the future of monitoring devices. I salute you sir! :D

trent_julie
06-06-2017, 05:46 PM
+1 This device

luka
06-06-2017, 05:50 PM
If you PM me your email address I will send you a link to a testing version of the ASCOM driver (that at the moment works for this device only).

I got sidetracked with work and have not done much work on the other devices yet.

rally
06-06-2017, 10:48 PM
Hi Luka,

The MS HID driver will automatically install so you would need to delete it in Device Manager and select your own custom VISA driver. This can be done using LabView's VISA wizard utility that allows you to create your own USB raw device driver.
If you knew what the DLLs are in the HID driver you can also use it in LabVIEW by using a Call Library Function Node.

A job for a rainy day !
Possible if you have the time and inclination.

luka
06-06-2017, 11:19 PM
Rally, we already have a working driver using the Windows HID DLLs (and I have not used Labview for years). The other TEMPer(Hum) devices work the same as the one I got working, the only difference is the different protocol... Well, when I say protocol it is only 6 bytes getting passed each way so it is not complicated at all.

However, the complicated part is managing multiple devices and making the user interface which allows easy selection of devices and also modification of all parameters. Possibly even allowing the user to manually enter the hex device protocol commands... not sure.

Really, not complicated, just takes time which I unfortunately don't have lots of ATM.

luka
15-06-2017, 01:09 AM
The very first version of the driver that supports multiple devices is ready for testing and uploaded to the shared Google Drive. It allows tweaking of almost all parameters and mixing of various settings from different devices to "make new devices". Hence the setup form looks complicated. I will need to do a bit more work on it and on the instructions but I would like to see it working first :)
To use:
- Plug in TEMPer device
- Go to configuration in ASCOM and click autodetect.
- If the autodetection does not complain then click read on the bottom and you should see the temperature (and humidity).
- If the autodetection complains get the list of HID devices, read parameters of your TEMPer device and post a screenshot here.


Once configured the driver should work with Sequence Generator. Also I fixed the delay in reading from the initial version.

Remember that this is the very first working version for multiple devices with LOTS of changes. Expect bugs and issues and please report whatever you notice, god or bad. Enjoy.

LaughingBeagles
15-06-2017, 07:25 AM
Thanks mate, terrific news and much appreciated. Will get on to it. Am hoping to get some time this weekend.

Pete

luka
15-06-2017, 10:14 PM
I forgot to add last night, this is the list of currently supported devices:
TEMPer1F_H1_V1.4
TEMPer2HumiV1.x
TEMPerHumV1.0rHu
TEMPerHumM12V1.0
TEMPerV1.2
TEMPer2V1.3
TEMPerNTC1.0

Those are devices for which I could find information for on the internet. The other devices may work as well as lots of them are actually identical.

Unfortunately there are other devices out there for which no information exists. Can't do much about them :(

RobF
08-07-2017, 01:22 PM
Hey guys, Luka has created a quality product worth giving a spin if you get time. Very civilised having access to temp for Sequence Generator now through ASCOM. With all the variations in these devices your input could be beneficial.

luka
10-07-2017, 12:28 AM
Rob, thank you for your kind words and for the help testing the driver :thumbsup:

I have uploaded version 0.8.1 to the Google Drive shared folder. (https://drive.google.com/open?id=0B17xefQsw2ktTHdTRG9qTnBtVE E) Lots of changes and bug fixes behind the scenes. Screenshots are attached.

At the moment, with Rob's help, we have confirmed that the driver is working for:
TEMPer1F_H1_V1.4
TEMPERHUM1V1.3

Also supported but untested are:
TEMPer2HumiV1.x
TEMPerHumV1.0rHu
TEMPerHumM12V1.0
TEMPerV1.2
TEMPer2V1.3
TEMPerNTC1.0
TEMPerHumM12V1.2
TEMPerHumM12V1.3

The other devices may work as well but again I have no way to test them.

Instructions:
- Connect device and go to ASCOM properties for the TemperHum driver
- Click Detect Device
- If the message says that everything is working, click OK and you are set to go

You can test if it works by clicking Read Sensors

- If you get an error message click OK to expand the window and search for HID devices (right hand side of the window)
- Find the HID device that looks like a TemperHum device and copy the PID and VID to the left hand side of the window (click advanced first)
- Play with different devices and different sensors until you get valid readings.
Make sure you keep the PID and VID as found above.

If you find a working configuration for untested or new device please send the settings to me (screenshot is enough) and I will add that device.

dpastern
29-09-2017, 03:10 PM
I don't have the TEMPerHUM device, or SGP yet, but since I am looking at purchasing SGP, and I like what TEMPerHUM does, I'd like to thank you Luka.

I'm just about to purchase a TEMPerHUM device off EBay now, will let you know what the device details are (although I'm on OS X). I know this is a Windows ASCOM driver that you're working, and that SGP works only on Windows, but I'll have to figure out the OS X device manager information windows to get the right device information for you.

Cheers,

Dave

RobF
30-09-2017, 03:00 PM
I started having trouble after I moved from a 32bit Win 7 laptop to 64bit Win 7. Suspect it could almost anything USB related other than Luka's driver.

Just haven't had time to play again, as the USB freezes were too dangerous when doing automated data collection. Seemed fine on 32 bit though.

luka
10-10-2017, 11:01 PM
Thanks Dave.

Rob, ASCOM applications are "mostly" 32-bits, more info in the first paragraph here (http://ascom-standards.org/Developer/DevFor32And64Bits.htm). Basically it is not possible to mix 64 and 32-bit ASCOM applications. However, this driver was compiled specifically for 32-bit. I have recompiled a new one with "any CPU" option which should cover both, not sure if it will change anything. It is in the TEMPerHum public folder.

Sorry for the lack of progress and slow replies, I got sidetracked by work. Did not have time to get testers on the SGP forums or to release the source yet :sadeyes:

dpastern
10-10-2017, 11:38 PM
Don't apologise Luka - this is a very nice thing that you've done for the community. Sometimes I wish I could program, but sadly, I've got more chance of flying au natural than of learning to program lol!

My TemperHum should arrive within the next 2 weeks. I will try and decipher the appropriate information and post them in the thread as device feedback for you. I'm still to purchase SGP - not too keen on buying v2 and then having to shell out more for v3 with a few more weeks or a month...I'm lucky that way ;-)

luka
10-10-2017, 11:49 PM
Thanks for the kind words Dave.

I also still have not purchased SGP. Even worse, the trial period has expired and the ASCOM observing conditions are disabled in the free version of SGP.

In other words, I cannot even use SGP with TEMPerHum devices and my driver. And even worse, I will have to buy it to do any further development. Not sure if irony is the right word to use here
:rofl:

RobF
11-10-2017, 12:36 AM
When you find the loot to do so, SGP is definitely a good investment for the future.
Sounds like they're close to release V3 in near future.

dpastern
11-10-2017, 12:40 AM
Luka - PM me your paypal or bank account details - I'll happily donate $15 towards your SGP purchase. Hopefully others will match this offer.

Cheers,

Dave

luka
12-10-2017, 12:05 AM
Dave, thank you for the very kind offer but it is fine. I like doing things like this for the benefit of the community and knowing that people appreciate my work is more than enough.

The reasons I did not buy SGP yet is that I am still transitioning from APT to it and that so far the light version was enough. And since the trial expired I had no time to work on the software. Also, just like you, I am waiting and waiting for the v3 to come out...

Again, thank you for the kind offer.
Luka

dpastern
16-10-2017, 08:15 PM
All good! Was just happy to help out for your efforts on developing the driver!

luka
17-03-2018, 01:39 AM
Hi,
it has been a while...

I needed a distraction from the real work and decided to finally get this software to its final shape (for now). It is almost at the stage where I am happy with it, apart from the needed testing. I will put the source code on the GitHub soon, just waiting for feedback.

Main changes for this v2.0 release:
- support for a few new devices (still untested)
- help button with instructions
- minor interface tweaks
- several bug fixes

Screenshots of the simple mode, advanced mode, full mode and the list of supported devices is attached.

If you have a TEMPerHUM device please test and report here.

Download from here (https://drive.google.com/open?id=0B17xefQsw2ktTHdTRG9qTnBtVE E).

LaughingBeagles
18-03-2018, 02:04 PM
Hi Luka,

Just got the temp gauge that comes with the Moonlite focuser (it was one less cord dangling from my gear!). I haven't used it as yet but happy to see if this talks to it.

Pete

troypiggo
08-08-2019, 07:24 AM
G'day Luka,

Sorry to resurrect old thread, but I found my old TemperHUM and thought I'd try out your ASCOM driver. Doesn't show up when I click "Detect Device", but the show connected devices helped locate it (had trouble finding it in the Device Manager). Screenshot of addresses attached.

luka
11-08-2019, 10:57 PM
Thanks Troy.
I have to admit I have neglected this project "a bit" in the absence of time. Give me a few days and I'll see if I can figure something out.

troypiggo
12-08-2019, 12:55 PM
No problem and no rush. Appreciate any assistance at all.

luka
18-08-2019, 12:33 AM
Hi Troy,

Can you try the attached driver.

I have found (partially conflicting) information about your device on the net, so in theory, we should be able to get it going. Of course I do not have your device to test so it is all guesswork at this stage and it may take us a few attempts to figure out the parameters.

1. Install
2. In configuration click Detect Device.
3. If all goes well click Read Sensors. This will attempt communicating with the device.
4. Hopefully you should get some values for temperature/humidity and also some hex numbers in the box Raw Data.

If the values for temperature and humidity look OK then try again when the temperature is colder/hotter and see if the values are still ok (e.g. hold the sensor in your hand to warm it up or blow on the sensor to increase the humidity).

If the values are incorrect then send me the raw data (or a screenshot showing it).

If the values are read but do not make sense you can also try different combinations of the following settings:
1. Changing offsets from 0,1,2,3,0,0 to 2,3,4,5,0,0
2. Ticking the box Signed Offsets.
3. Changing the sensor from SHT1x to FM75 (it is most likely SHT1x but there was some conflicting info on the internet).

If you need to reset to the default values just reinstall the driver.

Good luck and let me know how you go.

troypiggo
18-08-2019, 08:53 AM
Thanks for looking into this mate. Unfortunately still having trouble detecting it - getting error message "Error, no known devices have been found. Do you want to see the list of all HID devices?"

Ignoring the error message, I manually selected the device at bottom of list. Clicking "read sensors" did nothing.

Manually changed sensor, signed offsets checkbox, and data offsets in all combinations and clicked "read sensors" after every change, and still nothing reads.

I also had a thought that it's an old USB2 device, and have had issues with USB2 ZWO camera plugged into USB3 port on computer, so tried all of the above in USB2 port as well. Still no joy. Just thought I'd add all things I tested.

Dumb question - I don't have any drivers for this thing. When I plug it in Windows10 says device ready. Is installing your ASCOM driver enough, or should I be trying to track down the PCSensor manuf driver as well? I'll do some more searching for it in the meantime, but it's so old I'm having trouble finding it. Might just be easier, and cheaper than your time wasted trying to get it to work, for me to just buy a newer one that does work. Was thinking I could mail it to you so you had it to test, but return postage probably just buy new one. Thinking the 2 you have tested (no *'s in drop down list) like the TEMPer1F_H1_V1.4 or the TEMPERHUM1V1.3

troypiggo
18-08-2019, 09:37 PM
Just confirming I've ordered a new Temperhum from Aliexpress.

luka
18-08-2019, 10:59 PM
I am actually surprised it did not get detected. That first step (detection) is only comparing the values from your screenshot.
(Reading the correct values from the device is a separate story, that is the next step).
Let me know if you want to do more troubleshooting, I could send you special versions of the driver to try to figure out what was going on.

No drivers are needed as it is USB HID device. However, you do need some software to get the data out. Usually there is a CD with some simple software to read the temperature/humidity.
For my device the bundled software was reading wrong values. I believe they just used software for their previous device which had a different sensor.

Note that these devices are a mess, so many different versions had been made with different sensors and all with same/similar names. Let us know when it arrives as it may be something completely different again... hopefully not.

RobF
19-08-2019, 09:23 PM
I never got back to playing with my TemperHum on the "new" Win 7 laptop after suspecting some sort of USB stability issue.

I wonder if a more predictable path might be to combine something like this with an Arduino Uno along with something like Luka's ASCOM driver?
The Temperhums do seem to be legendary for unexpected variabilities.

https://www.banggood.com/AM2302-DHT22-Temperature-And-Humidity-Sensor-Module-For-Arduino-SCM-p-937403.html?currency=USD&utm_source=rtbhouse&utm_medium=cpc_brand&utm_content=all&utm_campaign=rtb-electronics-all-en&cur_warehouse=CN

luka
20-08-2019, 01:59 AM
Rob, it would be easy to write Arduino code to read the temperature/humidity sensor. And adding ASCOM driver as well.

The TemperHum devices do come in a nice USB stick format. Any Arduino based devices will need some work, wiring and putting in a box. The latter may not be for everybody, although it should be quite easy to do.

Is there interest in a custom-built Arduino device to measure temperature/humidity with ASCOM Observing Conditions driver?

RobF
20-08-2019, 08:51 PM
I built a small Arduino (Uno) flats box dimmer project in a cheap project box for an Arduino Mega recently. Essentially just the Uno, a Mosfet and an RCA output connection (USB and 12V input to the existing Uno input ports). Using the larger project case left space for the MOSFET and RCA, and the existing mounting points still worked fine for the Uno.

Wonder if the same simple box would be sufficient to give the sensor access to open air, wouldn't need 12V - hopefully heat from Uno would be negligible? Obviously much bigger than a Temperhum stuck in a USB port, but not huge.

https://www.ebay.com.au/itm/Black-ABS-Box-Case-FOR-Arduino-Mega2560-R3-Controller-Enclosure-W-Switch/323031086939?hash=item4b3627375b:g: cs8AAOSwHMJaLly5&frcectupt=true


This was the original CN's thread about the Alnitak dimmer project BTW for reference:
https://www.cloudynights.com/topic/536533-diy-alnitak-flat-panel/
First post has a pic of similar project box, but more enclosed than one I linked to above.
(if I can do it, anyone could.....)


Might also be possible to use the Arduino Nano and go much smaller again?

luka
20-08-2019, 10:24 PM
The simplest/smallest solution would be an Arduino Nano + a sensor. USB powered, I have to check but the sensor probably can be powered by the Nano. Possibly the parts could be picked so that no soldering is needed for those who would struggle with it.

The DHT22 sensors are notorious for dying for no reason (the humidity starts showing 0% or 100%) and I would probably pick something like Bosch BME280 which can also measure pressure. Similar cost of a few $ but it is a much better device.

So the small box could do temperature, humidity, dew point (calculated) and possibly pressure. Total cost for the parts without box would be about $5 from AliExpress (or a bit more from Ebay).

By the way, the TemperHum devices are not "that small" as they should be connected with an USB lead. If connected directly to computer/laptop they will get warm from it and hence show incorrect readings.

troypiggo
21-08-2019, 10:13 AM
Interesting - and thanks Rob and Luka for taking it further. The Temperhum I ordered (around AU$30) says it's +-0.5deg C accuracy on the PCSensor website, but on the Alibaba page I bought it from says it's +-0.2deg. Not sure I trust either of those...

Wondering accuracy of this arduino solution.

Regarding the use of leads for the Temperhum - mine would be connected to Mount Hub Pro which sits on the scope. Not sure how much heat the MHP generates, but I was assuming that'd be realistic enough to ambient, or at least follow the trend. Only interested in temperature drops, not necessarily the absolute value, to trigger autofocus adjust.

RobF
21-08-2019, 04:20 PM
I used to plug mine into the Mount Hub Pro as well Troy - pretty good compromise, especially as mine is in a Coles clip-closed lunch box with slots cut for connections.

Luka, thanks for the comments on more reliable and useful sensors - way out of my league to know about such things. Agree with you the Arduino project could be extremely simple, and possibly even plug and go through some sort of Arduino shield.

troypiggo
21-08-2019, 04:41 PM
Did some googling at lunchtime - here's an arduino ASCOM temp sensor project. They used the DH22, but I assume wouldn't be hard to translate to another one as Luka recommends.

http://photonenfangen.de/instruments/ascom-temperature-sensor/

RobF
21-08-2019, 04:44 PM
Nice - thanks Troy
(gotta love Google translate - look out for those "B" refractors! :) )

luka
22-08-2019, 12:54 AM
The accuracy depends on the sensor. Once you get your device try the driver and if it works it should tell you what sensor is inside.
For example, the temperature accuracy of DHT22 is ±0.5°C while the humidity accuracy is interestingly quoted to be ±2% but can be as high as ±5%. BME280 also has ±0.5°C temperature accuracy (±1C at 65°C).


Wonderful find. That is exactly what I was thinking about. The only issue with it is that even this device has been called TemperHum v3. My head is going to explode :lol:

By the way, I did not find any BME280 breakout boards that can be used without soldering.

troypiggo
22-08-2019, 09:08 AM
Haha. I missed that first time around - although it's TempHum v3, without the "er". No need to lose your head over that :rofl:

luka
22-08-2019, 11:14 AM
See what I mean, I have starting imagining things now as well :lol:

troypiggo
10-09-2019, 08:56 PM
G'day Luka. Device fiiiiiiiiiinally arrived today. Tried connecting through your ASCOM driver beta v2.1, but didn't detect it unfortunately. Screenshot below of the "get device details" output.

The device is working. Attached also is screenshot of the PC Sensor software. Note the red icon in top bar says "TEMPerX", but the device is the white TEMPerHUM with the TXT button as in this screenshot.

luka
10-09-2019, 10:40 PM
Troy, that looks exactly like mine. But who knows what is inside... hopefully the same sensor with another (different) name.

Can you:
1. go to the driver
2. once it fails to autodetect click yes to see the list of all HID devices
3. on the right hand side expand "connected HID devices"
4. select the device that looks like TemperHum. If nothing looks like TemperHum can you post a screenshot with the expanded "connected HID devices"
5. If you find your TemperHum device click "Get Device Details". Post a screenshot here.

For example, see the attached screenshot how it looks for my device.

troypiggo
11-09-2019, 06:22 AM
G'day Luka,

That first screenshot I posted above is the "get device details" for the device. It only showed up the PID and VID, the rest is blank. I tested it with the device unplugged and then plugged in, and that is the only new one that appeared.

luka
12-09-2019, 01:04 AM
That is weird. The "Get device details" button gets the data from the Device Manager. This means that your new device is not setting this and likely that the manufacturer software is reading the device info directly from the device.

Interestingly, I downloaded the PCsensor software from your screenshot and it works correctly with my TemperHum device (unlike the software that came with the device on the CD).

Anyway, the good news is that I may have found a salvation from the TemperHum hell :rofl:
I have decompiled the PCsensor software and found LOTS of info there, more than enough to get a whole range of new devices working. A major change but if this works it will be a major progress!!!

Troy, does your old device work with the new software?

troypiggo
12-09-2019, 08:52 AM
G'day Luka,

Tried the old device, and it doesn't work with that PC sensor program. So perhaps the device is a dud? Or perhaps it's because of its age? Who knows.

Good news that you're able to glean lots of info from the software, though. That's awesome!

luka
17-09-2019, 11:43 PM
I am looking for testers of the new driver (before releasing it into the wild).

The new version is a significant rewrite and is based on the messy code extracted from the Chinese software (instead of comments I picked up from the internet for the previous version).

The new version supports more devices than before.
Thanks to Troy :thumbsup: we have tested 2 devices so far.

PM me if you have a TEMPerHum device and want to try out the new driver.

luka
29-09-2019, 12:40 AM
Here is a new beta version (https://www.dropbox.com/sh/6z7a697b4v0pyzk/AAAK157tmQKHztxNBeh3EyJ9a?dl=0) for more general public testing. Few people have successfully tested it with different devices.

Changes:
- Major code cleanup
- The driver is passing all ASCOM validations now

Two issues:
- The driver will only work with 32-bit applications (which is most of them). I have used the Chinese DLL for USB access which is 32-bit only :mad2:
- Not sure how to open-source the source code any more; I had to "borrow" some calibration code from the original Chinese code :shrug:

RobF
29-09-2019, 02:11 PM
Hi Luka

I'm all set up waiting for the sun to go away, so have just given this another spin with my original "temperhum 1.3" device and your latest V3 ASCOM beta, running from within Sequence Generator.

SGP crashed on first attempt, but 2nd time I unchecked the "2nd Sensor" tickbox, and seem to have success :)

Have dangled a 2nd thermometer nearby and the readings look believable. 40 degrees temp and 8% humidity - don't think I have to worry about fog tonight. Terrible drought once you drive inland a bit in SE Qld.

RobF
29-09-2019, 02:21 PM
Is there any way to make the driver software fail more gracefully? This is pretty nitpicky and probably outside your control, but would be good if crashes could be captured.

Same goes for Sequence Generator of course - arguably more at fault than your work I guess.


I'll try and leave the Temperhum in place all afternoon and tonight and see how it goes. Seems happy so far.

luka
29-09-2019, 09:57 PM
Rob, which version did you try?

The original beta v3 did not have much error checking as the goal was to get it working first but the one with yesterday's date (v3.0 beta 20190928) should not be crashing. It should just disconnect when error occurs.

By the way, another update is coming soon, I have been doing more "polishing" (and error-proofing) and have added instructions.

RobF
29-09-2019, 10:01 PM
Have been playing on and off today with the very latest V3 Luka. Just happended to have some time today with the rig set up and noticed you'd posted a new version late last night.

It seemed ok while the rig was idling, but I've had SGP freezes a few times tonight and have taken the Temphum dongle out of the Mount Hub Pro now.
Love the work you've put into this, but my device in my system still seems very fiddly alas.

luka
29-09-2019, 11:48 PM
Rob, sorry about that, hopefully you did not lose any data.

After your post I did a bit more poking around and I think that the problem is caused by the Chinese communication library (DLL) that we are using now. If for whatever reason it fails to read data from the device it just locks up the driver which then locks up SGP. My old driver had timeouts to avoid lockups but now we are relying on the DLL.
By the way, SGP is also partially to blame as it should also be using timeouts to recover and not relying that everything will always work perfectly.

While I could work around the "locking up" problem, I may spend the effort to rewrite the DLL. I can reuse the code from my old driver so it should not take too long. This was on my to do list for some later stage anyway.

troypiggo
30-09-2019, 05:41 PM
G'day Luka,

Thanks so much for sticking with this. I've been a bit flat out at work and home last few weeks, and will be for another couple. So won't get a chance to test "live" for a bit. Will let you know results when I do.

RobF
30-09-2019, 06:08 PM
No guilt required - I was nearby all night keeping a very close eye on things, knowing well it was Beta code you'd shared. When I did pluck it in the milddle of an SGP freeze surprisingly SGP pepped up again and kept going like nothing had happened. Definitely agree that would be nice for Sequence Generator to be more robust - the programmer have frequently commented they do their best to implement ASCOM standards with expectations the gear is playing ball. Your comments re the chinese DLL seem consistent with what's been happening though.

I'm also experiencing infrequent USB challenges with my gear even without the temperhum. Wish I knew if it was power, cables, gear - trying to steadily tick off things on at a time.

Not the most reliable tester right now alas..... :)