shtrih-m / fr_drv_ng_examples

Примеры использования https://github.com/shtrih-m/fr_drv_ng
10 stars 2 forks source link

Нет коннекта при вызове Connect(); #48

Closed bahekmel closed 1 year ago

bahekmel commented 1 year ago

Подскажите, пожалуйста, что я делаю не так. Драйвер установил, через console_test_fr_drv_ng коннект есть, и через wine_Тест_драйвера_ККТ тоже соединение есть, библиотеки подключил создаю объект c_classic_context ci; далее вызываю методы: Set_SCPassword(ci, 0); Set_SysAdminPassword(ci, 30); Set_Password(ci, 1); Set_AutoEoD(ci, true); Set_ConnectionURI(ci, "serial://ttyS0?timeout=3000&baudrate=4800", SIZE_MAX); auto connect = Connect(ci); // получаю код «-1» я так понимаю это ошибка от драйвера, при успешном соединение должно быть "0"? Куда копать и где посмотреть коды ошибок от драйвера, что значит -1? В моём PAYONLINE-01-ФА на данный момент отсутствует ФН это как-то влияет на коннект?

swex commented 1 year ago

ну, нужен лог. а так попробуйте такой uri, с полным путём: serial:///dev/ttyS0?&baudrate=4800&timeout=30000 так же стоит проверить параметр baudrate порта.

bahekmel commented 1 year ago

serial:///dev/ - не помогло, baudrate - проверен на console_test_fr_drv_ng у меня 4800 где лог драйвера записывается в ubuntu?

swex commented 1 year ago

по умолчанию в рабочей директории

bahekmel commented 1 year ago

