Open peak0924 opened 2 years ago
I use xrce version 2.1.1 and serial rs232
Could you paste here the whole commands you are using?
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"
Where do you have both the client and the agent running? Which serial port are you using?
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
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?
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
Are you opening the port with any other software at the same moment you are running client/agent?
no
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?
yes I just try. client-side to agent-side or agent-side to client-side are also works well
How are you connecting the RS232 side of the adaptor to the Raspberry Pi?
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.
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?
UDP and TCP is works well.what is "another serial connection" RS485?
using another serial adaptor
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
Try to use a USB to UART adaptor using the UART GPIO of the RPi instead of chaining two USB-to-RS232 adaptors.
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
@ilikecola could you try without virtual ports in vmware in order to check that this is not a misconfiguration on that side?
@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.
@ilikecola ok, could you provide detailed instructions so we can replicate your scenario?
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
e
Using the example code of ShapeDemoClient, I encountered the above errors on client side.
Agent side![image](https://user-images.githubusercontent.com/21167290/158314229-5b87dff2-f782-4710-98c4-e4830b916c74.png)
ShapeDemoClient side![image](https://user-images.githubusercontent.com/21167290/158314328-6505649f-ba1d-4a45-a7e5-b04f3c8067ea.png)