Coder Social home page Coder Social logo

Comments (7)

frankjoke avatar frankjoke commented on July 18, 2024

Can you provide a debug log (setting adapter to debug and copy the log it generates when starting and when you try to learn)? I cannot say anything without knowing what adapter sees or not!

from iobroker.broadlink2.

merlin-tc avatar merlin-tc commented on July 18, 2024

Hi Frank,
this is all the log output I get:

2019-03-09 19:59:20.306 - info: host.liao instance system.adapter.broadlink2.0 started with pid 25769
2019-03-09 19:59:21.705 - debug: broadlink2.0 objectDB connected
2019-03-09 19:59:21.765 - debug: broadlink2.0 statesDB connected
2019-03-09 19:59:21.805 - info: broadlink2.0 starting. Version 1.9.1 in /opt/iobroker/node_modules/iobroker.broadlink2, node: v8.12.0
2019-03-09 19:59:21.856 - debug: broadlink2.0 Adapter broadlink2.0 starting.
2019-03-09 19:59:23.382 - debug: broadlink2.0 broadlink2 received 1677 objects with config ip,scenes,switches,poll,lang,latitude,longitude
2019-03-09 19:59:23.389 - info: broadlink2.0 Discover UDP devices for 10sec on broadlink2.0
2019-03-09 19:59:23.390 - debug: broadlink2.0 Config IP-Address end to remove: .fritz.box
2019-03-09 19:59:23.405 - silly: broadlink2.0 inMem message broadlink2.0.* broadlink2.0.Scenes.Fernsehen name=Scenes.Fernsehen, read=true, write=true, state=state, role=button, type=boolean, type=state, _id=broadlink2.0.Scenes.Fernsehen, scene=FernseherAn, FernsehLichtAn, 500, TVWZKanal=12, from=system.adapter.broadlink2.0, user=system.user.admin, ts=1552157963394, object=1636, state=1636, owner=system.user.admin, ownerGroup=system.group.administrator
2019-03-09 19:59:23.543 - silly: broadlink2.0 inMem message broadlink2.0.* broadlink2.0._NewDeviceScan name=_NewDeviceScan, read=true, write=true, state=state, role=button, type=boolean, type=state, _id=broadlink2.0._NewDeviceScan, from=system.adapter.broadlink2.0, user=system.user.admin, ts=1552157963521, object=1636, state=1636, owner=system.user.admin, ownerGroup=system.group.administrator
2019-03-09 19:59:23.578 - debug: broadlink2.0 Change _NewDeviceScan to true with ack: true
2019-03-09 19:59:23.586 - silly: broadlink2.0 inMem message broadlink2.0.* broadlink2.0._NewDeviceScan val=true, ack=true, ts=1552157963583, q=0, from=system.adapter.broadlink2.0, user=system.user.admin, lc=1552157963583
2019-03-09 19:59:28.598 - debug: broadlink2.0 Change _NewDeviceScan to false with ack: true
2019-03-09 19:59:28.604 - silly: broadlink2.0 inMem message broadlink2.0.* broadlink2.0._NewDeviceScan val=false, ack=true, ts=1552157968601, q=0, from=system.adapter.broadlink2.0, user=system.user.admin, lc=1552157968601
2019-03-09 19:59:28.627 - silly: broadlink2.0 inMem message broadlink2.0.* broadlink2.0.States.Steckdose_A name=Steckdose_A, read=true, write=true, state=state, role=level, type=number, min=0, max=0, states=0:Steckdose_A_Ein, type=state, _id=broadlink2.0.States.Steckdose_A, id=States.Steckdose_A, name=Steckdose_A, on=[Steckdose_A_Ein], off=null, mult=false, from=system.adapter.broadlink2.0, user=system.user.admin, ts=1552157968620, object=1636, state=1636, owner=system.user.admin, ownerGroup=system.group.administrator
2019-03-09 19:59:28.689 - silly: broadlink2.0 inMem message broadlink2.0.* broadlink2.0.States.Lüfter_A name=Lüfter_A, read=true, write=true, state=state, role=level, type=number, min=0, max=2, states=0:Lüfter_A_Aus;1:Lüfter_A_Mittel;2:Lüfter_A_Stark, type=state, _id=broadlink2.0.States.Lüfter_A, id=States.Lüfter_A, name=Lüfter_A, on=[Lüfter_A_Aus, Lüfter_A_Mittel, Lüfter_A_Stark], off=null, mult=false, from=system.adapter.broadlink2.0, user=system.user.admin, ts=1552157968635, object=1636, state=1636, owner=system.user.admin, ownerGroup=system.group.administrator
2019-03-09 19:59:28.735 - silly: broadlink2.0 inMem message broadlink2.0.* broadlink2.0.States.TVWZKanal name=TVWZKanal, read=true, write=true, state=state, role=level, type=number, min=0, max=9999, states=null, type=state, _id=broadlink2.0.States.TVWZKanal, id=States.TVWZKanal, name=TVWZKanal, on=[TVWZK0, TVWZK1, TVWZK2, TVWZK3, TVWZK4, TVWZK5, TVWZK6, TVWZK7, TVWZK8, TVWZK9], off=null, mult=true, from=system.adapter.broadlink2.0, user=system.user.admin, ts=1552157968704, object=1636, state=1636, owner=system.user.admin, ownerGroup=system.group.administrator
2019-03-09 19:59:28.784 - debug: broadlink2.0 Adapter has 6 old states!
2019-03-09 19:59:28.803 - silly: broadlink2.0 inMem message broadlink2.0.* broadlink2.0.SendScene name=SendScene, read=true, write=true, state=state, role=text, type=string, type=state, _id=broadlink2.0.SendScene, from=system.adapter.broadlink2.0, user=system.user.admin, ts=1552157968789, object=1636, state=1636, owner=system.user.admin, ownerGroup=system.group.administrator
2019-03-09 19:59:28.821 - debug: broadlink2.0 Poll every 30 secods.
2019-03-09 19:59:28.822 - info: broadlink2.0 Adapter broadlink2.0 started and found 0 devices named ''.
2019-03-09 20:02:01.305 - silly: broadlink2.0 inMem message broadlink2.0.* broadlink2.0._NewDeviceScan val=true, ack=false, ts=1552158121300, q=0, from=system.adapter.web.0, user=system.user.admin, lc=1552158121300
2019-03-09 20:02:01.308 - debug: broadlink2.0 stateChange called for broadlink2.0._NewDeviceScan = { val: true, ack: false, ts: 1552158121300, q: 0, from: 'system.adapter.web.0', user: 'system.user.admin', lc: 1552158121300 }
2019-03-09 20:02:01.316 - debug: broadlink2.0 Change _NewDeviceScan to true with ack: true
2019-03-09 20:02:01.322 - silly: broadlink2.0 inMem message broadlink2.0.* broadlink2.0._NewDeviceScan val=true, ack=true, ts=1552158121318, q=0, from=system.adapter.broadlink2.0, user=system.user.admin, lc=1552158121300
2019-03-09 20:02:06.331 - debug: broadlink2.0 Change _NewDeviceScan to false with ack: true
2019-03-09 20:02:06.336 - silly: broadlink2.0 inMem message broadlink2.0.* broadlink2.0._NewDeviceScan val=false, ack=true, ts=1552158126332, q=0, from=system.adapter.broadlink2.0, user=system.user.admin, lc=1552158126332

