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

.set( ) not working #7

Open
isabdr opened this issue Jul 8, 2022 · 11 comments
Open

.set( ) not working #7

isabdr opened this issue Jul 8, 2022 · 11 comments

Comments

@isabdr
Copy link

isabdr commented Jul 8, 2022

@patrickfuller

I'm trying to control my MFC using a Raspberry Pi4. I'm able to establish a connection with the MFC, .get( ) function is working, and so is .set_gas( ). But when I try to change the actual flowrate with .set( ), .open( ), or .close( ), I'm getting errors.

When I try to use .set( ) on the command line I get: Could not connect to device
When I try to use it in a script I get:
RuntimeError: Event loop is closed
Unclosed client session
Unclosed connector

image

Am I missing some sort of previous configuration on the MFC? I'm pretty lost here, so any help is welcome!
Thanks in advance!

@patrickfuller
Copy link
Contributor

@isabdr

I've learned that these MFCs can change behavior based on year of assembly + other factors out of this library's control. I know the library works on my MFCs, but you are probably working with different MFCs that I can't test.

I'll take a few guesses and see if I can help.

  1. Are you sure your device is a flow controller and not a flow meter? Not all MKS devices come with the ability to control flow.
  2. Can you access a website when you type the IP address of the MFC into a web browser?
  3. If yes, is there a tab on the website for setting flow rate?
  4. Does a page show up when you go to http://the.mfc.ip.address/flow_setpoint_html? This is the page that this library uses to set flow rate.

Hope this helps!

@isabdr
Copy link
Author

isabdr commented Jul 11, 2022

@patrickfuller

The MFC is for sure a Mass Controller because we can use it just fine when controlling it through a computer. But I don't seem to be able to access http://the.mfc.ip.address/flow_setpoint_html on the browser, it keeps loading forever, which honestly might have something to do with my version of Windows.

But another thing that called my attention when trying to debug this now is how we have to type in a password to be able to access the full settings in the web browser. Do we need to type in that password anywhere when using your library?

Thanks again for all the help!

@alexrudd2
Copy link
Member

The default passwords are 'config' and 'control' for those respective control settings.

@isabdr
Copy link
Author

isabdr commented Jul 11, 2022

My password is still 'config' so that is probably not the issue, and I can change the gas type...

@alexrudd2
Copy link
Member

def __init__(self, address: str, timeout: float = 1.0, password: str = 'config'):

I wonder what happens if you try changing this to 'control'?

(I should note I've never used this library, only similar ones. Sorry I can't be more helpful)

@isabdr
Copy link
Author

isabdr commented Jul 11, 2022

It still lets me change the gas type but not the control flow

@patrickfuller
Copy link
Contributor

Hm, can you set the flow rate on the device's website? There should be a tab that lets you set it there.

(If you can set flow rates on the website but not through this driver, then I unfortunately don't know what the issue is.)

@isabdr
Copy link
Author

isabdr commented Jul 11, 2022

I'm just confused about how you got the 'flow_setpoint_html' link, because when I change settings in the browser, the only thing on the URL bar is the IP address.

@patrickfuller
Copy link
Contributor

@isabdr we probably used Wireshark to monitor the communication traffic as we changed settings on the web interface. We likely cross-checked by searching through the javascript in the browser's debugger console and/or testing the API calls with curl.

If you set up Wireshark to monitor traffic to/from the MFC IP and then change settings on the MFC website while monitoring, you'll probably learn what you need to fix this problem.

@leonardo-chiappisi
Copy link

Hi Isabdr,

I am facing the same problem. Did you find a solution at the end?

Best wishes,
Leonardo

@Sreerag0605
Copy link

Hi @patrickfuller and @isabdr,

I am facing the same problem. Any solutions that you found?

Best,
Sreerag

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

5 participants