Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zigbee-network map #252

Closed
kirovilya opened this issue Aug 6, 2018 · 92 comments
Closed

Zigbee-network map #252

kirovilya opened this issue Aug 6, 2018 · 92 comments
Labels
feature request Feature request stale Stale issues

Comments

@kirovilya
Copy link
Contributor

For my application, I began to make feature to display the network map. It shows the connections between devices and nodes, as well as the quality of link.
image
I use the ZShepherd.prototype.lqiScan (thanks to @splitice and HalleyAssist fork) function that collects this info.
https://github.com/kirovilya/zigbee-shepherd/blob/dev/lib/shepherd.js#L417

But it does not always work correctly and some devices are not included in the map. Until I figured out why and how to fix it. :(

Another possibility is to start the pairing process on a separate router, rather than in the entire network. To do this, you need to send the NWK-address of the device to permitJoin function.

https://github.com/kirovilya/zigbee-shepherd/blob/dev/lib/components/controller.js#L338

@clockbrain
Copy link
Contributor

Good plan! I'd also be keen to see some device mapping info available via MQTT which could potentially be rendered by e.g. HA.

I got a map of my small network using the method from here https://community.smartthings.com/t/faq-mapping-your-zigbee-network-with-digis-xctu/28477/55. I could do this because I had a Digi XU-Z11 XStick laying around from when I had previously hoped it would work with HA. Here's the map it shows of my zigbee2mqtt network.
image

The XU-Z11 is the R in the top left. The CC2531 is the C. Note that it shows true mesh links and did pick up all my devices. Not suggesting that an XU-Z11 should be required, this is just an example of the level of detail that would be useful in a map. Does the lqi function report the mesh or just shortest path?

@kirovilya
Copy link
Contributor Author

@clockbrain In contrast to Digi XU-Z11, this map can be obtained from coordinator and sent by mqtt to HA.

@splitice
Copy link

splitice commented Aug 6, 2018

@kirovilya If the problem is on our end PR's are welcome.

I suspect however that the device may not be LQI robust (sometimes ignoring them or similar). Currently the LQI scan is lazy (it's intensive enough without repeats) but I would welcome any well thought out patch for robustness in any area of our forks.

@kirovilya
Copy link
Contributor Author

@splitice yes of course! thank you!

@kirovilya
Copy link
Contributor Author

@splitice I found one error in your code :) https://github.com/HalleyAssist/zigbee-shepherd/blob/master/lib/shepherd.js#L426 - you has not return result in chain function, in compare with my version https://github.com/kirovilya/zigbee-shepherd/blob/dev/lib/shepherd.js#L433

@splitice
Copy link

splitice commented Aug 6, 2018

Thanks, Nice find, looks like you are correct. I'll patch that in the morning

@kirovilya
Copy link
Contributor Author

I added more devices with 2 router. Some end-devices join to first router, some devices to second, and one to coordinator.
image

@Koenkk
Copy link
Owner

Koenkk commented Aug 7, 2018

This looks really great!

@Koenkk Koenkk added the feature request Feature request label Aug 7, 2018
@tb-killa
Copy link
Contributor

tb-killa commented Aug 7, 2018

@Koenkk what about provide json array with map Informations as mqtt topic?

@Koenkk
Copy link
Owner

Koenkk commented Aug 7, 2018

@tb-killa I think we need a separate topic for this.

Also it would be nice if we somehow could provide a rendered graph to home assistant (e.g. via an http jpeg endpoint) which can be used with https://www.home-assistant.io/components/camera.generic/

@kirovilya
Copy link
Contributor Author

I used the visjs to draw a graph.

@tb-killa
Copy link
Contributor

tb-killa commented Aug 7, 2018

Yes New topic sounds right. Some Javascript map to jpeg could be work.
But if we would provide the source of map data via mqtt json i think it would be the best if the thirdparty application would generate this.
As your example we could provide some sort of docker who use our input and generate the jpeg Web.
I think we should Show that zigbee2mqtt is cleaner and doesnt overloaded :)

@tb-killa
Copy link
Contributor

tb-killa commented Aug 7, 2018

With visjs we could export as png... Does this is okay or have it to be jpeg?

https://stackoverflow.com/questions/42663203/export-visjs-network-to-jpeg-png-image

@kirovilya
Copy link
Contributor Author

I think that the rendering of the image should not be on the side of the Zigbee2mqtt

@tb-killa
Copy link
Contributor

tb-killa commented Aug 8, 2018

@kirovilya would you be willing to submit your networkmap code as pr so we can continue with the editing?

@kirovilya
Copy link
Contributor Author

@tb-killa ok. later, in evening

@Baseje
Copy link

Baseje commented Aug 8, 2018

Would be nice to create an Hassio plugin for installing this!
Really interested in this tools!

@kirovilya
Copy link
Contributor Author

Example for PR Koenkk/zigbee-shepherd#3 :

shepherd.lqiScan().then((result)=>{
     debug('lqiScan result: ', result);
});

@kirovilya
Copy link
Contributor Author

Permit join through router:

const router = shepherd._findDevByAddr(routerIeeeAddr);
const permitDev = router.nwkAddr;
shepherd.permitJoin(permitTime ? permitTime : 0, permitDev, (error) => {});

@kirovilya
Copy link
Contributor Author

then tests are needed for the max number of connected devices.
eg: 10 devices on the coordinator + 2 routers + 10 devices on the router1 and 10 devices on the router2

I have not so much :)

@splitice
Copy link

splitice commented Aug 8, 2018

Please do pr any tests you write :)

@tb-killa
Copy link
Contributor

tb-killa commented Aug 9, 2018

@kirovilya doesnt we could use lqi Infos from #173??

