Der Harald Welte
First of all thank you for your reply.
I tried again today and now I have this problem. Early preparations:
Create a linux (debian11) (this server server)
Install the following dependencies
osmocom-latest_1.0.0_amd64.deb
libosmocore20_1.8.0_amd64.deb
libosmocodec0_1.8.0_amd64.deb
libosmoisdn0_1.8.0_amd64.deb
libosmogsm18_1.8.0_amd64.deb
libosmocoding0_1.8.0_amd64.deb
libosmovty9_1.8.0_amd64.deb
libosmogb14_1.8.0_amd64.deb
libosmoctrl0_1.8.0_amd64.deb
libosmosim2_1.8.0_amd64.deb
libosmousb0_1.8.0_amd64.deb
libosmocore_1.8.0_amd64.deb
Then I cloned two linux (debian11) one for the card reader part (bank) and one for the client-st2+simtrace2 part. bankd
install dependencies
libosmoabis10_1.4.1_amd64.deb
libosmo-rspro2_1.0.0_amd64.deb
osmo-remsim-bankd_1.0.0_amd64.deb
Installed pcscd, opened pcsc and set "1", "0", "HID Global OMNIKEY 6121 Smart Card Reader \[OMNIKEY 6121 Smart Card Reader\] 00 00" in the csv file
I run the program and wait till this
root@debian:/bin# sudo lsof -i :9999
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
osmo-rems 469 root 4u IPv4 12597 0t0 TCP *:9999 (LISTEN)
root@debian:/bin# osmo-remsim-bankd -i 192.168.2.122 -I 192.168.2.105 -n 1 -b 1
2329 DMAIN INFO bankd_pcsc.c:105 PC/SC slot name: 1/0 -> regex 'HID Global OMNIKEY 6121 Smart Card Reader \[OMNIKEY 6121 Smart Card Reader\] 00 00'
2329 DRSPRO INFO ../rspro_client_fsm.c:307 RSPRO_CLIENT(server){REESTABLISH}: Creating TCP connection to server at 192.168.2.122:9998
2329 DLGLOBAL ERROR socket.c:933 unable to bind socket:192.168.2.105:9999: Address already in use
2329 DLGLOBAL ERROR socket.c:945 no suitable addr found for: 192.168.2.105:9999
root@debian:/bin# osmo-remsim-bankd -i 192.168.2.122 -I 192.168.2.105 -n 1 -b 1 -P 1314
2333 DMAIN INFO bankd_pcsc.c:105 PC/SC slot name: 1/0 -> regex 'HID Global OMNIKEY 6121 Smart Card Reader \[OMNIKEY 6121 Smart Card Reader\] 00 00'
2333 DRSPRO INFO ../rspro_client_fsm.c:307 RSPRO_CLIENT(server){REESTABLISH}: Creating TCP connection to server at 192.168.2.122:9998
2334 DBANKDW INFO bankd_main.c:442 [000 INIT] Changing state to INIT
2334 DBANKDW INFO bankd_main.c:442 [000 INIT] Changing state to ACCEPTING
2333 DLINP NOTICE input/ipa.c:141 192.168.2.122:9998 connection done
2333 DRSPRO NOTICE ../rspro_client_fsm.c:127 RSPRO_CLIENT(server){REESTABLISH}: RSPRO link to 192.168.2.122:9998 UP
I first checked port 9999. This is the port on my bankd side, and it shows that it is being occupied by osmo-remsim. Because I read your reply that you need to bind the local port now, so I set -I, but when I set it like this, I enter the first command, it shows that my port is occupied, bankd can’t start, when I try it for the second time. The port -p 1314 is specified, and bankd is successfully started, which can also be seen in the banks of the server. But client-st2 reads port 9999, which is very contradictory.I think port 9999 of bankd is the same as port 9998 of server. It should not need to be set, but if it is not set, it will prompt an error! Why?
Hi
I have a raspberry pi with Debian 12 installed which I am trying to setup to use the simtrace2 hardware. I am having difficulty installing the simtrace2-util package – even though I believe I have followed the installation instructions (https://osmocom.org/projects/cellular-infrastructure/wiki/Nightly_Builds)
I can see the repo in the sources list following the provided instructions:
steven@simtrace:~$ cat /etc/apt/sources.list.d/osmocom-nightly.list
deb [signed-by=/etc/apt/trusted.gpg.d/osmocom-nightly.asc] https://downloads.osmocom.org/packages/osmocom:/nightly/Debian_12/ ./
If I apt list – I can see the package
steven@simtrace:~$ sudo apt list simtrace2-utils
[sudo] password for steven:
Listing... Done
simtrace2-utils/unknown 0.8.1.64.da07.202307200026 amd64
simtrace2-utils/unknown 0.8.1.64.da07.202307200026 i386
However if I try to install
steven@simtrace:~$ sudo apt install simtrace2-utils
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package simtrace2-utils
Yet – I know the package is accessible.
steven@simtrace:~$ wget https://downloads.osmocom.org/packages/osmocom:/nightly/Debian_12/simtrace2…
--2023-07-20 10:29:55-- https://downloads.osmocom.org/packages/osmocom:/nightly/Debian_12/simtrace2…
Resolving downloads.osmocom.org (downloads.osmocom.org)... 148.251.236.141, 2a01:4f8:201:344a::2
Connecting to downloads.osmocom.org (downloads.osmocom.org)|148.251.236.141|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 276884 (270K) [application/x-xz]
Saving to: ‘simtrace2_0.8.1.64.da07.202307200026.tar.xz’
simtrace2_0.8.1.64.da07.202307200026.tar.x 100%[========================================================================================>] 270.39K 140KB/s in 1.9s
2023-07-20 10:29:59 (140 KB/s) - ‘simtrace2_0.8.1.64.da07.202307200026.tar.xz’ saved [276884/276884]
I have also tried forcing https to no avail
steven@simtrace:~$ sudo apt-get install -f apt-transport-https simtrace2-utils
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package simtrace2-utils
Nothing seems to work. Any help would be appreciated.
Best Regards
-Steven
******************************************************************************
CSL DualCom Ltd
Registered Office: Building 4, Croxley Park, Hatters Lane, Watford, WD18 8YF
Registered in England No. 3155883
This e-mail is only intended for the person(s) to whom it is addressed and
may contain confidential information. Unless stated to the contrary, any
opinions or comments are personal to the writer and do not represent the
official view of the company. If you have received this e-mail in error,
please notify us immediately by reply e-mail and then delete this message
from your system. Please do not copy it or use it for any purposes, or
disclose its contents to any other person. Thank you for your co-operation.
******************************************************************************
Hello,
I'm playing with a networked remsim setup. The remsim server, sim card
reader and banks daemon sit on a RPI (rpi-cardem-1), while the client
(and the simtrace2) sit on a different RPI (rpi-cardem-2).
The client is started like this, and keeps producing this output:
root@rpi-cardem-2:~# osmo-remsim-client-st2 --server-ip remsim-server
--server-port 9998 --client-id 1 --client-slot 1 --usb-vendor 1d50
--usb-product 60e3 --usb-config 1 --usb-interface 0 --usb-path "1-1.4"
DRSPRO INFO ../rspro_client_fsm.c:307
RSPRO_CLIENT(server){REESTABLISH}: Creating TCP connection to server
at remsim-server:9998
DLINP NOTICE simtrace2_api.c:271 [0] <=
osmo_st2_cardem_request_config(features=00000001)
DLINP NOTICE input/ipa.c:141 remsim-server:9998 connection done
DRSPRO NOTICE ../rspro_client_fsm.c:127
RSPRO_CLIENT(server){REESTABLISH}: RSPRO link to remsim-server:9998 UP
DRSPRO INFO ../rspro_client_fsm.c:307
RSPRO_CLIENT(bankd){REESTABLISH}: Creating TCP connection to server at
192.168.1.111:9999
DLINP NOTICE input/ipa.c:141 192.168.1.111:9999 connection done
DRSPRO NOTICE ../rspro_client_fsm.c:127
RSPRO_CLIENT(bankd){REESTABLISH}: RSPRO link to 192.168.1.111:9999 UP
DRSPRO ERROR ../rspro_client_fsm.c:297
RSPRO_CLIENT(bankd){REESTABLISH}: Event SRVC_E_KA_TERMINATED not
permitted
DRSPRO INFO ../rspro_client_fsm.c:302
RSPRO_CLIENT(bankd){REESTABLISH}: Destroying existing connection to
server
DRSPRO INFO ../rspro_client_fsm.c:307
RSPRO_CLIENT(bankd){REESTABLISH}: Creating TCP connection to server at
192.168.1.111:9999
DLINP NOTICE input/ipa.c:141 192.168.1.111:9999 connection done
DRSPRO NOTICE ../rspro_client_fsm.c:127
RSPRO_CLIENT(bankd){REESTABLISH}: RSPRO link to 192.168.1.111:9999 UP
DRSPRO ERROR ../rspro_client_fsm.c:297
RSPRO_CLIENT(bankd){REESTABLISH}: Event SRVC_E_KA_TERMINATED not
permitted
DRSPRO INFO ../rspro_client_fsm.c:302
RSPRO_CLIENT(bankd){REESTABLISH}: Destroying existing connection to
server
This looks like bankd sends back an wrong state/event:
DRSPRO ERROR ../rspro_client_fsm.c:297
RSPRO_CLIENT(bankd){REESTABLISH}: Event SRVC_E_KA_TERMINATED not
permitted
On the bankd side, this is what I get:
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15208 DBANKDW
INFO bankd_main.c:955 [004 ACCEPTING] Accepted connection from
192.168.1.9:46281
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15208 DBANKDW
INFO bankd_main.c:442 [004 ACCEPTING] Changing state to CONN_WAIT_ID
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15208 DBANKDW
INFO bankd_main.c:655 [004 CONN_WAIT_ID] Rx RSPRO
connectClientReq(T=0, N='rpi-cardem-2', SW='remsim-client',
VER='1.0.0')
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15208 DBANKDW
INFO bankd_main.c:442 [004 CONN_WAIT_ID] Changing state to CONN_CLIENT
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15208 DBANKDW
INFO bankd_main.c:625 [004 CONN_CLIENT] slotmap found: C(1:1) ->
B(1:1)
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15208 DBANKDW
INFO bankd_main.c:450 [004 CONN_CLIENT] Changing state to
CONN_CLIENT_MAPPED (timeout=10)
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15208 DBANKDW
INFO bankd_pcsc.c:261 [004 CONN_CLIENT_MAPPED] Attempting to open
PC/SC context
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15208 DBANKDW
INFO bankd_pcsc.c:264 [004 CONN_CLIENT_MAPPED] SCardEstablishContext:
OK
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15208 DBANKDW
INFO bankd_pcsc.c:215 [004 CONN_CLIENT_MAPPED] Attempting to find
card/slot using regex 'SCM Microsystems Inc. SCR 3310 [CCID Interface]
(53312144266274) 00 00'
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15208 DBANKDW
INFO bankd_main.c:967 [004 CONN_CLIENT_MAPPED] Error -2 occurred:
Cleaning up state
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15208 DBANKDW
INFO bankd_main.c:442 [004 CONN_CLIENT_MAPPED] Changing state to
ACCEPTING
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15205 DBANKDW
INFO bankd_main.c:955 [001 ACCEPTING] Accepted connection from
192.168.1.9:40007
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15205 DBANKDW
INFO bankd_main.c:442 [001 ACCEPTING] Changing state to CONN_WAIT_ID
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15205 DBANKDW
INFO bankd_main.c:655 [001 CONN_WAIT_ID] Rx RSPRO
connectClientReq(T=0, N='rpi-cardem-2', SW='remsim-client',
VER='1.0.0')
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15205 DBANKDW
INFO bankd_main.c:442 [001 CONN_WAIT_ID] Changing state to CONN_CLIENT
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15205 DBANKDW
INFO bankd_main.c:625 [001 CONN_CLIENT] slotmap found: C(1:1) ->
B(1:1)
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15205 DBANKDW
INFO bankd_main.c:450 [001 CONN_CLIENT] Changing state to
CONN_CLIENT_MAPPED (timeout=10)
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15205 DBANKDW
INFO bankd_pcsc.c:261 [001 CONN_CLIENT_MAPPED] Attempting to open
PC/SC context
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15205 DBANKDW
INFO bankd_pcsc.c:264 [001 CONN_CLIENT_MAPPED] SCardEstablishContext:
OK
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15205 DBANKDW
INFO bankd_pcsc.c:215 [001 CONN_CLIENT_MAPPED] Attempting to find
card/slot using regex 'SCM Microsystems Inc. SCR 3310 [CCID Interface]
(53312144266274) 00 00'
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15205 DBANKDW
INFO bankd_main.c:967 [001 CONN_CLIENT_MAPPED] Error -2 occurred:
Cleaning up state
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15205 DBANKDW
INFO bankd_main.c:442 [001 CONN_CLIENT_MAPPED] Changing state to
ACCEPTING
Here, this seems relevant:
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15205 DBANKDW
INFO bankd_pcsc.c:215 [001 CONN_CLIENT_MAPPED] Attempting to find
card/slot using regex 'SCM Microsystems Inc. SCR 3310 [CCID Interface]
(53312144266274) 00 00'
Jul 12 14:33:20 rpi-cardem-1 osmo-remsim-bankd[15203]: 15205 DBANKDW
INFO bankd_main.c:967 [001 CONN_CLIENT_MAPPED] Error -2 occurred:
Cleaning up state
It searches for the reader but returns error -2.
This is the head of pcsc_scan:
root@rpi-cardem-1:~# pcsc_scan | head
Using reader plug'n play mechanism
Scanning present readers...
0: SCM Microsystems Inc. SCR 3310 [CCID Interface] (53312144266274) 00 00
Wed Jul 12 14:36:26 2023
Reader 0: SCM Microsystems Inc. SCR 3310 [CCID Interface]
(53312144266274) 00 00
Event number: 0
Card state: Card inserted,
ATR: 3B 9F 96 80 1F C7 80 31 E0 73 FE 21 13 67 98 07 02 10 01 01 01 54
ATR: 3B 9F 96 80 1F C7 80 31 E0 73 FE 21 13 67 98 07 02 10 01 01 01 54
Now - if it's using a regex to search for the reader string, the fact
that my reader has [] and () in it will break the regex search, right?
I've changed /etc/osmocom/bankd_pcsc_slots.csv, and set just:
"1","1","SCM Microsystems Inc. SCR 3310"
as the reader name/mapping, leaving out the special characters, and it
started ok.
I suggest making a note of this in the documentation, that special
characters in the reader name are checked via regular expressions.
Cheers!
Hello,guys
I use the official card reader,
root@debian:/usr/bin# pcsc_scan
Using reader plug'n play mechanism
Scanning present readers...
Waiting for the first reader...found one
Scanning present readers...
0: HID Global OMNIKEY 6121 Smart Card Reader [OMNIKEY 6121 Smart Card Reader] 00 00
Sat Jul 15 14:24:05 2023
Reader 0: HID Global OMNIKEY 6121 Smart Card Reader [OMNIKEY 6121 Smart Card Reader] 00 00
Event number: 0
Card state: Card inserted, Unresponsive card,
Because there are special symbols in the name of the card reader, so I set this in the bankd configuration file csv
"1","0","HID Global OMNIKEY 6121 Smart Card Reader \[OMNIKEY 6121 Smart Card Reader\] 00 00"
And set up bankd like this. osmo-remsim-bankd -i 192.168.2.128 -n 1 -b 1
Because my server has a fixed ip
I put the simtrace2 link on the linux of client-st2, and set up client-st2. As follows
osmo-remsim-client-st2 --usb-vendor 1d50 --usb-product 60e3 --usb-interface 0 --usb-altsetting 0 --usb-address 3 --usb-path 1-1.1 --usb-config 1 --client-id 0 --client-slot 0 --server-ip 192.168.2.128 --server-port 9998
I saw them separately on sever. I tried to make their link. osmo-remsim-apitool -m 1 1 0 0
Because I read the instructions, when linking 1 simtrace2, our client-id and client-slot need to be set to 0
When I link successfully, both bankd and client-st2 have wrong information. as follows
1987 DBANKDW INFO bankd_main.c:655 [000 CONN_WAIT_ID] Rx RSPRO connectClientReq(T=0, N='openstick', SW='remsim-client', VER='1.0.0')
1987 DBANKDW INFO bankd_main.c:442 [000 CONN_WAIT_ID] Changing state to CONN_CLIENT
1987 DBANKDW INFO bankd_main.c:619 [000 CONN_CLIENT] No slotmap (yet) for client C(0:0)
1987 DBANKDW INFO bankd_main.c:450 [000 CONN_CLIENT] Changing state to CONN_CLIENT_WAIT_MAP (timeout=10)
1987 DBANKDW INFO bankd_main.c:967 [000 CONN_CLIENT_WAIT_MAP] Error -2 occurred: Cleaning up state
1987 DBANKDW INFO bankd_main.c:442 [000 CONN_CLIENT_WAIT_MAP] Changing state to ACCEPTING
TCP connection to server at 192.168.2.131:9999
DLINP NOTICE input/ipa.c:141 192.168.2.131:9999 connection done
DRSPRO NOTICE ../rspro_client_fsm.c:127 RSPRO_CLIENT(bankd){REESTABLISH}: RSPRO link to 192.168.2.131:9999 UP
DRSPRO ERROR ../rspro_client_fsm.c:297 RSPRO_CLIENT(bankd){REESTABLISH}: Event SRVC_E_KA_TERMINATED not permitted
DRSPRO INFO ../rspro_client_fsm.c:302 RSPRO_CLIENT(bankd){REESTABLISH}: Destroying existing connection to server
DRSPRO INFO ../rspro_client_fsm.c:307 RSPRO_CLIENT(bankd){REESTABLISH}: Creating TCP connection to server at 192.168.2.131:9999
I'm wondering if I'm doing something wrong? What is the reason that led to such a result! I'm looking forward to someone pointing out my mistakes. and help me. Thank you so much. guys
Hello everyone!
I'm new to simtrace and I'm trying to set up a test with a Simtrace2
board connected to a RPI (which I'll call the client from now on) and
a different RPI with an attached card reader (which I'll call the
server).
The server runs osmo-remsim-bankd and osmo-remsim-server (installed
from your debian repo). The bankd server has its configuration csv
file filled with the correct reader information. The
osmo-remsim-server runs on the same machine and has a mapping
configured via the python api tool to map client 1 to bank 1, like so:
root@rpi-cardem-1:~# python3 /etc/osmocom/osmo-remsim-apitool -a
/clients: {'clients': []}
/banks: {'banks': [{'peer': 'B1', 'state': 'CONNECTED_BANKD',
'component_id': {'type_': 'remsimBankd', 'name': 'fixme-name',
'software': 'remsim-bankd', 'swVersion': '1.0.0'}, 'bankId': 1,
'numberOfSlots': 5}]}
/slotmaps: {'slotmaps': [{'bank': {'bankId': 1, 'slotNr': 1},
'client': {'clientId': 1, 'slotNr': 1}, 'state': 'ACTIVE'}]}
The client runs osmo-remsim-client-st2 like this:
root@rpi-cardem-2:~# osmo-remsim-client-st2 --server-ip remsim-server
--server-port 9998 --client-id 1 --client-slot 1 --usb-vendor 1d50
--usb-product 60e3 --usb-config 1 --usb-interface 0 --usb-path "1-1.4"
However, based on the logs, it tries to contact the bankd server at
127.0.0.1:9999 instead of remsim-server:9999:
DRSPRO INFO ../rspro_client_fsm.c:307
RSPRO_CLIENT(server){REESTABLISH}: Creating TCP connection to server
at remsim-server:9998
DLINP NOTICE simtrace2_api.c:271 [0] <=
osmo_st2_cardem_request_config(features=00000001)
DLINP NOTICE input/ipa.c:141 remsim-server:9998 connection done
DRSPRO NOTICE ../rspro_client_fsm.c:127
RSPRO_CLIENT(server){REESTABLISH}: RSPRO link to remsim-server:9998 UP
DRSPRO INFO ../rspro_client_fsm.c:307
RSPRO_CLIENT(bankd){REESTABLISH}: Creating TCP connection to server at
127.0.0.1:9999
DRSPRO NOTICE ../rspro_client_fsm.c:127
RSPRO_CLIENT(bankd){REESTABLISH}: RSPRO link to 127.0.0.1:9999 DOWN
The bankd server listens on 0.0.0.0 on the server side:
root@rpi-cardem-1:~# netstat -tpan | grep osmo | grep LISTEN
tcp 0 0 0.0.0.0:9997 0.0.0.0:*
LISTEN 409/osmo-remsim-ser
tcp 0 0 0.0.0.0:9998 0.0.0.0:*
LISTEN 409/osmo-remsim-ser
tcp 0 0 0.0.0.0:9999 0.0.0.0:*
LISTEN 405/osmo-remsim-ban
My question is - how is osmo-remsim-client-st2 getting the IP address
of the bankd server? What did I do wrong?
I've tried a few tricks to redirect traffic from 127.0.0.1:9999 to
remsim-server:9999, but so far have failed. This is what I've tried as
a proxy, but the connection seems to get garbled because netcat
expects LF terminated strings:
nc -l 127.0.0.1 9999 | nc remsim-server 9999
Thanks for the help
Cheers,
Adrian