Page 1 of 1
Zombie and SDO
Posted: Tue Oct 10, 2023 11:26 am
by LRBen
Another Zombie question. Has anyone used CAN SDO with zombie to change parameters?
I a little lost on what variant of CAN SDO it uses. It looks like it references a branch of the libpopeninv from 10 months ago, so I'm guessing it would be using 0x23 as the command byte to change a parameter.
Although so far I haven't had much luck with the older commands either. Running the latest Zombie build if that is significant. I'm aware SDO has had a big change on the Open Inverter firmware recently, but from what I can tell that wouldn't affect the current Zombie build.
Re: Zombie and SDO
Posted: Tue Oct 17, 2023 11:57 am
by LRBen
Bit of an update. Been trying both new and old format message. This current message is trying to change Throtmax which is number 25 on the param_prj.h. Trying to change the value of Throtmax to 10.
Can Id 601
old format: 40 01 20 19 40 01 00 00
new format: 23 00 21 19 40 01 00 00
Re: Zombie and SDO
Posted: Thu Oct 19, 2023 9:26 am
by johu
Does it work? There are more format changes in recent libopeninv, not sure if anyone dares upgrading.
The BMS uses the latest version for reference
https://github.com/jsphuebner/FlyingAdcBms
Re: Zombie and SDO
Posted: Thu Oct 19, 2023 8:23 pm
by LRBen
Oh yeah sorry missed out that quite important point in my last post. Didn't seem to work in either format. I think it's a Zombie specific thing, seen the new format working with the most recent OI firmware on an LDU board this last week.
Re: Zombie and SDO
Posted: Mon Oct 23, 2023 5:57 pm
by LRBen
Have got a theory from Mr Catphish on why it's not working. Doesn't look like Zombie has anything in CAN filtering to allow the SDO messages through. Will try and test it this week and update.
Re: Zombie and SDO
Posted: Tue Nov 07, 2023 8:03 pm
by LRBen
Got it working today. First I needed to add the SDO id to the canbus filter in stm32_vcu.cpp
Code: Select all
canInterface[1]->RegisterUserMessage(0x601); //CanSDO
canInterface[0]->RegisterUserMessage(0x601); //CanSDO
It uses the new format of SDO semantics. Take the parameter id you want to change from param_prj.h.
So the message to change throtmax (id 25) would be 0x23, 0x01, 0x20, 25, data, data, data, data.
Have sent a pull request so this should make it's way onto a zombie release in due course.
Re: Zombie and SDO
Posted: Tue Mar 05, 2024 4:04 pm
by LRBen
LRBen wrote: ↑Tue Nov 07, 2023 8:03 pm
Got it working today. First I needed to add the SDO id to the canbus filter in stm32_vcu.cpp
Code: Select all
canInterface[1]->RegisterUserMessage(0x601); //CanSDO
canInterface[0]->RegisterUserMessage(0x601); //CanSDO
It uses the new format of SDO semantics. Take the parameter id you want to change from param_prj.h.
So the message to change throtmax (id 25) would be 0x23, 0x01, 0x20, 25, data, data, data, data.
Have sent a pull request so this should make it's way onto a zombie release in due course.
As of 2.04 this no longer seems to work in Zombie. I know there has been some changes but I can't figure out the new format, should it have changed in the new version of libopeninv that 2.04 uses? The wiki page on canbus is still referencing the original formats.
Re: Zombie and SDO
Posted: Tue Mar 05, 2024 4:35 pm
by johu
Just checked, Zombie uses the new SDO module on CAN1:
Code: Select all
Stm32Can c(CAN1, CanHardware::Baud500);
...
CanSdo sdo(&c, &cm);
sdo.SetNodeId(3);
It will register message 0x603 because nodeid=3 (you don't need the line above)
https://github.com/jsphuebner/libopenin ... do.cpp#L82
Re: Zombie and SDO
Posted: Tue Mar 05, 2024 8:21 pm
by LRBen
Thanks! I'll give that a go tomorrow and report back.
Re: Zombie and SDO
Posted: Tue Jul 30, 2024 1:29 pm
by LRBen
So tomorrow was a long time coming. Got back around to it today.
Works with 0x603, so now for example the message to change throtmax (id 25 so 0x19 in hex) would be ID 0x603. Data: 0x23, 0x00, 0x21, 0x19, data, data, data, data.