Koenkk added a commit that referenced this issue Aug 9, 2018
@kirovilya
Copy link
Contributor Author

@tb-killa yes we can, but in liqScan it also exist :)

@tb-killa
Copy link
Contributor

@Koenkk what about building new timer or use pollTimer and return output of shepherd.lqiScan() on mqtt topic like networkmap or another name.

If we got this i could work on building some sort of docker image for mqtt to png or mqtt to dot to jpeg as webstream.

Koenkk added a commit that referenced this issue Aug 13, 2018
Koenkk added a commit that referenced this issue Aug 13, 2018
@ptvoinfo
Copy link
Contributor

ptvoinfo commented Sep 28, 2018

@luci-11 I've implemented this in the latest firmware. You need to do this only once (after flashing).

@luci-11
Copy link

luci-11 commented Sep 28, 2018

@ptvoinfo great news! I will flash it too tonight (I'm also very interested in testing the trasmission power increase)

@ptvoinfo
Copy link
Contributor

@luci-11 please, note, transmission power increase is only related to cc2530+cc2591.

@luci-11
Copy link

luci-11 commented Sep 28, 2018

@ptvoinfo ah right, i didn't read it correcty :( but i'll flash anyway

@lolorc
Copy link
Contributor

lolorc commented Sep 28, 2018

@luci-11 the green light is now on by default, and I get the slow blinking of the red led.
It's probably an issue with the network map feature, it's in its early stage, if you look at the relations between coordinators and router, on the graph only one of them gets a 2 way communication (cc2531_1 <=> prise_03 on my last graph)

cmd I use to create the graph is:

mosquitto_sub -h $MQTT_SRV -C 1 -t zigbee2mqtt/bridge/networkmap/graphviz | sfdp -Tpng | display -

and

mosquitto_pub -h $MQTT_SRV -t zigbee2mqtt/bridge/networkmap -m graphviz

to trigger it

@lolorc
Copy link
Contributor

lolorc commented Oct 2, 2018

is the networkmap feature still working for you with latest dev branch ?
looking at the logs it looks like it does the scan, but doesn't display anything.

oh I guess I know why... issue with latest commit regarding friendly_name and networkmap

@lolorc
Copy link
Contributor

lolorc commented Oct 5, 2018

I've proposed #443
a regression has been introduced in 4180bd8, see #417 (comment)

@jarrah31
Copy link

jarrah31 commented Oct 9, 2018

@ptvoinfo is this firmware for CC2531 both router and coordinator?
http://ptvo.info/wp-content/uploads/2018/09/cc2531_1.2.2a.44539_firmware.zip

If just router, where can I find the latest coordinator firmware please?

Also, if I update the firmware, will I need to re-pair my Xiaomi sensors (not a problem, but just so I know).

I'm looking forward to trying out the new mapping features. :)

@ptvoinfo
Copy link
Contributor

@JAAPS There is a firmware for a router.

@mark078
Copy link

mark078 commented Oct 23, 2018

Can someone briefly explain to me how I update to the dev branch? I'd like to try the network, too...

Update

git checkout HEAD -- npm-shrinkwrap.json
git pull
rm -rf node_modules
npm install

@Koenkk
Copy link
Owner

Koenkk commented Oct 23, 2018

@mark078 you don't need the dev branch for that, all the functionality is in zigbee2mqtt 0.1.8

@mark078
Copy link

mark078 commented Oct 23, 2018

@Koenkk thank you, I tried it again and it worked, realy nice! :)

@stale
Copy link

stale bot commented Dec 22, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Stale issues label Dec 22, 2018
@stale stale bot closed this as completed Dec 29, 2018
@xmace
Copy link

xmace commented Jan 14, 2019

20190114_151937

I'm still having issues on that:

@makuser
Copy link

makuser commented Jan 17, 2019

@xmace @kirovilya how did you create this type of map? Is it a function of iobroker, of zigbee2mqtt or one of its dependencies, or an independent module?

@orientalsniper
Copy link

orientalsniper commented Jan 17, 2019

It's been said before: #252 (comment)
Send MQTT payload "graphviz" to zigbee2mqtt/bridge/networkmap
Copy/paste the generated data to http://www.webgraphviz.com/

EDIT: MY BAD, you meant with the icons.

@makuser
Copy link

makuser commented Jan 18, 2019

EDIT: MY BAD, you meant with the icons.

exactly. I already got the graphviz map.

@jerrychong25
Copy link

For my application, I began to make feature to display the network map. It shows the connections between devices and nodes, as well as the quality of link.
image
I use the ZShepherd.prototype.lqiScan (thanks to @splitice and HalleyAssist fork) function that collects this info.
https://github.com/kirovilya/zigbee-shepherd/blob/dev/lib/shepherd.js#L417

But it does not always work correctly and some devices are not included in the map. Until I figured out why and how to fix it. :(

Another possibility is to start the pairing process on a separate router, rather than in the entire network. To do this, you need to send the NWK-address of the device to permitJoin function.

https://github.com/kirovilya/zigbee-shepherd/blob/dev/lib/components/controller.js#L338

Hi,

Your ZigBee network map looks cool!

Do you mind to share how to display this network map?

As I have no idea how to display even though I have installed Zigbee2mqtt add on.

wilmardo pushed a commit to wilmardo/zigbee2mqtt that referenced this issue Sep 26, 2019
wilmardo pushed a commit to wilmardo/zigbee2mqtt that referenced this issue Sep 26, 2019
wilmardo pushed a commit to wilmardo/zigbee2mqtt that referenced this issue Sep 26, 2019
wilmardo pushed a commit to wilmardo/zigbee2mqtt that referenced this issue Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature request stale Stale issues
Projects
None yet
Development

No branches or pull requests