Okay, you can ignore this! Despite spending two days on it so far I've just found out that I shouldn't be converting the data to hex first. I'd thought that this was necessary but I'm getting the correct checksum with plain text. Sorry to have troubled you.