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

creat session error when use serial mode #134

Open
peak0924 opened this issue Mar 15, 2022 · 24 comments
Open

creat session error when use serial mode #134

peak0924 opened this issue Mar 15, 2022 · 24 comments

Comments

@peak0924
Copy link

peak0924 commented Mar 15, 2022

Using the example code of ShapeDemoClient, I encountered the above errors on client side.

Agent side
image

ShapeDemoClient side
image

@peak0924
Copy link
Author

peak0924 commented Mar 15, 2022

I use xrce version 2.1.1 and serial rs232

@pablogs9
Copy link
Member

Could you paste here the whole commands you are using?

@peak0924
Copy link
Author

agent: ./MicroXRCEAgent serial -b 115200 -D /dev/ttyUSB0 -v 6 -r agent.refs
client: ./ShapeDemoClient --serial /dev/ttyUSB0 。when it start I use command " create_session"

@pablogs9
Copy link
Member

Where do you have both the client and the agent running? Which serial port are you using?

@peak0924
Copy link
Author

peak0924 commented Mar 15, 2022

I have Tow computer
1 computer is agent .IP 192.168.3.202 serial dev is /dev/ttyUSB0 .system is ubuntu 20.04
2 computer is client . IP 192.168.3.203 serial dev is /dev/ttyUSB0 .system is ubuntu 20.04
I use usb to serial device like this to link this tow comouter
image

@pablogs9
Copy link
Member

Have you checked the proper operation of the serial link without the XRCE environment?
Are you opening the port with any other software at the same moment you are running client/agent?

@peak0924
Copy link
Author

yes I have checked.
client computer I use command: echo "hello" > /dev/ttyUSB0
agent computer I use command: cat /dev/ttyUSB0 . then I get "hello" at this computer

@pablogs9
Copy link
Member

Are you opening the port with any other software at the same moment you are running client/agent?

@peak0924
Copy link
Author

no

@pablogs9
Copy link
Member

client computer I use command: echo "hello" > /dev/ttyUSB0
agent computer I use command: cat /dev/ttyUSB0 . then I get "hello" at this computer

If you send something from the agent to the client-side it also works?

@peak0924
Copy link
Author

yes I just try.
client-side to agent-side or agent-side to client-side are also works well

@pablogs9
Copy link
Member

How are you connecting the RS232 side of the adaptor to the Raspberry Pi?

@peak0924
Copy link
Author

1647328431(1)
798be04588fb37ae1f767255ff220fe

@pablogs9
Copy link
Member

Well it seems that the communication from the client to the agent is working since the agent creates the session but the client is not receiving the agent's session confirmation.

Please try another serial connection or use another transport layer.

@peak0924
Copy link
Author

peak0924 commented Mar 15, 2022

Well it seems that the communication from the client to the agent is working since the agent creates the session but the client is not receiving the agent's session confirmation.

Please try another serial connection or use another transport layer.

UDP and TCP is works well.what is "another serial connection" RS485?

@pablogs9
Copy link
Member

UDP and TCP is works well.what is "another serial connection" RS485?

using another serial adaptor

@peak0924
Copy link
Author

UDP and TCP is works well.what is "another serial connection" RS485?

using another serial adaptor

Can you recommend me a way to build a serial port environment

@pablogs9
Copy link
Member

Try to use a USB to UART adaptor using the UART GPIO of the RPi instead of chaining two USB-to-RS232 adaptors.

@ilikecola
Copy link

Here is the same question on vmware virtual serial port.
Agent side:

ilikecola@fastddsubuntu:~/eprosima/xrce/xrce_test$ ./MicroXRCEAgent serial -D /dev/ttyS0 -v 6 -r ../agent.refs
[1647454138.119153] info     | TermiosAgentLinux.cpp | init                     | running...             | fd: 3
[1647454138.119520] info     | Root.cpp           | set_verbose_level        | logger setup           | verbose_level: 6
[1647454147.374813] info     | Root.cpp           | create_client            | create                 | client_key: 0xAABBCCDD, session_id: 0x81
[1647454147.374880] info     | SessionManager.hpp | establish_session        | session established    | client_key: 0xAABBCCDD, address: 1
[1647454147.374958] debug    | SerialAgentLinux.cpp | send_message             | [** <<SER>> **]        | client_key: 0xAABBCCDD, len: 19, data:
0000: 81 00 00 00 04 01 0B 00 00 

Client side:

ilikecola@fastddsubuntu:~/eprosima/xrce/bin$ ./ShapeDemoClient --serial /dev/ttyS0
Running in serial mode => dev: /dev/ttyS0
create_session
Status: NONE
l

@peak0924
Copy link
Author

#134 (comment) @pablogs9

@pablogs9
Copy link
Member

@ilikecola could you try without virtual ports in vmware in order to check that this is not a misconfiguration on that side?

@ilikecola
Copy link

@pablogs9 there is a little configuration on virtual ports in vmware , only I/O mode of 'Yield CPU on poll' and echo test is working well.

@pablogs9
Copy link
Member

@ilikecola ok, could you provide detailed instructions so we can replicate your scenario?

@ilikecola
Copy link

OK
Step 1. set up two VM based on ubuntu 20.04 and upload libs and execs
Step 2. add serial ports in these VM with 'Yield CPU on poll' checked
Step 3. do Echo test to comfirm serial port working.
Step 4. executing 'MicroXRCEAgent' on server side and executing 'ShapeDemoClient' on client sid
Snipaste_2022-03-17_17-24-45
e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants