项目作者: awysocki

项目描述 :
SG series of Micro Inverters from 250 all the up to 1400
高级语言: C
项目地址: git://github.com/awysocki/databox24.git
创建时间: 2021-01-28T22:59:50Z
项目社区:https://github.com/awysocki/databox24

开源协议:

下载


DATABOX24 - Polling SG700MD

databox24 is a simple ‘c’ application to read a communication port that is attached to
the newenergytek.com DATA BOX that is connected via USB port to your linux machine
it will communicate to the SG Series of micro inverters.
200,250,300,350,400,450,500,600,700,1000,1200 and 1400

I have only tested on model SG700MD - http://www.newenergytek.com/index.php/content-48

This is a very simple server gateway app to poll and send the data to a web server to be processed.

Device

[DATA BOX 24G] - New Engery Tek (no version number or model on the unit )

[note:] I did receive a response from the company, and they gave me a quick layout of the data. I have updated
my code to reflect their definition of the data.

CMD - Get Status (15 bytes total)

  1. 0x43 - Header (1 byte)
  2. 0xC0 - CMD - 0xC0=Device status (1 byte)
  3. 0x1122 - Databox ID (2 bytes)
  4. 0x0000 - Area ID (2 bytes) What is passed in is returned
  5. 0x11223344 - Inverter ID (4 bytes)
  6. 0x11223344 - Value Parameter (4 byte) 0x00=Status, 0x01=Turn ON, 0x02=Turn OFF, 0x03=Reboot
  7. 0xCD - Check Digit

RCV - Receive Status (27 bytes total (15 CMD header + 12 bytes Status))

  1. 0x43 - Header (1 byte)
  2. 0xC0 - CMD - 0xC0=Device status (1 byte)
  3. 0x1122 - Databox ID (2 bytes)
  4. 0x0000 - Area ID (2 bytes) Whatever is passed in is returned back
  5. 0x11223344 - Inverter ID (4 bytes)
  6. 0x11223344 - Total Power Generations (4 Byte Float)
  7. 0xCD - Check Digit (1 byte)
  8. 0x1122 - DC Voltage divide by 100 for 2 places after decimal point (2 bytes)
  9. 0x1122 - DC Current divide by 100 for 2 places after decimal point (2 bytes)
  10. 0x1122 - AC Voltage divide by 100 for 2 places after decimal point (2 bytes)
  11. 0x1122 - AC Current divide by 100 for 2 places after decimal point (2 bytes)
  12. 0x0000 - Reserved (2 bytes)
  13. 0x00 - xx UNKNOWN (1 byte)
  14. 0x11 - Temperature C° (1 byte)

Computer

I tested and run this application on an Intel NUC machine.

STEP #1 - Check and find the port that your linux machine assigned when plugging in the DATABOX wireless modem
-
run -> lsusb
Look for bus and device

Bus 001 Device 012: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

also run -> sudo dmesg

To list the port number it assigns

stty -F /dev/ttyUSB0 9600 cs8 -cstopb -parenb

STEP #2 - Compile application
-

Pull the files to a directory and run make to compile the application.

  1. make

Also supported is a clean make command

  1. make clean

STEP #4 - Install/RUN
-

There is no install script, so I just run it where its compiled.
You will want to edit and modify the databox24.ini file to match your setup

  1. [DataBox24]
  2. Debug=Yes
  3. DebugLog=./databox24.log
  4. USBDev=/dev/ttyUSB0
  5. Inverters=41000001,41000002,41000003
  6. PollTimeMin=1
  7. PostWrite=Yes
  8. PostHost=https://yourwebserver/databox24.php
  9. CSVWrite=No
  10. CSVFile=./databox24.csv

License
-

Open Software License v. 3.0 (OSL-3.0)