matryer / xbar-plugins

Plugin repository for xbar (the BitBar reboot)
https://xbarapp.com
2.44k stars 1.04k forks source link

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

Open pmjohara opened 1 year ago

pmjohara commented 1 year ago

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

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

sprak3000 commented 12 months ago

@pmjohara

Which script are you trying to run?

pmjohara commented 12 months ago

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

sprak3000 commented 12 months ago

@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.

Iamrodos commented 12 months ago

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 commented 12 months ago

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_

Iamrodos commented 12 months ago

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 commented 11 months ago

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

pmjohara commented 11 months ago

@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