thanks for replying.. i not sure what to do though. do i need to run the python script? if so what software do i use ?
No, I was just thinking you can check the commands from that code. For example have a look at the function to set the voltage:
Code:
# Set the output voltage to the new value.
# The 'fixed' parameter
# - if True makes the change permanent ('offline command')
# - if False the change is temporary (30 seconds per command received, 'online command', repeat at 15 second intervals).
# Voltage between 41.0 and 58.5V - fan will go high below 48V!
def set_voltage(channel, voltage, fixed=False):
if voltage < 41.0 or voltage > 58.5:
print('Voltage should be between 41.0V and 58.5V')
return
bus = can.interface.Bus(bustype='socketcan', channel=channel, bitrate=125000)
b = float_to_bytearray(voltage)
p = 0x21 if fixed == False else 0x24
msg = can.Message(
arbitration_id=arbitrationid, data=[0x03, 0xF0, 0x00, p, b[0], b[1], b[2], b[3]], is_extended_id=True
)
try:
bus.send(msg)
print(f"Voltage set on {bus.channel_info}")
except can.CanError:
print("Voltage NOT set")
You can see that the CAN message looks like this:
Code:
msg = can.Message(
arbitration_id=arbitrationid, data=[0x03, 0xF0, 0x00, p, b[0], b[1], b[2], b[3]], is_extended_id=True
)
The arbitration_id is the address, this will be be 0x0607FF83 or 0x06080783 (defined at the top of the file).
The data sent is the combination of 0x03, 0xF0, 0x00, p, b[0], b[1], b[2], b[3]
Here p = 0x22 if you want to set the voltage temporarily (30 seconds), or 0x19 if you want to set the voltage fixed.
The combination of b[0], b[1], b[2], b[3] is the value you want to set the voltage to, as in a conversion of floating point to bytes. You can do that with e.g. this site manually:
https://gregstoll.com/~gregstoll/floattohex/
Thus in your case, 55.2V floating point is 0x425ccccd, with the bytes being 0x42, 0x5C, 0xCC 0xCD
The extended ID indicates that this uses the larger CAN address - you can set that checkbox in your terminal program.
So all you have to do is put the following in your terminal:
- check the extended ID checkbox
- put 0607FF83 as the address
- DLC is the length of the message, 8 bytes for these
- put your data bytes: 03 F0 00 19 42 5C CC CD
- press send
You should now be able to see the output voltage go to 55.2V with a multimeter.