New binding Resol VBUS

Hi @yphyph01,

I tested accessing the corresponding URL on my KM2 using a browser and the “resol-vbus-java” library @ramack uses in this bindings. Both requests worked mine with my KM2, so I assume it has something to do with your KM2.

“Bad Gateway” sounds like the CGI executable that should handle the request crashes without having generated the requested information…

I’m currently running a modified firmware version 1.1.1 on mine. What version does your device run on? Have you tried to restart the KM2 yet? If not and you are willing to do that, it would be helpful to create a support report before pulling the power supply. You can generate that report on the “Status” page if you have the “Expert mode” enabled under “Configuration > General”.

If the problem persists after the restart (and optionally a firmware update if you like and your device is not already on 1.1.1) we might have to dig deeper using the SSH server on the KM2 (calling the CGI manually perhaps, …)

Thanks in advance,
Daniel

Hi @dwippermann,
thank you for your reply.
“a modified firmware version …” what do you mean?
I’m running the latest version, 1.1.1 … standard one :wink:
At will look at my config, thanks for your input. I’ll let you konw if I can find something with the CGI interface.
Regards

Hi @dwippermann,
How could I connect in SSH to the KM2 module?
what are the user / pass?

Hi @yphyph01,

How could I connect in SSH to the KM2 module?
what are the user / pass?

I answered that one on the other thread and simply copy it here for reference:

log into the web interface of your KM2 and click on the “Configuration / General” link in the sidebar. The URL in your browser’s address bar should be something like http://x.x.x.x/#/config/general . Please change the “general” part to “ssh” to from a URL like http://x.x.x.x/#/config/ssh .

On the corresponding web interface page you can enable the SSH service and change the password. The username is hard-coded to “root”. The factory default for the password is printed on the sticker on the back of the KM2 and the back of its user manual.

Then use your favorite SSH client to connect to it. It basically a OpenWRT system extended with some RESOL tools and scripts.

“a modified firmware version …” what do you mean?

I took the sources that come with the KM2, added some things to it, recompiled the firmware and installed it manually on the KM2 using SSH since the update over the web interface only accepts digitally signed firmware images from RESOL.

At will look at my config, thanks for your input. I’ll let you konw if I can find something with the CGI interface.

The CGI is located under /www/cgi-bin/get_resol_device_information. It is a LUA script that reads the device info from /var/run/resol/get_resol_device_information.txt and prepends HTTP headers to make it “valid” CGI output.

Perhaps running the command manually or looking for the text file it reads yields information on why your CGI does not work.

Best regards,
Daniel

Hi @dwippermann,
Thank you for your support and answer … SSH connection is successfull :wink:
Indeed, the CGI script is simple … reading the “/var/run/resol/get_resol_device_information.txt”
and, of course, this file doesn’t exist on my KM2.
the folder /var/run/resol contains only 2 files: current_packets.vbus & openvpn.pid

Do I miss something? Any idea / suggestion?
Regards
Yann

Hi @yphyph01,

the file should have been created at boot-up during the /etc/init.d/resol-bootsetup script. Try running the command responsible for it manually:

resol-worker --bootSetup -vvvv

Perhaps it prints an error that helps us find the reason…

Best regards,
Daniel

Hi @dwippermann,

you’re right … I found the following error:

root@KM2-A8404118FB27:/# resol-worker --bootSetup -vvvv
======== ERROR ========
File: /home/vagrant/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/resol-vbusconnect-tools-1.1.1/common/rs-licenses.c:221
Func: __CheckAndParseContents
Category: App
Message: Unexpected CBOR item 4 type
[DEBUG] worker-defaults.c:692 Package = 0x6da618
[DEBUG] worker-defaults.c:753 Changes = 0
[DEBUG] worker-wifi-sta.c:98 Setting up WiFi STA
[DEBUG] worker-wifi-sta.c:145 Enabled = 0
[DEBUG] worker-wifi-sta.c:159 AutoJoin = 0
[DEBUG] worker-wifi-sta.c:171 Ssid =
[DEBUG] worker-wifi-sta.c:181 Encryption =
[DEBUG] worker-wifi-sta.c:191 Key =
[DEBUG] worker-wifi-sta.c:205 Package = 0x6db640, Section = (nil)
======== ERROR ========
File: /home/vagrant/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/resol-vbusconnect-tools-1.1.1/worker/worker-wan.c:121
Func: __SetupWan
Category: App
Message: Unable to lookup ipaddr

