Zombie and SDO

Post Reply
LRBen
Posts: 474
Joined: Thu Jul 04, 2019 6:35 pm
Location: Somerset, UK
Has thanked: 43 times
Been thanked: 107 times

Zombie and SDO

Post 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.
LRBen
Posts: 474
Joined: Thu Jul 04, 2019 6:35 pm
Location: Somerset, UK
Has thanked: 43 times
Been thanked: 107 times

Re: Zombie and SDO

Post 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
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1024 times
Contact:

Re: Zombie and SDO

Post 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
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
LRBen
Posts: 474
Joined: Thu Jul 04, 2019 6:35 pm
Location: Somerset, UK
Has thanked: 43 times
Been thanked: 107 times

Re: Zombie and SDO

Post 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.
LRBen
Posts: 474
Joined: Thu Jul 04, 2019 6:35 pm
Location: Somerset, UK
Has thanked: 43 times
Been thanked: 107 times

Re: Zombie and SDO

Post 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.
LRBen
Posts: 474
Joined: Thu Jul 04, 2019 6:35 pm
Location: Somerset, UK
Has thanked: 43 times
Been thanked: 107 times

Re: Zombie and SDO

Post 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.
LRBen
Posts: 474
Joined: Thu Jul 04, 2019 6:35 pm
Location: Somerset, UK
Has thanked: 43 times
Been thanked: 107 times

Re: Zombie and SDO

Post 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.
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1024 times
Contact:

Re: Zombie and SDO

Post 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
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
LRBen
Posts: 474
Joined: Thu Jul 04, 2019 6:35 pm
Location: Somerset, UK
Has thanked: 43 times
Been thanked: 107 times

Re: Zombie and SDO

Post by LRBen »

Thanks! I'll give that a go tomorrow and report back.
Post Reply