Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Driver does not support FP-25 air quality monitors #30

Open
hairem opened this issue Dec 1, 2022 · 16 comments
Open

Driver does not support FP-25 air quality monitors #30

hairem opened this issue Dec 1, 2022 · 16 comments

Comments

@hairem
Copy link

hairem commented Dec 1, 2022

All I am trying to do is get a reading:
from cal import Old_tables
from alicat import FlowMeter

flow = FlowMeter(port="/dev/ttyUSB0")
value = flow.get()
print(str(value))
and I get the error message:
Traceback (most recent call last):
File "test.py", line 6, in
value = flow.get()
File "/home/pi/.local/lib/python3.7/site-packages/alicat/serial.py", line 127, in get
for k, v in zip(self.keys, values)}
File "/home/pi/.local/lib/python3.7/site-packages/alicat/serial.py", line 127, in
for k, v in zip(self.keys, values)}
ValueError: could not convert string to float: '2022-12-01'

@alexrudd2
Copy link
Member

Can you add a print(values) to line 113?

        command = '{addr}\r'.format(addr=self.address)
        line = self._write_and_read(command, retries)
        spl = line.split()
        address, values = spl[0], spl[1:]
      ++print(values)

It looks like this flowmeter may be returning a date, which I haven't seen before. unfortunately, I don't have one at hand to test.

@alexrudd2
Copy link
Member

Also, what's the serial number? Alicat tech support can tell you exactly what that model will output over serial. Sometimes @marinapalese lurks in this repo, also.

@hairem
Copy link
Author

hairem commented Dec 5, 2022 via email

@alexrudd2 alexrudd2 changed the title ValueError: could not convert string to float: '2022-12-01' Driver does not support FP-25 air quality monitors Dec 5, 2022
@hairem
Copy link
Author

hairem commented Dec 5, 2022

it doesn't support just reading the outputs? isn't it a mass flow meter?

@alexrudd2
Copy link
Member

OK, that's interesting. Didn't even know this device existed! This repository does not support anything other than the M- and MC-series differential pressure flow meters/controllers. I would merge a PR extending to other devices, but cannot provide support for other devices we don't have.

The manual is provided here: https://documents.alicat.com/manuals/Alicat_FP-25_Calibrator_Manual.pdf

Page 42 lists the serial communications format.
Screenshot 2022-12-05 at 11 25 21 AM

Note the date/time at the front of the data frame, and pressure source/humidity at the end. Those are what's confusing the existing driver, which does not know about them.

@hairem
Copy link
Author

hairem commented Dec 5, 2022

I have been using the serial lines directly before using this library but the putout shifts with time. Thank you for the help.

@alexrudd2
Copy link
Member

I'm sorry I can't help directly. I think you have a couple of options.
(1) Fork this repository and extend the functionality yourself, using the manual above.
(2) Contact Alicat support - @marinapalese / [email protected] would be my first contact
(3) Contact @JosephHickey1 ([email protected]) and ask him about his repository Alicat-Python. I know very little about it but believe the intention was to make a more generalized controller. I do not know his current relationship with Alicat - he used to be employed there but no longer. Perhaps he is available as a contract programmer?
(4) Look through the manual and see if there is a way of disabling the "extra" data on the device to avoid confusing the driver as-is. (I see this as unlikely)

I'm happy to review / merge any code generated by the above strategies. Good luck :)

@hairem
Copy link
Author

hairem commented Dec 5, 2022

I will probably just make my own library for the project I am working on, was just trying to use what was already available. Or maybe I will do as you suggest and branch this library for my project, it is an in-house script so I have no plans to sell or distribute it.

@hairem
Copy link
Author

hairem commented Dec 5, 2022

As for the device, we just ordered these maybe 2 years ago, and are the standard we have in the office. I'm surprised you are unaware of them. Are these some kind of special meters?

@hairem
Copy link
Author

hairem commented Dec 5, 2022

After adding the print line I get this now:
['0000000', '2022-12-05', '0010:46:41', '+0755.3', '+0000.5', '+754.86', '+018.72', 'P', '+00.001', '+00.001', '049', 'RHAir']
Traceback (most recent call last):
File "/home/pi/.local/bin/alicat", line 10, in
sys.exit(run())
File "/home/pi/.local/lib/python3.7/site-packages/alicat/init.py", line 48, in run
command_line(args)
File "/home/pi/.local/lib/python3.7/site-packages/alicat/serial.py", line 567, in command_line
state = flow_controller.get()
File "/home/pi/.local/lib/python3.7/site-packages/alicat/serial.py", line 390, in get
state = FlowMeter.get(self, retries)
File "/home/pi/.local/lib/python3.7/site-packages/alicat/serial.py", line 128, in get
for k, v in zip(self.keys, values)}
File "/home/pi/.local/lib/python3.7/site-packages/alicat/serial.py", line 128, in
for k, v in zip(self.keys, values)}
ValueError: could not convert string to float: '2022-12-05'

the string is output but so is the error about it not being formated right
PROGRESS!!

@alexrudd2
Copy link
Member

As for the device, we just ordered these maybe 2 years ago, and are the standard we have in the office. I'm surprised you are unaware of them. Are these some kind of special meters?

I don't work for Alicat, we just buy (some of) their equipment. We use another vendor for humidity logging.

@hairem
Copy link
Author

hairem commented Dec 5, 2022

Oh, my bad. They linked to you so I thought you worked for them.

@hairem
Copy link
Author

hairem commented Dec 5, 2022

I got it to work, somewhat, but commenting out the lines 114-127.
now I get "['0000000', '2022-12-05', '0011:32:10', '+0755.1', '+0000.4', '+754.73', '+019.20', 'P', '+00.000', '+00.000', '049', 'RHAir']
None
"

@alexrudd2
Copy link
Member

Use the manual (or screenshot I posted above) to update this code:

self.keys = ['pressure', 'temperature', 'volumetric_flow', 'mass_flow',

@JosephHickey1
Copy link

Pushing a stable version of the Alicat-Python was actually my last hurrah with Alicat but I'm still around and happy to support the library as I can. Bill Nick at Alicat is currently the caretaker for the program though in case issues like this pop up on the future.

As Alex has said, updating the self.keys list to include the time and date information should resolve this. Alternatively, the other library should dynamically retrieve the keys when the program does initialization for the first time for the device.

@hairem
Copy link
Author

hairem commented Dec 5, 2022

Again, thank you for all your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants