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

Error when running script cmd line ":22:in `<main>': uninitialized constant API (NameError)" #1987

Open
pmjohara opened this issue Sep 14, 2023 · 8 comments
Labels

Comments

@pmjohara
Copy link

I am getting the following error when trying to run the script
":22:in `

': uninitialized constant API (NameError)" ... any ideas?

@sprak3000
Copy link
Collaborator

sprak3000 commented Sep 18, 2023

@pmjohara

Which script are you trying to run?

@pmjohara
Copy link
Author

thanks for the reply @sprak3000 . the script I am try to run is
https://github.com/Iamrodos/EnvoyStats/blob/main/solar.4m.rb

@sprak3000
Copy link
Collaborator

@pmjohara

Unfortunately, I do not own one of these devices to be able to fully test the plugin against. I'm not seeing that error when I start up the script and give it an arbitrary IP address. There is a year old issue in the author's repo around updating the plugin to use a V4 API. Perhaps your device is using that and is incompatible with the plugin?

You might have better luck filing an issue on the author's repo around this, but we can see if @Iamrodos might weigh in on this thread also. Sorry, but I don't know that we can be of much help beyond that.

@sprak3000 sprak3000 added the ruby label Sep 18, 2023
@Iamrodos
Copy link

Hi. The script should work as it’s accessing the local device and not the cloud. It was the cloud that changed API. I should close that issue.

However that does not resolve your error. Do you have any other error messages? What do you get if you run the script from the command line directly?

@pmjohara
Copy link
Author

pmjohara commented Sep 19, 2023

hi @Iamrodos
I have moved beyond the API issue and now I am getting the following Error below;

⚠️ Error| size=12

Error on http request. Response: Moved Permanently_

@Iamrodos
Copy link

One of the requests is responding that it has moved. What version of Envoy firmware do you have?

If you take out the line starting with begin and the lines from residue to the end, what error message do you get? That might indicate which call is returning something different. I am not near my system so I can't run and test at the moment.

@pmjohara
Copy link
Author

Here is the s/w version details;
Software VersionD7.6.172 (94a00d)
Software Build Date05 May, 2023 7:33 AM

@pmjohara
Copy link
Author

@Iamrodos Latest version of Enphase Envoy requires access token to use API.
(https://enphase.com/download/iq-gateway-access-using-local-apis-or-local-ui-token-based-authentication-tech-brief)

I am wondering whether that has something to do with the issue

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

No branches or pull requests

3 participants