Comments (3)
I too am running into this issue.
I thought it might be because of the multihome raspberry pi that I am running it on, and the dns lookup was going the default route (I don't think sunpowerconsole.com is resolvable over the internet), so I used the parameter --hostname and passed in 172.27.153.1, and I still get the same issue.
Like @kskenyon the commands all work fine using curl.
from sunpower-pvs-exporter.
I found there is a way to force the python app to connect to the right interface, following information I found here:
https://stackoverflow.com/questions/28773033/python-requests-how-to-bind-to-different-source-ip-for-each-request
In exporter.py
I added two lines as shown below. Note, however, the IP address needs to match the IP address that it received from the PVS unit. It could change, so, this patch is a hack to get it working.
def __init__(self,
# hostname="sunpowerconsole.com",
hostname="172.27.153.1",
port=80,
scheme="http",
timeout=(5, 5),
use_device_data_timestamp=False,
):
self.session = requests.Session()
# The following two lines force the URL binding to happen on the PVS interface
new_source = source.SourceAddressAdapter("172.27.153.156")
self.session.mount('http://', new_source)
self.use_device_data_timestamp = use_device_data_timestamp
self.timeout = timeout
self.url = "{scheme}://{hostname}:{port}/cgi-bin/dl_cgi".format(
scheme=scheme,
hostname=hostname,
port=port
)
from sunpower-pvs-exporter.
If you make the change I suggested above, make sure that you first install the python library
pip install requests_toolbelt
and also add at the top of the exporter.py file:
from requests_toolbelt.adapters import source
otherwise it will fail to run because 'source' is not defined.
from sunpower-pvs-exporter.
Related Issues (13)
- Thanks for this. HOT 2
- Grafana configs HOT 6
- Exceptions When Running sunpower-pvs-exporter (but I can still get stats from curl localhost:9110) HOT 1
- Can't connect Grafana/Prometus and sun app HOT 5
- Docker support HOT 6
- Update pypi?
- Coomand DeviceDetails not working HOT 5
- Triggering CPU/session/memory leak on recent PVS6 firmware releases HOT 8
- Field missing `p_mpptsum_kw` (2021.11 Build 60203) HOT 4
- I get only: "result": "no command" HOT 2
- DC Power reported as NaN from Inverters HOT 1
- Not finding IP4 address with Sunpower DNS. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sunpower-pvs-exporter.