Any further help I can provide to debug it?

from iobroker.broadlink2.

frankjoke avatar frankjoke commented on July 18, 2024

Merlin, what I see is that the adapter does not find ANY broadlink device!
Weder bei Adapter-Start noch bei nachträglichen device-scan!
Ups, in English: Neither on Adapter start nor on device scan I can see any adapter answering the network broadcast.
Can it be that the computer on which iobroker runs is in a different network than the W-Lan where the RM-Pro is connected to?

For example if you have a fritz-box with wlan and a guest w-lan and you have the iobroker running on normal Lan and the RM on guest wlan then it will not work!

If this is the case then you would need to attach a W-Lan to the iobroker-computer and connect it to the same w-lan the RM is connected to.

The Adapter send an UDP message to all addresses on the same network and waits then for ~5 seconds if somebody answers (which the RM should).

p.s.: The mobile app works via cloud and not directly with the device! The only thing which it does with device is to brin it into the W-Lan, but from there the device connects with cloud and the app works also with cloud! Iobroker is not using the cloud and therefore needs direct access to the device.

from iobroker.broadlink2.

merlin-tc avatar merlin-tc commented on July 18, 2024

Hi Frank,

we could write in German as well, up to you :)
It's on the same network as my as the box running iobroker. It's a linux box which also acts as DHCP server for the whole network segment.
The dhcp name suggested by the box is "RMPROPLUS" and then some part of it's mac address.

The app seems only uses the cloud when when it's not on the same wifi I think.
I turned my TV on and off with it and had tcpdump running on my router and I can see occasional communication with the amazon cloud BUT not when I turn the TV on and off.
So that traffic must be transmittet via the local network.

Does the adapter send UDP messages to all addresses on the subnet or just these discovered by the ping module of iobroker?

Is there any way I can try to "communicate" outside iobroker? There don't seem to be any open tcp ports I could toy with.

from iobroker.broadlink2.

frankjoke avatar frankjoke commented on July 18, 2024

The devices (I know) communicate with UDP messages with broadlink2 and the cloud, not with TCP!
The TCP is used only to get the server address to use with UDP.

Also the broadcast is an UDP-message where they answer with their mac address.

We had already new devices which connect via MQTT (via SSL) to cloud, in this case the broadlink2-Adapter cannot handle them.

from iobroker.broadlink2.

merlin-tc avatar merlin-tc commented on July 18, 2024

I was toying around with the file python-broadlink-master.zip file in your repo. Not sure why it's there but when I use broadlink_discovery it actually finds the device.

./broadlink_discovery 
discover
###########################################
RM2
# broadlink_cli --type 0x2712 --host 192.168.111.69 --mac 6d0f44770f78
Device file data (to be used with --device @filename in broadlink_cli) : 
0x2712 192.168.111.69 6d0f44770f78
temperature = 0.0

I can also see the request and reply in wireshark and I can see the device sends its own mac address in the reply.
So it's doing what you said it should be doing right?

from iobroker.broadlink2.

frankjoke avatar frankjoke commented on July 18, 2024

The python stuff is here because it's source was the original work on which the javascript version was based on.

I do the very same than the Python but did not ping that often, this is what I change in new version.

I currently work on a complete re-write (https://github.com/frankjoke/ioBroker.broadlink2/tree/V2Beta) which is a complete re-write and it pings on all possible interfaces multiple times to get better result to find the devices. I just work on the case when a device is known (IP known) and brought back when online again. Currently this is really early beta (called V1.9.9) of V2.0.0

from iobroker.broadlink2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.