craigpeacock / Huawei_R4850G2_CAN

Example code to communicate with Huawei R4850G2 Power Supply via CAN
GNU General Public License v3.0
61 stars 17 forks source link

Usefull info/commands #4

Open DrSimgear opened 1 year ago

DrSimgear commented 1 year ago

Hi would this project be helpful for you to port over some extra functionality. https://github.com/huyugit/om-miner/tree/master/sm-miner-slave/src/psu

DJJo14 commented 9 months ago

thanks for the hint.

I went digging around in the source and fount that. I do not understand it correctly and not everything in implemented. so correct me if I am wrong. but next to the: source: https://github.com/huyugit/om-miner/blob/master/sm-miner-slave/src/psu/msg/huawei_r48xx_msg.h 0x108180FE request control (HUAWEI_R48XX_MSG_CONTROL_ID 0x80) 0x1081807E request control and 0x108040FE info request (HUAWEI_R48XX_MSG_DATA_ID 0x40) 0x1081407F info respond where the data feild's get decoded: https://github.com/huyugit/om-miner/blob/master/sm-miner-slave/src/psu/data/data_feild.h

there is also a 0xD2 = desc id (HUAWEI_R48XX_MSG_DESC_ID 0xD2 ) 0x1080D2FE request? 0x1081D27F response? where the comment is this:

接收华为电源模块上报的模块信息,r48xxMsgCount返回0表示数据接收完毕,开始解析;
先取一行,然后查找关键字,符合关键字,再相应取出信息 
原始的数据如下:
    /$[ArchivesInfo Version]
/$ArchivesInfoVersion=3.0
[Board Properties]
BoardType=EN1MRC5G1A1
BarCode=2102310FFABTG4002898
Item=02310FFA
Description=Function Module,R4850G2,EN1MRC5G1A1,1U 3000W Rectifier,Power Only
Manufactured=2016-04-11
VendorName=Huawei
IssueNumber=00
CLEICode=
BOM=
过滤后获取的数据就是
Description BoardType Manufactured BarCode
的相应数据

so I think it has to do some thing with barcode and unit code

but there is also the: ((msgCmdId<<8)&0x0000FF00) HUAWEI_R48XX_MSG_INFO_ID 0x50 HUAWEI_R48XX_MSG_CONFIG_ID 0x81 HUAWEI_R48XX_MSG_QUERY_ID 0x82 What that do I do not know yet, end are not always implemented.

HUAWEI_R48XX_PROTOCOL_ID 0x21 but they do this with it (0x21<<23)&0x1F800000= (0x21<<23)&0x10800000 so that's our starting address ((msgAddr<<16)&0x007F0000) this is the address of the device (for us always 0) but there can be more on one can bus