AIO Adapter example

We have a temperature sensor uploading data to an AIO Adapter at the rate of one reading every minute. I’d like to slow that down but just increasing the yml parameter sample_rate_ms doesn’t seem to do it. I’d like to know whether I can just use some combination of the other config parameters sleep,sample_predelay,awake_time_ms) to accomplish this or do I have to do it in python code?
I haven’t done any python coding as yet so an example of either method would be great.

I am curious - what kind temperature sensor? voltage? current? resistance?

In my AIO tests the sample_rate_ms works fine. I am using resistive-based float/level sensors.

But you do need to remake the Dia, plus make sure (if you are paranoid like me) you upload a new and new dia.yml. That’s probably not required, but I like mindless “this always works” solutions. I think the external dia.yml over-rides the yml in the zip (if it exists). I just reload both always for testing.

It’s a current type. I have remade the code using the cfg/yml which is the one I change but I can check changing both. What kind of values have you tested in the sample rate?


once per 15 seconds and once per 5 minutes.

But my goal is the sleeping, so I am gearing up for sleeping to wake once per hour (is measuring lube oil barrels, so levels don’t change much).

Leaving the “old” dia.yml loaded on the gateway means what is in the ZIP is ignored. I just mechanically always upload both new after every change.

I did notice in the driver that there is a some code preceded by the comment “Clip sample_rate to the max value of IR”.
My IR is set to the max of 65535. Won’t that limit the sample_rate to 65535?

Actually, how IR is used depends on sleeping or not. If your unit sleeps, the IR is basically a dummy value which must be larger than ST so only 1 sample is sent when the AIO wakes. When it wakes, it sends 1 sample (a new WH setting can delay that for X msec) and thus the IR is really how long to wait before the second sample. If larger than ST, the Xbee sleeps before IR expires.

For example to get 5 minutes, I set SM=0x04, SO=0x04, SN=000F, SP=07D0, ST=0x1388 and IR=1400.

But my dia AIO driver is “hacked” as I am a Python programmer - I have been suppressing some of the Dia auto-config as it slows down reboot/restart if the nodes sleep (aka - it discards the data sent until Dia happens to find the unit awake, which can take a long time.)

What time do you actually want? I’ll figure out YML settings to enable that, plus I am creating a Wiki page explaining this since I literally have customers wanting only 1 sample per day (one per 24 hours).

I wager the AIO writer assumed if your AIO is awake always under full power, there is no reason to NOT poll the heck out of it. You may need to enable sleeping if you only want slow, rare polls. Hey - call it “green” because it eats less power that way :slight_smile:

My adapter is not set to sleep now. One reading per hour would probably be good to start. Yml examples would be great!


But my dia AIO driver is “hacked” as I am a Python programmer - I have been suppressing some of the Dia auto-config as it slows down reboot/restart if the nodes sleep (aka - it discards the data sent until Dia happens to find the unit awake, which can take a long time.)
Hi Lynnl
Would you be able to share the hacked code please, I’m working with sleeping remote sensors during development which can be slow and it would be a great help.
Many thanks Richard

Adding this setting to your YML probably gives you relief:

  • name: xbee_device_manager
    driver: devices.xbee.xbee_device_manager.xbee_device_manager:XBeeDeviceManager
    skip_config_addr_list: [ “00:13:a2:00:40:52:18:99!”, “00:13:a2:00:40:0a:11:45!”, ]

But the full address MUST be in lower case at the moment, so putting “00:13:A2:00:40:0A:11:45!” will cause it to not match. I guess the “extended_address” fields are forced to lower, but this list isn’t.

Works perfectly - many thanks.

I have ran across an “issue” when you use sleeping adapters this way. The problem is normally Dia “watches” the LTH/AIO it configures, then sets the X4 Xbee to expect the long sleeps. The problem is it does NOT consider the devices in the skip list.

So you need to know what SN and SP you want - because the gateway Xbee flushes any children NOT reporting in by (SN * Sp * 3) time. These seem to default to SN=1, SP=32, so anything sleeping for 5 minutes will have trouble rejoining the parent if you reboot the gateway. Actually, what happens is each 5 minutes it sends the IO sample, but internally the adapter Xbee receives a ‘not-joined’ error. Thus it rejoins, but since the IO sample was rejected, it does NOT retry. So Dia won’t see any more data even though the Xbee adapter will be listed in the mesh display.

The solution is to use the CLI/telnet to hard code the desired SN/SP into the gateway’s XBee.

For example this line shows me the X4’s SN and SP parameter (put your own MAC in though!)
set mesh address=00:13:a2:00:40:3e:1c:80! SN SP

This line sets the X4 to tolerate 5 minute sleepers (so the children would be removed in 15 minutes of no traffic). The “WR” at the end is critical, and the X4 doesn’t allow you to use the “sleep_count” name to access SN so for now we need to use the 2-letter AT code.
set mesh address=00:13:a2:00:40:3e:1c:80! SN=0x3AA SP=0x20 WR