xbar-plugins icon indicating copy to clipboard operation
xbar-plugins copied to clipboard

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

Open pmjohara opened this issue 2 years ago • 8 comments

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

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

pmjohara avatar Sep 14 '23 20:09 pmjohara

@pmjohara

Which script are you trying to run?

sprak3000 avatar Sep 18 '23 01:09 sprak3000

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

pmjohara avatar Sep 18 '23 06:09 pmjohara

@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 avatar Sep 18 '23 13:09 sprak3000

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?

Iamrodos avatar Sep 19 '23 00:09 Iamrodos

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

:warning: Error| size=12

Error on http request. Response: Moved Permanently_

pmjohara avatar Sep 19 '23 03:09 pmjohara

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.

Iamrodos avatar Sep 20 '23 00:09 Iamrodos

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

pmjohara avatar Sep 22 '23 03:09 pmjohara

@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

pmjohara avatar Sep 22 '23 03:09 pmjohara