Everything Xbee

I actually worked off the ST v2 presence driver. They do the same thing. I am not sure how often they send the Zigbee status though since I don't have a physical unit.
Keep in mind, the probability that you have to wait a full 60 seconds for presence detection is low. Since it is a timer, you will most likely be somewhere in the middle, like 20 - 40 seconds.

I chose the 60 seconds since I run the same code on my routers and I don't want to flood my Zigbee network.

I could put an option in the driver to configure the piece of SW that runs on the XBee to be able to adjust the timing.... I'll take a look at this when I have some time.

I have changed the timeout for the sleep in the micropython program to 15 seconds, so it sends a report every 15 seconds. However, I am also disabling the device via the driver because I am using my car's USB port to power the board. So it isn't on for very long when I am home and therefore won't jam up the traffic on my network.

I do have two questions though:

  1. Is there a way to force the board to use a specific repeater as it's router?
  2. Is there a way to force the board to keep the same network address? It seems that whenever I make any change to anything that the board gets a new network ID and I have to rejoin it to my zigbee network in HE.

Thanks!!

  1. no unfortunately easiest would be to power off all routers you do not want when you first add the Xbee or just keep retrying until it pairs though the desired router.
  2. no not that I have found I tried that with other devices in the past and I believe the router assigns network id only the mac address says the same.

what do you mean "I am also disabling the device via the driver" ?
I am disabling the device by turning of the car which powers off the car's usb port.

I thought even if the python code was adjusted the driver code would also have to be adjusted to be able to poll every (in you case 15 seconds) but I have not had a chance to really look at the driver code (not that I am very good at it but I understand the basics).

I have 4 Xbee3 three are routers and the 4th is an end device arrival sensor.
After running a scan in XTCU I noticed the end device was connected to one of my router Xbee3 connected to my computer not the window Xbee3 router.
So I powered off my computer Xbee3 routers and only left the Window Xbee3 router on. Then started my car and the Xbee3 end device became present.
I powered my computer Xbee3 router back on and re-scanned my network and as expected the Xbee3 end device was routing through my window Xbee3 router.
As a final test with all my Xbee3 stilled powered on I turned off my car and let the Xbee3 end device go departed then restarted my car and the Xbee3 end device became present again.
I then recanned my network and the Xbee3 end device had changed Xbee3 routers again.
So unlike Xiaomi devices which stay locked to initial pairing routers.
The Xbee3 route through the first router linked to your hub it sees.
Why it does not go to the stronger window Xbee3 with the 12 dbi antenna first in this test is it is parked almost directly below the 12 dbi antenna Xbee3 and omni directional antennas create a doughnut like signal with dead zone weaker signal in the middle.

No, that's not true. The driver code merely looks at the time between check-in for how long it takes to go not present when it leaves. The timeout in the python code is the time between transmissions. So, if you wanted to modify the time it takes for it to detect that the sensor has left, you would have to modify the driver. In my case, I'm only using it for arrival, not departure.

I also modified the driver so that when it is disabled, it always reads as present. That way, it doesn't "depart" when i turn my car off or "arrive" again when I start it up. Makes things a lot easier.

thanks I misunderstood Dan.T post
That is mainly all I need to adjust for the python code to function how I need it.
I had thought so but hadn't tested it.
Automatically going depart when I leave or turn off the car to ensure closing my garage door works fine as is so I do not have to adjust the driver.

Curious if disabling the driver for departure how do you re-enable the driver to departed?

I have custom commands of enable and disable in the driver. I don't disable the driver itself....just the device through the driver. Basically it stops looking at the report and sets that status manually.

One thing I am seeing which might end up procluding this from being a working device is that the device has to continuously be re-joined to the zigbee network. The address keeps changing and I have to re-discover it in order for it to start sending signals again. That will kind of defeat the purpose of having it as an arrival sensor if it can't automatically rejoin the network, won't it? Is there some setting that I have wrong that might be causing the device to lose what network it belongs to?

I just tested adjusting the micro python code to
time.sleep_ms(10000)
to report every 10 seconds and it does. (not recommended if constantly powered)
so perfect for my needs
turning my car on and off has kept the same network id and rejoins the network every time
I never had to reset the Xbee3 end device after reprogramming the micro python code.

maybe try Dan.T original driver code and see if it rejoins automatically for you.

I have seen the same behavior in my testing and haven’t found a way yet to stay joined to the network. I keep looking but I agree, that would destroy the idea of an Xbee as arrival sensor

The only thing I did differently from my original end devices testing months ago is keep
SP = AF0
so it matches the routers
I have had no issues with rejoining at all.

I did not have good results from using some of my old Asus dual band 5 dbi antennas on the router
stuck with my old 12 dbi 2.4 antenna and 2 dbi Asus daul band antenna

I do have SP=AF0. I'll try it again and see if it forces me to rejoin the network. I don't think it has anything to do with the driver as the device has to be re-joined to the network in order to be discovered. Isn't the network address set by the module in Zigbee and not by the network? So, the changing network address is coming from the device and not from the hub. Maybe show us a full list of all of your device settings from XCTU so we can compare.

here are the config files
Xbee3 router

Xbee3 end device

what is setting DD? You have it as 3000C but the default is 120000.

Also, A0 should be 7? I don't see that documented anywhere. Mine is at 1.

I'm also seeing the PR and PD are FFFF and EA is 0.

Would any of these make a difference?

Also, just FYI, changing to match those settings cause my Network ID to change again.

Also, pulled the power for about 20 mins, re-applied power and the network ID reset again. Looks like this isn't going to work for me. Don't know why it keeps doing that.

FYI, for anyone looking for a better solution that some of the adapter boards available, specifically one without LEDs to save on battery, I just got this one from Amazon.

FYI, it doesn't have a power adapter built in like the adapter boards available. So you have to supply 3.3v, not 5. But this is a lot smaller than the other boards I've seen.

DD is just an identifier I was playing with awhile ago

A0 should be 1
E0 is 1
PR and Pd should be FFFF they may have stayed at 7FFF from an old firmware but should not matter either.

I just took a drive around the block and the end device rejoined one of the other Xbee3 routers this time keeping it's network id.

sorry I have to go will look at it tomorrow

I noticed that AP wasn't on your list of settings but mine was set to 0-Transparent. I've tried setting it to 1 to see if that has an affect. Funny thing is, I thought you couldn't map the network as an end device but I just did.

What do you have D0 set for (the commissioning button)? I'm wondering if my hand is grounding that pin when i power on the device cause the commissioning button to be triggered and tripping the network ID to change. I've disabled D0 to see if that has an affect.

First post AP must be 0 for an end device

after setting the end device settings I just hit the reset button on the usb board.
I did have to remove and re add the Xbee3 end device to the hub when I initially converted from anrouter to end device.
If you scan the network with XTCU the Xbee3 end device should now show up as a end device not a router.

D0 is set to 1

sorry was rushing to get to work

today before I left for work I was able to connect the end device through each of my 3 Xbee3 routers without issue.
I did not get the results I thought I would when reporting every 10 seconds when i drove around.
It still connected but didn't connect to the 12 dbi Xbee3 router or as far but I only had time for one test.

But it still shows up as an end device and not a repeater when I set it up and scan my network. So, why does that work? If it keeps it from swapping addresses all the time, I'll leave the damn thing as a repeater. It will only have power for about a minute in the network.

Yeah, trying to keep it consistently connecting to the same router is problematic at best. I'm thinking of just giving up on ever getting a presence option that works consistently.