'/home/source/ssl/certs/ocpp_sourcertz_com_d4789_fb323_1684627199_7dcbed5c12d8b21c50484b90b7880f95.crt', 'local_pk' => '/home/source/ssl/keys/d4789_fb323_8fa63b7a0e231fea9427cab5c6f1aa48.key', 'verify_peer' => false, ]); $socket = new Desc(); $httpServer = new HttpServer(new WsServer( $socket )); $ioServer = new IoServer($httpServer, $secureServer, $loop); //When the wss connection is active, start a timer to check and send commands to the station $ioServer->loop->addPeriodicTimer(5, function () use ($socket) { foreach($socket->clients as $client) { $init = new Init(); $send = $init->SetCommand($socket->ReturnidTag($client)); if($send) { if ($send['idTag'] === $socket->ReturnidTag($client)) { $init->UpUserCommand($socket->ReturnidTag($client), $send['user_id']); echo 'CS - user_id - '.$send['user_id'].' - '.$socket->ReturnidTag($client).' '.date('H:i:s').' '.$send['text'].PHP_EOL.PHP_EOL; //$socket->onMessageTimer($client, $send['text']); $client->send($send['text']); $init->up_command($send['text'], $socket->ReturnidTag($client)); } } } }); //When the wss connection is active, start a timer to check and send commands to the station $ioServer->run();