MNS CANBUS Specification

Started by Wizbandit, September 12, 2024, 12:52:26 PM

Previous topic - Next topic

Wizbandit

Here is the MNS Arbitration ID aka Message Header breakout.  29Bit Extended Message format.  The header is built using Register+DeviceType+DeviceIndex+BusID.  I go get the BUID aka Bus ID from the Device using the MNGP2.  You could make a function to search the stream and report all devices and their BusID (That's on my ToDo List)

The DeviceIndex is used for example, The Barcelona has one PV IN Voltage register BUT two MPPT Channels. In this case the Index would be 1 or 2 to differentiate between the MPPT's aka PV Inputs. This would make two different Arbitration ID's.

I have included the Battery Block of Registers that the MNGP2 streams.  It decides what values the system uses so start there.  The Devices all have individual Battery Blocks as well but these are what all devices are suppose to use.  Start here, if you manage to get data I can post more.  The data bytes are "Big Endian" also.  You need to combine the bytes into 16 bit and 32 bit Integers. For example Reg 0x0a0 has 8 bytes.  Bytes 0&1 are Voltage X10, Bytes 2&3 are CurrentX10 and Bytes 4-7 are PowerX100 (a 32 bit Integer)

Here is my Python Function to build the MNCAN headers:
def make_header(reg_num, dev_type, idx, bid):
    return ((reg_num<<18)|(dev_type<<11)|(idx<<7)|bid)

Example to make a header for Reg0x0a0:         _0x0A0 = [[0]*3,make_header(0x0A0,0x07F,0x0,bid)]



Raster

Wizbandit:

You info is really helpful.

So far I have:

Battery Blocks:

No arbids with 0x300-0x308 registers

Devices:

MNGP2    0x14
Rosie    0x30
Barcelona 0x2c

Bus id:

Rosie    1
Barcelona 2
MNGP2    0x52
?????    0x7f


Register "0a0":

This one works just as you specify above. Owner is Barcelona, results match Battery Voltage, Battery Current, Battery Power on the MNGP2 display.

I just need more registers to be able to monitor my system with Nodered and RPi. Don't know why I am not seeing the Battery Block.

I can't seem to get the firmware updated for the Rosie and MNGP2. The Android updaters don't update anything, just say I have the latest. Can anyone at MN explain?

R.

Wizbandit

#2
MNGP2 Device type is 0x014 and 0x07f
0x014 is discovery registers I think.
0x07f is for register battery block 0x300
FYI - half the streaming registers do not have any data yet...
So if you get one with all zeros, now you know...

Here a a few more snips:

Raster

Wizbandit:

Tested the new info today.

Yes, lots of packets where the data array is all zeroes.

Barcelona: 0x0a3

Got the "Charge State Enum" to work. It showed switching back and forth between "Resting" and "Float". Verified on the MNGP2 display.

Where is the Barcelona BTS info? "0x0a3" has all zeroes for data[6]data[7].

How do you tell (device_index?) which MPPT is being reported. I have my array on MPPT2, nothing on MPPT1 yet. Device_index is 0, data is for MPPT2.

More register info would be great (Rosie,Barcelona, BTS, solar array numbers).

R.

Wizbandit

Barcelona INDEX-1 should be MPPT-1 and INDEX-2 should be MPPT-2
reg_num[0x021] dev_type[0x2c] idx[0x01] bid[0x01] [8] 00 00 00 81 00 01 13 FC
reg_num[0x081] dev_type[0x2c] idx[0x01] bid[0x01] [8] 0F F6 00 00 00 00 00 00
reg_num[0x021] dev_type[0x2c] idx[0x02] bid[0x01] [8] 00 00 00 61 00 00 CF 18
reg_num[0x081] dev_type[0x2c] idx[0x02] bid[0x01] [8] 0D 4C 00 00 00 00 00 00

BTS on Barcelona is reg 0x2A4 last 2 bytes.
reg_num[0x2a4] dev_type[0x30] idx[0x00] bid[0x61] [4] 02 01 01 0A


Wizbandit

Data streamed by the MNGP2...