Interesting finding, thanks. So the VSN700 doesn’t challenge at connect, that means it requires “Preemptive Authentication”, will modify the code accordingly.
Two things:
on the VSN300 there’s a GUEST user who is read-only (no password). Is there anything like that onVSN700? If so, I could use that without requiring users to input user/password.
Can you please test these two URLs and post the result? Thanks.
Hi Alex, both URL are available also on my logger, I can’t’ post the log but the download was succesful.
As per the default account my Inverter/Logger doesn’t have the Guest account, my system have a “Utente” account originally without password, don’t know if it comes from the factory fw or if it was created by my installer during set-up.
I’d need the output of all available URLs to check the format and what data is available since I need to map it inside the component. When you can, if you can provide the raw output of all 3 urls It would be really helpful.
Yes the VSN300 has a default read-only account without password, can you check if UTENTE on the VSN700 has read rights by using that one with no password? Strange that the user name is in italian.
Also, I finished implementing the Preemptive Basic Authentication handler, and I’m using /v1/livedata as URL for the VSN700 right now, could you test last version and report back if auth is working finally and if data is coming back? Thanks.
[VSNX00]
# vsnmodel: VSN300 or VSN700
# hostname: hostname/IP of the VSN datalogger
# username: guest or admin
# password: if user is admin, set the password
vsnmodel = VSN700
host = 192.168.1.102
#host = cb4ef93b-9322-4bcd-bb65-95c236569503.mock.pstmn.io
username = Utente
password =
#password = vsn700
and the result is:
python vsnx00-monitor.py
Traceback (most recent call last):
File "/home/oper/IOT/vsnx00-monitor/vsnx00-monitor.py", line 377, in <module>
print(main())
File "/home/oper/IOT/vsnx00-monitor/vsnx00-monitor.py", line 364, in main
vsnx00_data = func_get_vsnx00_data(config)
File "/home/oper/IOT/vsnx00-monitor/vsnx00-monitor.py", line 250, in func_get_vsnx00_data
return_data = pv_meter.get_vsn700_live_data()
File "/home/oper/IOT/vsnx00-monitor/vsnx00-monitor.py", line 161, in get_vsn700_live_data
if not self.sys_data['device.invID']['Value']:
KeyError: 'device.invID'
Seems like auth was successful, but there’s a problem with the returned data. I changed the url from /v1/livedata to /v1/status (line 166), try with this one. You can also try to modify with /v1/feeds later.
I’m not a developer but it seems the code doesn’t interpret the data as a json object but as a string, could you modify the code to dump the raw data it gets from the URL?
Not a dev either since more than 20y (last time I worked as a developer, Python didn’t even exist), but I like to tinker and make things work.
Jokes apart, I found the bug: it was not related to the JSON data, it was the basic authentication stuff, I wasn’t encoding/decoding the user:pw when adding the header.
So now for the VSN700 since I don’t have the whole dataset, I’m dumping everything raw without parsing, exactly like you do with wget/curl. At line 160 you see I’m using /v1/status, you can modify it /v1/livedata or /v1/feeds so we can see the different data sets.
Last thing: I modified the config file, now you need to enter the URL to the logger, including prefix HTTP/HTTPS. Had to do it because the mock server works only via https.
Ciao Alex, credo tu sia italiano quindi ti scrivo in italiano.
Ho un UNO-DM-3.0-TL-PLUS ma non riesco a capire che valori per
Modbus slave addr
Modbus Register …
ho fatto svariate prove ma non riesco ad avere una configurazione valida per ottenere le varie entità.
grazie 1000
Pietro