rob121 / broadlinkgo

Broadlink golang http server
MIT License
35 stars 25 forks source link

Support Binding to Specific Host interface address and RM3 Mini (RM4 Update) #17

Open snova69 opened 2 years ago

snova69 commented 2 years ago

Rob,

Thanks for creating this package. It seems very useful.

I'm running broadlinkgo in a KVM Linux host guest running Ubuntu 20.04. I have multiple host interfaces provided by KVM. By default broadlinkgo, opens a listenPort on 0.0.0.0. This doesn't seem to work for me.

If I hard code in "my.host.ip.addr:" instead of "" into the TWO ListenPort call in the v1.09 codebase then discovery works. Could we add support for flag providing a specific host interface IP for binding instead of listening on 0.0.0.0?

Anyhow, after I worked around that issue v1.09, it was complaining about not knowing what the new RM3 mini model number. Which looks to me a prior reported issue in the ISSUES. So I added that to knowndevices.go. It worked and discovered it fine, but I could not learn IR from my newer RM3 mini. Looking at the RM4 Update branch, I see that perhaps these new devices use a different kind of protocol header exchange. OK, so I checked out the RM4 Update branch and try to same hard coded host interface modification to the now THREE ListenPort calls. Sadly, discovery fails and I can not add these devices via the --mode manual either.

Rob, Do you have any suggestions on how to make this work with the new RM3 Mini using a Ubuntu 20.04 host? I'd like to have it work inside Ubuntu 20.04 KVM guest with multiple interfaces. However, if you have a path less resistance recommendation, I'm all ears. I don't know what requirements are to compile from the v2.0 tag and newer tags, but Ubuntu 20.04 doesn't seem to have it ( i.e go net.embed package) isn't included in the go lang package in the 20.04 distro. TIA

btw, I was able to get broadlinkmanager working from within a docker release, but had a similiar issues with picking the right network interface from the multi interface KVM guest. That works now, so I know my setup can work inside a multi interface KVM guest.