cancel
Showing results for 
Search instead for 
Did you mean: 

ASPEP MCP protocol implementation

shane mattner
Associate III

[VERSION]: 6.3.0
[TOOL]: Firmware, ASPEP, Motor Control Protocol Suite
[DETAILS]: Cannot send commands and read from MCU over ASPEP other than BEACON and PING
[EXPECTED BEHAVIOR]: Emulate Motor Pilot
[HOW TO REPRODUCE]: Download script attached, change file type to .py and run

 

I am unable to send/receive commands other than BEACON and PING to the mcu.  By using a script that @VOgne.1  posted on 2022-10-15 I had a basis for the logic and got some response from the MCU over a serial port.  I've attached the script below named "serialConnectionProtocol.txt".

 

After reading through the documentation (MC_SDK_6.3.0/Documentation/html/md_docs_2_motor_01_control_01_protocol_01_suite.html#connection-procedure) I figured out I need to send 2 BEACON commands to connect to the device, one to get data from the device, the copying that data and sending it back to the device.

Now I'd like to send a command or read a value and that's not working.  The MCU is not responding to packets after the ping command.

Here's the bytes I get from the current python script:

 

shane@shane-ThinkPad-X1-Carbon-Gen-10:~/Desktop/skip_repos/electronics/Test_Firmware$ sudo python3 EVSPING4-ACT_oct_1/python_scripts/serialConnectionProtocol.py 
connected to: /dev/ttyACM1
Sending to serial: F5 FF FF AF
Read from serial: b'\x05\xc3\x00\xd4'
Sending to serial: 05 C3 00 D4
Read from serial: b'\x05\xc3\x00\xd4'
Sending to serial: 06 00 00 60
Read from serial: b'6\x00\x00\x90'
Packet number: 0, ipID: 0, cbit: 1, Nbit: 0
Sending to serial: F9 00 00 30 09 00 89 00 01 91 00 F4 01 99 00 2C 01 00 00
Read from serial: b''
Warning: Expected 4 bytes, got 0
Failed to read from serial
Sending to serial: 89 00 00 20 11 00 89 00 91 00 99 00
Read from serial: b''
Warning: Expected 4 bytes, got 0
Failed to read from serial

 

 

I've also attached the bytes I sniffed from running the Motor Profiler and Motor Pilot.  Both of those show that they send BEACON commands and then a PING command. 

Both the Pilot and Profiler get a different response for the PING command of 0x36, 0x0, 0x0, 0x90.  Whereas the python script gives me 0x6, 0x0, 0x0, 0x90.  So perhaps there is some error there but I'm sending the same 0x6, 0x0, 0x0, 0x60 that the Profiler and Pilot do.

 

Then I tried manually sending 49 00 00 70 10 00 28 00, as that is the next byte sequence sent by the Profiler and Pilot. 

Any help would be appreciated.  Here are some links to other forum posts and a github repo that claims to have implemented the protocol in C:
- https://community.st.com/t5/stm32-mcus-motor-control/bug-report-aspep-protocol-ping-packets/m-p/647087
- https://community.st.com/t5/stm32-mcus-motor-control/documentation-of-aspep-protocol/td-p/160027
- this post has a link to the python script with is the bases for `serialConnectionProtocol.py`
- https://community.st.com/t5/stm32-mcus-motor-control/mc-sdk-documentation-for-data-packet-structure/m-p/653760
- https://github.com/blr-ophon/cmdpilot

0 REPLIES 0