Closed KnightRUS closed 2 years ago
i tryed to send for example DM35 (50 bytes)
OpenSAEJ1939 does not have support for DM35. But it's very easy to implement.
18ec80f9 8 10 32 00 08 ff 00 9f 00 (RTS frame)
You are sending ID = 0x18EC80F9 where 80 is the destination address and F9 is the source address e.g PCAN module.
Your src send back 18ecf980 8 11 32 00 08 ff 00 9f 00 (CTS frame) and transfer stopped....strange
CTS means clear to send. https://github.com/DanielMartensson/Open-SAE-J1939/blob/88337acb9c1d436e56f655e6e6ee6d03d0755db0/Src/SAE_J1939/SAE_J1939-21_Transport_Layer/Transport_Protocol_Connection_Management.c#L28
Only use RTS when you want to send to a specific device. Only use BAM if you want to send all data to all devicies at the same time.
Follow this function https://github.com/DanielMartensson/Open-SAE-J1939/blob/88337acb9c1d436e56f655e6e6ee6d03d0755db0/Src/SAE_J1939/SAE_J1939-21_Transport_Layer/Transport_Protocol_Data_Transfer.c#L80
Question: How many packages do you want to recieve?
8 10 32 00 08 ff 00 9f 00
You are sending: Control byte = 0x8 (Not supported. Please write in it here: https://github.com/DanielMartensson/Open-SAE-J1939/blob/main/Src/SAE_J1939/SAE_J1939_Enums/Enum_Control_Byte.h) Message size: 0x32 << 8 | 0x10 = 12816 bytes. Wow...that's way to much! Number of packages = 0x0 (Zero packages?) PGN number 0x00 << 16 | 0x9f << 8 | 0x00 = 0x09F00 (Please add it here https://github.com/DanielMartensson/Open-SAE-J1939/blob/main/Src/SAE_J1939/SAE_J1939_Enums/Enum_PGN.h)
i tryed to send for example DM35 (50 bytes)
OpenSAEJ1939 does not have support for DM35. But it's very easy to implement.
18ec80f9 8 10 32 00 08 ff 00 9f 00 (RTS frame)
You are sending ID = 0x18EC80F9 where 80 is the destination address and F9 is the source address e.g PCAN module.
Your src send back 18ecf980 8 11 32 00 08 ff 00 9f 00 (CTS frame) and transfer stopped....strange
CTS means clear to send.
https://github.com/DanielMartensson/Open-SAE-J1939/blob/88337acb9c1d436e56f655e6e6ee6d03d0755db0/Src/SAE_J1939/SAE_J1939-21_Transport_Layer/Transport_Protocol_Connection_Management.c#L28 / When we answer with CTS, it means we are going to send the Transport Protocol Data Transfer package / - but its wrong. CTS mean we ready to get Data Transfer ...... First: Transmit a RTS message to the specific address that says:
- I‟m about to send the following PGN in multiple packets.
- I‟m sending X amount of data.
- I‟m sending Y number of packets.
- I can send Z number of packets at once. • Second: Wait for CTS: CTS says:
- I can receive M number of packets at once.
- Start sending with sequence number N. • Third: Send data. Then repeat steps starting with #2. When all data sent, wait for ACK. ....
Only use RTS when you want to send to a specific device. Only use BAM if you want to send all data to all devicies at the same time.
Follow this function
Question: How many packages do you want to recieve?
i wait 8 frames with 50 bytes
8 10 32 00 08 ff 00 9f 00
You are sending: Control byte = 0x8 (Not supported. Please write in it here: https://github.com/DanielMartensson/Open-SAE-J1939/blob/main/Src/SAE_J1939/SAE_J1939_Enums/Enum_Control_Byte.h) Message size: 0x32 << 8 | 0x10 = 12816 bytes. Wow...that's way to much! Number of packages = 0x0 (Zero packages?) PGN number 0x00 << 16 | 0x9f << 8 | 0x00 = 0x09F00 (Please add it here https://github.com/DanielMartensson/Open-SAE-J1939/blob/main/Src/SAE_J1939/SAE_J1939_Enums/Enum_PGN.h)
sorry its my fault. 8 meand dls (it is not part of data bytes) in all examples in my issue(
i tryed to send for example DM35 (50 bytes)
OpenSAEJ1939 does not have support for DM35. But it's very easy to implement.
18ec80f9 8 10 32 00 08 ff 00 9f 00 (RTS frame)
You are sending ID = 0x18EC80F9 where 80 is the destination address and F9 is the source address e.g PCAN module.
Your src send back 18ecf980 8 11 32 00 08 ff 00 9f 00 (CTS frame) and transfer stopped....strange
CTS means clear to send. https://github.com/DanielMartensson/Open-SAE-J1939/blob/88337acb9c1d436e56f655e6e6ee6d03d0755db0/Src/SAE_J1939/SAE_J1939-21_Transport_Layer/Transport_Protocol_Connection_Management.c#L28
/ When we answer with CTS, it means we are going to send the Transport Protocol Data Transfer package / - but its wrong. CTS mean we ready to get Data Transfer ...... First: Transmit a RTS message to the specific address that says:
- I‟m about to send the following PGN in multiple packets.
- I‟m sending X amount of data.
- I‟m sending Y number of packets.
- I can send Z number of packets at once. • Second: Wait for CTS: CTS says:
- I can receive M number of packets at once.
- Start sending with sequence number N. • Third: Send data. Then repeat steps starting with MCP2515 support #2. When all data sent, wait for ACK. ....
Only use RTS when you want to send to a specific device. Only use BAM if you want to send all data to all devicies at the same time. Follow this function https://github.com/DanielMartensson/Open-SAE-J1939/blob/88337acb9c1d436e56f655e6e6ee6d03d0755db0/Src/SAE_J1939/SAE_J1939-21_Transport_Layer/Transport_Protocol_Data_Transfer.c#L80
Question: How many packages do you want to recieve?
i wait 8 frames with 50 bytes
Please. Show me your C code.
so here is your code /*
PGN: 0x00EC00 (60416) / ENUM_J1939_STATUS_CODES SAE_J1939_Send_Transport_Protocol_Connection_Management(J1939 j1939, uint8_t DA) { //uint32_t ID = (0x1CEC << 16) | (DA << 8) | j1939->information_this_ECU.this_ECU_address; uint32_t ID = (0x18EC << 16) | (DA << 8) | j1939->information_this_ECU.this_ECU_address; uint8_t data[8]; // data[0] = j1939->this_ecu_tp_cm.control_byte; // data[1] = j1939->this_ecu_tp_cm.total_message_size; // data[2] = j1939->this_ecu_tp_cm.total_message_size >> 8; // data[3] = j1939->this_ecu_tp_cm.number_of_packages; // data[4] = 0xFF; / Reserved / // data[5] = j1939->this_ecu_tp_cm.PGN_of_the_packeted_message; // data[6] = j1939->this_ecu_tp_cm.PGN_of_the_packeted_message >> 8; // data[7] = j1939->this_ecu_tp_cm.PGN_of_the_packeted_message >> 16;
data[0] = j1939->this_ecu_tp_cm.control_byte; data[1] = j1939->this_ecu_tp_cm.total_message_size; data[2] = 1; data[3] = 0xFF; data[4] = 0xFF; / Reserved / data[5] = j1939->this_ecu_tp_cm.PGN_of_the_packeted_message; data[6] = j1939->this_ecu_tp_cm.PGN_of_the_packeted_message >> 8; data[7] = j1939->this_ecu_tp_cm.PGN_of_the_packeted_message >> 16;
return CAN_Send_Message(ID, data); }
commented section was yours and below is my section - it works.
please look at https://www.simmasoftware.com/j1939-presentation.pdf (36 page) other parts of my code and yours dont matter. problem in structure of cts frame
I think this software does not follow the standard. https://github.com/DanielMartensson/Open-SAE-J1939/blob/main/Src/Documentation/Pictures/SAE%20J1939%20Resources/TCI%20%20SENSE%2042%20Version%203.0-25-108.pdf
See page 32 / 108
i cant find RTS CTS structure in your pdf (tell me page please). i only found work with BAM (your source works fine with BAM)
RTS and CTS is a control byte. Only a number.
RTS and CTS is a control byte. Only a number.
I'm sorry, I'm in a hurry and therefore I write nonsense))) i mean that i dont found decription for Transport_Protocol PGN (0xEC). in your documentation i found only with control byte = BAM description
as you can see in my documentation we have 3 descriptions of 0xEC PGN. for BAM for RTS for CTS. And CTS very different
RTS and CTS is a control byte. Only a number.
I'm sorry, I'm in a hurry and therefore I write nonsense))) i mean that i dont found decription for Transport_Protocol PGN (0xEC). in your documentation i found only with control byte = BAM description
Here is my documention: https://github.com/DanielMartensson/Open-SAE-J1939/blob/main/Src/Documentation/Open%20SAE%20J1939.pdf
OpenSAEJ1939 have support for BAM, RTS and CTS.
so in this documentation you write that you support BAM, RTS and CTS but in https://github.com/DanielMartensson/Open-SAE-J1939/blob/main/Src/Documentation/Pictures/SAE%20J1939%20Resources/TCI%20%20SENSE%2042%20Version%203.0-25-108.pdf (also yours) i see words "ONLY BAM IS SUPPORTED" page 32
so in this documentation you write that you support BAM, RTS and CTS but in https://github.com/DanielMartensson/Open-SAE-J1939/blob/main/Src/Documentation/Pictures/SAE%20J1939%20Resources/TCI%20%20SENSE%2042%20Version%203.0-25-108.pdf (also yours) i see words "ONLY BAM IS SUPPORTED" page 32
It's not my documention. I only upload it as reference where I get my SAEJ1939 standard from. It's difficult to get free documents about J1939, and if I found some documention, it's most likely a list of numbers I have to work with.
Anyway i will continue to adapt you sorce for my needs. i just want to tell that peak-system software dont work with your 0xEC CTS realisation. And i show you that docementation that i found helps me to fix this problem. Thanks for source
Do they follow the right standard? Because all documents that I have about SAE J1939, follows the same standard.
i tryed to send for example DM35 (50 bytes) from PCAN-Explorer (from 0xF9 - PCANExplorer to 0x80 - GD32F105 board). PCAN sends 18ec80f9 8 10 32 00 08 ff 00 9f 00 (RTS frame). Your src send back 18ecf980 8 11 32 00 08 ff 00 9f 00 (CTS frame) and transfer stopped....strange i read this manual https://www.simmasoftware.com/j1939-presentation.pdf (36 page) and i see that CTS have different structure than yours. also it has different structure of ACK frame (at end of the message) i change your CTS message to (18ecf980 8 11 32 01 ff ff 00 9f 00) and PCAN Explorer now send data transfer frames
where is truth?)