After the Onos connects to the p4 switch, there is a problem that the device is not online. This is the configuration file I wrote to the Onos

@lq1

there is a similar thread here, please take a look ONOS+Stratum+P4 - #3 by DavideS

Best
Davide