Hey Gang, quite new to this tech, but I have a question about how I get data onto the NMEA 2000 Bus.
I have data coming into a PI running OpenPlotter via a MQTT Message bus - data is being sent from a PI running Victron Venus, which is sending things like Battery Voltage etc.
My OpenPlotter PI has a PICAN-M N2K Hat and I can read data from the N2K Bus, but I cannot work out how to get data back onto the Bus.
I have this config currently, and have enabled the "Battery (127506 & 127508)" option in the SignalK to NMEA 2000 plugin, but do not know what I should be using for battery mappings etc
[{"id":"abed08c3f6d3b560","type":"mqtt in","z":"3069492ed761c9d6","name":"","topic":"batteryVoltage","qos":"2","datatype":"auto-detect","broker":"1f95090207bca94a","nl":false,"rap":true,"rh":0,"inputs":0,"x":150,"y":480,"wires":[["fc764886ff6ddcf4","b218e738964742ca"]]},{"id":"341bae7f21d9990f","type":"mqtt in","z":"3069492ed761c9d6","name":"","topic":"batteryCurrent","qos":"2","datatype":"auto-detect","broker":"1f95090207bca94a","nl":false,"rap":true,"rh":0,"inputs":0,"x":160,"y":560,"wires":[["b218e738964742ca"]]},{"id":"b218e738964742ca","type":"function","z":"3069492ed761c9d6","name":"Actisence String","func":"// Extract battery voltage and current from the message payload\nvar batteryVoltage = msg.payload.batteryVoltage; // Replace with your actual payload property\nvar batteryCurrent = msg.payload.batteryCurrent; // Replace with your actual payload property\n\n// Function to convert a floating-point number to its hexadecimal representation\nfunction floatToHex(f) {\n return Buffer.from(Float32Array.from([f]).buffer).toString('hex');\n}\n\n// Convert battery voltage and current to hexadecimal\nvar hexVoltage = floatToHex(batteryVoltage);\nvar hexCurrent = floatToHex(batteryCurrent);\n\n// Construct the Actisense-formatted string\nvar actisenseString = `10EAFF${hexVoltage}${hexCurrent}`;\n\n// Set the formatted string in the message payload\nmsg.payload.actisenseString = actisenseString;\n\n// Return the modified message\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":400,"y":480,"wires":[["abcda3d2a27792db","67d37b2c0cad1e24"]]},{"id":"abcda3d2a27792db","type":"signalk-send-nmea2000","z":"3069492ed761c9d6","name":"","nmea2000Event":"nmea2000out","nmea2000JsonEvent":"nmea2000JsonOut","x":670,"y":440,"wires":[]},{"id":"1f95090207bca94a","type":"mqtt-broker","name":"","broker":"localhost","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]