Strange, something the the ip adress? I’m with a fix IP adress … do you think it could be the reason?

Hi @yphyph01,

yeah, might be… The worker searches for an entry “resol.wan.ipaddr” in the UCI database. Try executing uci show resol.wan.ipaddr or uci show resol.wan to see what the entry contains.

If it says uci: Entry not found that would explain the error you see. That would be obviously a bug that has avoided QA up to now… :confused:

Best regards,
Daniel

@dwippermann
YES, that’s it !!
I’ve removed the fix IP adress, connect with DHCP and the CGI-BIN is working :smiley:
thank you for precious help an deep knowledge of the module … are you part of the development team?
Now, I’m going back to the Resol Binding config :wink:
Regards
Yann

Yes, Yes, Yes … a new thing found :+1:

Hi @yphyph01,

thanks for your patience, I’ll file a ticket for that error… Have you used the static IP for the LAN or WiFi connection?

And yes, I am part of the development team of that product… And most likely the “author” of that bug. Sorry about that :slight_smile:

Best regards,
Daniel

Hi @dwippermann,
:wink: A chance you’re part of the openhab community :slight_smile: working the week-end !!!

The static IP is for the LAN connection
Regards
Yann

Hi @ramack, @dwippermann,
First of all, thank you for your work and support. This binding is working with my KW2 device :slight_smile:
@ramack you can update the documentation :wink:

I’ve got an additional question: What is the best way to refresh the data on a 5min basis? Could we change the data refresh frequency?
In my configuration, I don’t need a real time vbus interface. Only one request each 5 minutes would be enough :wink:
Any suggestions?
Regards
Yann

Great to hear. Thanks for reporting success. And a big THANKs for RESOL and @dwippermann for the great community support you give!

For the the refreshing: I am not an openhab expert, but I would say that this is a general openhab topic. My understanding is, that openhab should just know every update and in case you want to filter it is only important for persistence, because it doesn’t make sense to flood a database with jitters of the LSB every few second…

Hi I need some advice setting this up with Openhab. I have a SKSC2 which I guess is a rebranded Resol controller. I’ve seen there are both serial and Lan adapters which I can connect. The serial is much cheaper so can I use this with your binding? Thanks

To current state the binding only supports vbus interfaces with network connection but no serial one. In theory there is the option to even use an ESP32 or similar device to do an own VBUS-LAN interface, but from the available devices from Resol the VBUS/LAN interface for a bit more than 100€ is probably the cheapest you can get. a KM2 would also do, but as it has more features it is more expensive, but depending on your network topology it might be interesting to have a WLAN interface…

Thanks…I’ll buy a Lan adapter.

Hi @ramack,
I’m sucessfully using your binding for some time now. I wanted to manipulate items related to your binding (collector temperature) but even a simple http update does not change items…

Do you have any idea why or how your binding locks items so its not possible to change them like any other number items…I’m confused as this works with all items except your binding-linked ones.

e.g. this does nto work:http://192.168.1.11:8080/classicui/CMD?CollectorTemp=29.9

Thanks a lot Norbert

Hi,
sorry for the late response. I wanted to quickly browser through the code and the used channel types are marked as readOnly in the thing_types.xml of the binding. But anyhow, why should you change the collector temperatur of the channels from a resol-thing? In case you want a derived value that is sometimes the collector temperature something something else, maybe a new thing and some rules is the more appropriate way over trying to change a measured value…

In the long run I’d like to support also setting some values either for controllers which are parameterizable via vbus or even to emulate an EM module on the bus feeding it with data from openhab. In that case for sure the channels have to be write-enabled.

Regards,
Rapha

ah OK. was not into too many details about things/items. So there exist read-only…which declares why i was not able to write into items.

The reason for me to manually set values for CollectorTemp is that RESOL is OFFLINE during night…power saving…but the binding does not reset to UNDEF if the hardware is unavailable but leaves the last sent temperature all night long in the system…so for me it was better to see an UNDEF instead of a temperature which makes me uncertain if RESOL is still online or my smart home did not turn off the solar heating…

There is a binding called EXPIRE which puts e.g. UNDEF in case the controller of RESOL is unavailable…but this does not work with “your” items as they are read-only.

Regards, Norbert
(without my scenario, leaving them read-only would definitely make sense as there would not be a reason to manipulate from outside the system)