[2023-06-07 15:39:21.561] [16059] [fr_drv_ng ] [I] ---------------------------------------------------------------------------------------------------- [2023-06-07 15:39:21.561] [16059] [fr_drv_ng ] [I] fr_drv_ng log start! [2023-06-07 15:39:21.561] [16059] [fr_drv_ng ] [I] OS: Linux 5.19.0-43-generic [2023-06-07 15:39:21.561] [16059] [fr_drv_ng ] [I] ARCH: x86_64 [2023-06-07 15:39:21.561] [16059] [createFromURI ] [I] io_url looks good: serial://COM1?timeout=30000&baudrate=115200 [2023-06-07 15:39:21.561] [16059] [createFromURI ] [I] type: serial [2023-06-07 15:39:21.561] [16059] [createFromURI ] [I] path: COM1 [2023-06-07 15:39:21.561] [16059] [classic_fr_drv_ng ] [I] classic_fr_drv_ng log start! [2023-06-07 15:39:21.561] [16059] [classic_fr_drv_ng ] [I] classic_fr_drv_ng version: 1.6.0.408 [2023-06-07 15:39:21.561] [16059] [classic_fr_drv_ng ] [I] build date: 2023-03-15T17:19:32 [2023-06-07 15:39:21.561] [16059] [ci_ci ] [I] classic_interface() [2023-06-07 15:39:21.561] [16059] [ci_ci ] [T] Set_SCPassword(0) [2023-06-07 15:39:21.561] [16059] [ci_ci ] [T] Set_SCPassword() ok [2023-06-07 15:39:21.561] [16059] [ci_ci ] [T] Set_SysAdminPassword(31) [2023-06-07 15:39:21.561] [16059] [ci_ci ] [T] Set_SysAdminPassword() ok [2023-06-07 15:39:21.561] [16059] [ci_ci ] [T] Set_Password(3) [2023-06-07 15:39:21.561] [16059] [ci_ci ] [T] Set_Password() ok [2023-06-07 15:39:21.561] [16059] [ci_ci ] [T] Get_Password() [2023-06-07 15:39:21.561] [16059] [ci_ci ] [T] Get_Password() -> 3 [2023-06-07 15:39:21.562] [16059] [ci_ci ] [T] Get_SysAdminPassword() [2023-06-07 15:39:21.562] [16059] [ci_ci ] [T] Get_SysAdminPassword() -> 31 [2023-06-07 15:39:21.562] [16059] [ci_ci ] [T] Set_AutoEoD(true) [2023-06-07 15:39:21.562] [16059] [FDOSenderService_0x55cb7a14aa90 ] [W] invalid config, trying to get from device [2023-06-07 15:39:21.562] [16059] [ProtocolV1_0x55cb7a149a60 ] [D] command F7 (Запрос параметров модели) return code: -1 execution took 0ms [2023-06-07 15:39:21.562] [16059] [ProtocolV1_0x55cb7a149a60 ] [E] Ошибка ввода вывода [2023-06-07 15:39:21.562] [16059] [ProtocolV1_0x55cb7a149a60 ] [D] commands total: 1, succeed: 0, failed: 1, avg. exec time: 0ms [2023-06-07 15:39:21.562] [16059] [FDOSenderService_0x55cb7a14aa90 ] [E] unable to get OFD config: Ошибка ввода вывода [2023-06-07 15:39:21.562] [16059] [ci_ci ] [T] Set_AutoEoD() ok [2023-06-07 15:39:21.562] [16059] [ci_ci ] [T] Get_AutoEoD() [2023-06-07 15:39:21.562] [16059] [ci_ci ] [T] Get_AutoEoD() -> true [2023-06-07 15:39:21.562] [16059] [ci_ci ] [T] Set_ConnectionURI(serial://ttyS0?timeout=3000&baudrate=4800) [2023-06-07 15:39:21.562] [16059] [isConnectUriValid ] [I] io_url looks good [2023-06-07 15:39:21.562] [16059] [ci_ci ] [T] Set_ConnectionURI() ok [2023-06-07 15:39:21.562] [16059] [ci_ci ] [T] Connect() [2023-06-07 15:39:21.562] [16059] [createFromURI ] [I] io_url looks good: serial://ttyS0?timeout=3000&baudrate=4800 [2023-06-07 15:39:21.562] [16059] [createFromURI ] [I] type: serial [2023-06-07 15:39:21.562] [16059] [createFromURI ] [I] path: ttyS0 [2023-06-07 15:39:21.562] [16059] [getProtocolFromString ] [I] protocol v1 [2023-06-07 15:39:21.562] [16059] [getTimeout ] [I] timeout: 3000 [2023-06-07 15:39:21.562] [16059] [ProtocolV1_0x55cb7a17a4e0 ] [I] setTimeout(3000ms) [2023-06-07 15:39:21.562] [16059] [getCheckStateType ] [I] enq_mode: auto [2023-06-07 15:39:21.563] [16059] [ProtocolV1_0x55cb7a17a4e0 ] [I] timeout: 3000 [2023-06-07 15:39:21.563] [16059] [SerialIO_0x55cb7a179ee0 ] [I] IO timeout = 3000ms [2023-06-07 15:39:21.563] [16059] [SerialIO_0x55cb7a179ee0 ] [I] port: /dev/ttyS0, baudrate: 4800, stop bits: OneStop, parity NoParity, flow control: NoFlowControl [2023-06-07 15:39:21.563] [16059] [SerialIO_0x55cb7a179ee0 ] [E] open: Permission denied [system:13 at /home/user/gitlab-runner/builds/uaeqZa3Z/0/fr_drv_ng/fr_drv_ng_fetch_content/boost-src/libs/asio/include/boost/asio/detail/impl/posix_serial_port_service.ipp:61 in function 'open'] [2023-06-07 15:39:21.563] [16059] [SerialIO_0x55cb7a179ee0 ] [W] open() false [2023-06-07 15:39:21.563] [16059] [ProtocolV1_0x55cb7a17a4e0 ] [W] connect() false [2023-06-07 15:39:21.563] [16059] [ci_ci ] [D] Connect() fail [2023-06-07 15:39:21.563] [16059] [ci_ci ] [E] Ошибка ввода вывода [2023-06-07 15:40:12.013] [16135] [fr_drv_ng ] [I] ---------------------------------------------------------------------------------------------------- [2023-06-07 15:40:12.013] [16135] [fr_drv_ng ] [I] fr_drv_ng log start! [2023-06-07 15:40:12.013] [16135] [fr_drv_ng ] [I] OS: Linux 5.19.0-43-generic [2023-06-07 15:40:12.013] [16135] [fr_drv_ng ] [I] ARCH: x86_64 [2023-06-07 15:40:12.013] [16135] [createFromURI ] [I] io_url looks good: serial://COM1?timeout=30000&baudrate=115200 [2023-06-07 15:40:12.013] [16135] [createFromURI ] [I] type: serial [2023-06-07 15:40:12.013] [16135] [createFromURI ] [I] path: COM1 [2023-06-07 15:40:12.013] [16135] [classic_fr_drv_ng ] [I] classic_fr_drv_ng log start! [2023-06-07 15:40:12.013] [16135] [classic_fr_drv_ng ] [I] classic_fr_drv_ng version: 1.6.0.408 [2023-06-07 15:40:12.013] [16135] [classic_fr_drv_ng ] [I] build date: 2023-03-15T17:19:32 [2023-06-07 15:40:12.013] [16135] [ci_ci ] [I] classic_interface() [2023-06-07 15:40:12.013] [16135] [ci_ci ] [T] Set_SCPassword(0) [2023-06-07 15:40:12.013] [16135] [ci_ci ] [T] Set_SCPassword() ok [2023-06-07 15:40:12.013] [16135] [ci_ci ] [T] Set_SysAdminPassword(30) [2023-06-07 15:40:12.013] [16135] [ci_ci ] [T] Set_SysAdminPassword() ok [2023-06-07 15:40:12.013] [16135] [ci_ci ] [T] Set_Password(1) [2023-06-07 15:40:12.013] [16135] [ci_ci ] [T] Set_Password() ok [2023-06-07 15:40:12.013] [16135] [ci_ci ] [T] Get_Password() [2023-06-07 15:40:12.013] [16135] [ci_ci ] [T] Get_Password() -> 1 [2023-06-07 15:40:12.013] [16135] [ci_ci ] [T] Get_SysAdminPassword() [2023-06-07 15:40:12.013] [16135] [ci_ci ] [T] Get_SysAdminPassword() -> 30 [2023-06-07 15:40:12.013] [16135] [ci_ci ] [T] Set_AutoEoD(true) [2023-06-07 15:40:12.013] [16135] [FDOSenderService_0x55cfad44ba90 ] [W] invalid config, trying to get from device [2023-06-07 15:40:12.014] [16135] [ProtocolV1_0x55cfad44aa60 ] [D] command F7 (Запрос параметров модели) return code: -1 execution took 0ms [2023-06-07 15:40:12.014] [16135] [ProtocolV1_0x55cfad44aa60 ] [E] Ошибка ввода вывода [2023-06-07 15:40:12.014] [16135] [ProtocolV1_0x55cfad44aa60 ] [D] commands total: 1, succeed: 0, failed: 1, avg. exec time: 0ms [2023-06-07 15:40:12.014] [16135] [FDOSenderService_0x55cfad44ba90 ] [E] unable to get OFD config: Ошибка ввода вывода [2023-06-07 15:40:12.014] [16135] [ci_ci ] [T] Set_AutoEoD() ok [2023-06-07 15:40:12.014] [16135] [ci_ci ] [T] Get_AutoEoD() [2023-06-07 15:40:12.014] [16135] [ci_ci ] [T] Get_AutoEoD() -> true [2023-06-07 15:40:12.014] [16135] [ci_ci ] [T] Set_ConnectionURI(serial:///dev/ttyS0?timeout=3000&baudrate=4800) [2023-06-07 15:40:12.014] [16135] [isConnectUriValid ] [I] io_url looks good [2023-06-07 15:40:12.014] [16135] [ci_ci ] [T] Set_ConnectionURI() ok [2023-06-07 15:40:12.014] [16135] [ci_ci ] [T] Connect() [2023-06-07 15:40:12.014] [16135] [createFromURI ] [I] io_url looks good: serial:///dev/ttyS0?timeout=3000&baudrate=4800 [2023-06-07 15:40:12.014] [16135] [createFromURI ] [I] type: serial [2023-06-07 15:40:12.014] [16135] [createFromURI ] [I] path: /dev/ttyS0 [2023-06-07 15:40:12.014] [16135] [getProtocolFromString ] [I] protocol v1 [2023-06-07 15:40:12.014] [16135] [getTimeout ] [I] timeout: 3000 [2023-06-07 15:40:12.014] [16135] [ProtocolV1_0x55cfad47b550 ] [I] setTimeout(3000ms) [2023-06-07 15:40:12.014] [16135] [getCheckStateType ] [I] enq_mode: auto [2023-06-07 15:40:12.014] [16135] [ProtocolV1_0x55cfad47b550 ] [I] timeout: 3000 [2023-06-07 15:40:12.014] [16135] [SerialIO_0x55cfad47af50 ] [I] IO timeout = 3000ms [2023-06-07 15:40:12.014] [16135] [SerialIO_0x55cfad47af50 ] [I] port: /dev/ttyS0, baudrate: 4800, stop bits: OneStop, parity NoParity, flow control: NoFlowControl [2023-06-07 15:40:12.014] [16135] [SerialIO_0x55cfad47af50 ] [E] open: Permission denied [system:13 at /home/user/gitlab-runner/builds/uaeqZa3Z/0/fr_drv_ng/fr_drv_ng_fetch_content/boost-src/libs/asio/include/boost/asio/detail/impl/posix_serial_port_service.ipp:61 in function 'open'] [2023-06-07 15:40:12.014] [16135] [SerialIO_0x55cfad47af50 ] [W] open() false [2023-06-07 15:40:12.014] [16135] [ProtocolV1_0x55cfad47b550 ] [W] connect() false [2023-06-07 15:40:12.014] [16135] [ci_ci ] [D] Connect() fail [2023-06-07 15:40:12.014] [16135] [ci_ci ] [E] Ошибка ввода вывода

swex commented 1 year ago

open: Permission denied

bahekmel commented 1 year ago

я так понимаю доступ запрещен в ubuntu к порту?

swex commented 1 year ago

верно

bahekmel commented 1 year ago

Спасибо всё зашевелилось [2023-06-07 16:01:43.596] [17291] [ci_ci] [T] Connect() ok