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

Make android app act as an OTA provider #26868

Closed
MrLiuYunPing opened this issue May 26, 2023 · 17 comments
Closed

Make android app act as an OTA provider #26868

MrLiuYunPing opened this issue May 26, 2023 · 17 comments
Assignees
Labels

Comments

@MrLiuYunPing
Copy link

Feature description

...
I have done this in iOS, because the Matter.framework has supported to set an OTA delegate, and has some test cases related. But, in android, I announce the controller nodeId to the device to update, when I set OTA delegate using endpoint 0, it always failed(emberAfFindClusterServerEndpointIndex method returns Invalid). When i look the logs on the device, it shows: Received Command Response Status for Endpoint=0 Cluster=0x0000_0029 Command=0x0000_0000 Status=0x7f . . .Status=0x7f whichs means unsupported endpoint. I don't know why iOS success but android failed?

Platform

android

Platform Version(s)

No response

Anything else?

No response

@bzbarsky-apple
Copy link
Contributor

I don't know why iOS success but android failed?

iOS implements emberAfFindClusterServerEndpointIndex specifically so OTA can work. See

* Called by the OTA provider cluster server to determine an index
* into its array.
*/
uint16_t emberAfFindClusterServerEndpointIndex(EndpointId endpoint, ClusterId clusterId)
{
if (endpoint == kSupportedEndpoint && clusterId == OtaSoftwareUpdateProvider::Id) {
return 0;
}
return UINT16_MAX;
}

Android might need to do something similar.

@srdantas
Copy link

how could you set ota provider on android @MrLiuYunPing ? may you share your code here? I never found documentarion for support this feature

@swap9391
Copy link

swap9391 commented Jun 5, 2023

Any update what steps need to perform in Android code achieve OTA in android?

@yusheng-jia
Copy link

@bzbarsky-apple Hi Could you give me a simple example how to make OTA process on iOS side? I didn't find any docs on this, I want to do OTA function on iOS, Thank you .

@yusheng-jia
Copy link

@MrLiuYunPing Hi could you tell me how you implemented on iOS? Thank you

@bzbarsky-apple
Copy link
Contributor

@yusheng-jia On iOS, set otaProviderDelegate in the MTRDeviceControllerFactoryParams to a non-nil value before starting up the controller factory. Then you will get calls to your delegate implementation as needed.

@yusheng-jia
Copy link

@yusheng-jia On iOS, set otaProviderDelegate in the MTRDeviceControllerFactoryParams to a non-nil value before starting up the controller factory. Then you will get calls to your delegate implementation as needed.

Thanks, I will do that.

@yunhanw-google
Copy link
Contributor

I will take a look today. thanks

@yunhanw-google
Copy link
Contributor

yunhanw-google commented Jul 28, 2023

@MrLiuYunPing @swap9391 @yusheng-jia @srdantas may I know your requirement on android for ota-provider? for example, you wanna use android-chip-tool or your android app to announce there is ota software, then send this image to your wifi-device using bdx over wifi? I think currently there is no java/jni api for setDelegate for ota-provider, how do you do that, wanna get more details so that we can plan the feature. thanks

@yusheng-jia
Copy link

yusheng-jia commented Jul 28, 2023

@MrLiuYunPing @swap9391 @yusheng-jia @srdantas may I know your requirement on android for ota-provider? for example, you wanna use android-chip-tool or your android app to announce there is ota software, then send this image to your wifi-device using bdx over wifi? I think currently there is no java/jni api for setDelegate for ota-provider, how do you do that, wanna get more details so that we can plan the feature. thanks

Thank you for support, you're totally right . I did this on iOS, iOS has MTROTAProviderDelegate protocol, it has very detailed method to implement the whole OTA process on App side.

@yunhanw-google
Copy link
Contributor

@yusheng-jia are you in matter slack channel, if yes, what is your slack name?

@yusheng-jia
Copy link

yusheng-jia commented Aug 1, 2023

I'm in slack channel, and my name is Jayson Jia, Thank you!

@eling22
Copy link

eling22 commented Aug 21, 2023

@yunhanw-google Hi, I am also surveying this feature. Is an OTA provider currently being developed?

@yunhanw-google
Copy link
Contributor

yunhanw-google commented Sep 7, 2023

@eling22 are you in slack, could you find me with yunhanw in slack? Wanna understand your requirement, thanks

@yunhanw-google
Copy link
Contributor

@eling22 and @MrLiuYunPing we are actively supporting this feature, we would create several PR for this work soon.

@yunhanw-google yunhanw-google moved this from Todo to In Progress in [Platform] Android Sep 27, 2023
@Shahmeera
Copy link

I don't have knowledge of an android app, but I was facing same issue with linux PC. In your android app if you want to be as an OTA provider then OTA provider cluster must be in server mode. I have resolved this error by doing following changes.
(1) updated matter version 1.2 from 1.1 because updated ZAP version can support OTA Provider cluster as a Server
(2) Enabled OTA provider cluster as a server.
By doing these, you will be able to resolve this.

@yunhanw-google
Copy link
Contributor

@Shahmeera @eling22 @MrLiuYunPing @yusheng-jia @swap9391 @srdantas we have officially added the OTA support in android side, please check-in, thanks
#30145

@github-project-automation github-project-automation bot moved this from In Progress to Done in [Platform] Android Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

8 participants