-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
OTA does not work on the latest Z2M version for DIY device #26784
Comments
Can you make sure your external converters match the current typing? zigbee2mqtt/lib/extension/otaUpdate.ts Lines 185 to 191 in 6d6372c
|
Hello and thank you for your reply. I've updated my external converter, saved it, restarted HA and tried to update my device, but to no avail. I've also tried reconfiguring, interviewing and repairing my device, but the message i get is the same: device does not support OTA. This is my current external converter. I used the auto-generation to which i appended OTA. const m = require('zigbee-herdsman-converters/lib/modernExtend');
const definition = {
zigbeeModel: ['AFTSHT35X2'],
model: 'AFTSHT35X2',
vendor: 'TeXXXInstruments',
description: 'AFT Temperature Sensor with SHT35 and NTC',
extend: [m.deviceEndpoints({"endpoints":{"8":8,"9":9}}), m.battery(), m.temperature({"endpointNames":["8","9"]}), m.humidity()],
meta: {"multiEndpoint":true},
ota: true,
}
};
module.exports = definition; This is my old external converter: const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const ota = require('zigbee-herdsman-converters/lib/ota');
const e = exposes.presets;
const ea = exposes.access;
const definitions = [
{
zigbeeModel: ['AFTSHT35X2'],
model: 'AFTSHT35X2',
vendor: 'TeXXXInstruments',
description: 'Temperature sensor SHT35',
ota: ota.zigbeeOTA,
fromZigbee: [fz.temperature, fz.humidity, fz.battery],
toZigbee: [],
meta: {multiEndpoint: true//,
},
exposes: [e.temperature(1).withEndpoint(8), e.humidity().withEndpoint(8), e.battery(), e.battery_voltage(), e.temperature(2).withEndpoint(9)],
configure: async (device, coordinatorEndpoint, logger) => {
await reporting.bind(device.getEndpoint(8), coordinatorEndpoint, ['msTemperatureMeasurement', 'msRelativeHumidity', 'genPowerCfg']);
await reporting.bind(device.getEndpoint(9), coordinatorEndpoint, ['msTemperatureMeasurement']);
await reporting.batteryPercentageRemaining(device.getEndpoint(8), {min: 10, max: 60, change: 0});
await reporting.temperature(device.getEndpoint(8), {min: 10, max: 60, change: 0});
await reporting.humidity(device.getEndpoint(8), {min: 10, max: 60, change: 0});
await reporting.temperature(device.getEndpoint(9), {min: 10, max: 60, change: 0});
try
{
await device.getEndpoint(8).read('genPowerCfg', ['batteryVoltage']);
await device.getEndpoint(8).read('msTemperatureMeasurement', ['measuredValue']);
await device.getEndpoint(8).read('msRelativeHumidity', ['measuredValue']);
await device.getEndpoint(9).read('msTemperatureMeasurement', ['measuredValue']);
} catch (e)
{
}
}
}
];
module.exports = definitions; They both behave the same way. Also, how can i get the reporting and reading commands in the new version of external converters? |
Not sure if this is a typo on copy/paste, but this is not valid JS. ota: true,
- } (The old one is definitely no longer valid PS: Whenever you change a device's firmware (changing interview details), you need to use |
Thank you for pointing that mistake out. I fixed it, saved the file, restarted HA, re-interviewed the device but the behaviour is the same. I've checked the js file with an online JS syntax validator and it seems ok. Can't figure out what might be the issue. I've used TI's guide for OTA (am using CC2652) and their libraries. Updates used to work, so i know that this project was updateable a few months back (when i was on version 1.38). |
If you keep getting the same error ( |
Sure. These are the messages seen in the Logs tab of the Z2M Addon:
When I use the 'Check All' button from the OTA tab of Z2M, nothing appears to happen. Neither in in logs tab, nor in the add-on's logs. Thank you for taking the time to respond. Let me know if there are further ways i could debug this. |
Set |
Log level was already set to debug, as i always keep it like this. I've also checked the detailed logs from the add-on and the messages are the same. I've copied a lengthier log from the add-on, maybe it shows something i missed.
|
Sorry, should have been more precise. I need the logs from startup (to see if converter is properly loadded) and from pairing (to see detection). |
Ok, thank you. I've taken the following two logs: one at startup and one for pairing the device. Its name is AFT01STH. The logs are pretty long, i hope they contain all the info. |
Detection looks fine:
However the state is a bit weird, I'm not seeing some of the logging that should be happening when getting the definition. Can you try that:
This will ensure a cleaner pairing. |
Hello and thank you. I've created the log you've instructed me to. I've noticed some failure messages in the Z2M front end after repairing, during the configuration step, but could not manage to read their contents as there were too many notifications at the same time and they all disappeared simultaneously. Could be this one, but i'm not 100% sure:
|
The errors come from:
Note: the missing attributes are not required, but Z2M logs the errors nonetheless. As for the OTA issue, these are the relevant logs:
So it appears to be working now, just no image available. |
I've checked my yaml file and, indeed, it was missing that line. I reinstalled Z2M on this instance of HA and forgot to add the override location. It works and all devices appear to have updates now. I just started a test update to make sure everything works. Thank you for taking your time to help. Greatly appreciated! |
What happened?
Hello. I've been developing a temperature sensor using Ti's CC2652RB MCU and testing it using Z2M. I've been working on and off for about a year on this implementation, but lately I've encountered an issue that I had resolved a long time ago. To be more specific, it seems that none of the devices I'm testing appear to support OTA updates. I find this very weird, as last year around this time I could do a 200KB ota update in about 30-40 minutes (i was on version 1.38 at that time). Not only did I manage to do an update, I was doing updates reliably at speeds faster than most off the shelf devices. I've delved deeper and found some weird things, but can't seem to find a solution.
I've since updated Z2M to version 2.1.3 and devices do not appear as having OTA anymore. I've tested this with 30 of my custom devices on three different coordinators: ZigStar UZG-01, Sonoff 3.0 USB DONGLE PLUS, and a SMLight SLZB-06M. I'm running Z2M as a Home Assistant add-on in two ways: on a virtual machine and on a Raspberry Pi 5. I've also tried running the coordinators over wifi, ethernet and USB. None of the combinations work anymore, while last summer updates worked like a charm.
When I publish to zigbee2mqtt/bridge/request/device/ota_update/check, the response I get is:
{"data":{},"error":"Device 'ABC04S23' does not support OTA updates","status":"error"}
I thought that I may have broken ota through the changes I made to the firmware during the past year, but I took a firmware dated 22-04-2024 (a firmware from the commit stating fully functional ota) and flashed a device with it. The behavior is identical to my latest build.
My device has two endpoints and OTA is implemented on both endpoints.
Have there been any major changes concerning ota sometimes in the past year? I cannot seem to find a guide that gives a comprehensive requirements list for functional OTA updates. I've checked the changelogs and have not observed any mentions regarding breaking ota changes.
I host my firmware image as a .zigbee file on a public github repo and i've updated the ota override file with the sha512 and otaHeader, yet nothing.
I do not think it has anything to do with the OTA file, as Z2M reports that the device does not support ota, thus does not get the check the validity of the ota file or the repository.
Thank you to whoever takes their time to chime in on this one.
What did you expect to happen?
An OTA update.
How to reproduce it (minimal and precise)
Update to version 2.1.3 and create a custom device implementing ota as in Texas Intrument's guides.
Zigbee2MQTT version
2.1.3
Adapter firmware version
7.3.1.0 build 176
Adapter
ZigStar UZG-01, Sonoff 3.0 USB DONGLE PLUS, and a SMLight SLZB-06M
Setup
Add-on on HA running on both Raspberry Pi and virtual machine.
Debug log
No response
The text was updated successfully, but these errors were encountered: