
Reputation Activity
-
system32 reacted to Bobster. in Feeding back to grid- challengesMy system is registered with the City. I don't know how tedious it was because I signed a letter empowering the engineering company to act as proxy for me. Then they took care of everything, right up to arranging the visit by the City's inspection team. I figured this was worth doing because, in fact, the requirement to register has been on the books for some years, and whilst the City aren't paying a lot of attention right now, and are being lenient about retrospective registrations, this won't last and eventually they will get around to enforcement.
Anyway, I still don't sell back. And it is a pity. I wouldn't have a large excess, but I would give it away as long as doing so was cost neutral to me. But I can only lose in Johannesburg under the City's current tariffs.
-
system32 got a reaction from mzezman in SunSynk 8k + Hubble AM2 + 16x400W PV3 year update - Solar PV & battery were installed 21 Nov 2021.
In 2023, 79.7% of my kWh came from Solar / Self generated.
20.3% comes from grid - mostly cloudy days and winter (where we use electric heaters)
Outages > 4h:
We experienced a total of 417h18m/17d9h18m in 180 incidents of outages (load shedding)
We were not impacted by outages.
The grid meter readings from the CoJ Meter and the consumption is from a Hiking DDS238-2 WiFi meter.
The decrease in self generation can be attributed to me changing the SoC threshold from 20% to 30% due to stage 5/6 load shedding earlier in the cycle.
Thinking of setting the SoC threshold back to 20%.
I've saved R65,611 over the three years (about 30% of the investment).
CoJ have added a R230 fixed fee to prepaid (with larger fixed fee to come).
Also Eskom want a 43.55% increase for municipalities for 2025.
These increases seem to make it financially viable to add another 5kWh battery and 8xPV panels to go from 80% to 95% off-grid which I'm considering.
-
system32 got a reaction from Garthox in SunSynk 8k + Hubble AM2 + 16x400W PV3 year update - Solar PV & battery were installed 21 Nov 2021.
In 2023, 79.7% of my kWh came from Solar / Self generated.
20.3% comes from grid - mostly cloudy days and winter (where we use electric heaters)
Outages > 4h:
We experienced a total of 417h18m/17d9h18m in 180 incidents of outages (load shedding)
We were not impacted by outages.
The grid meter readings from the CoJ Meter and the consumption is from a Hiking DDS238-2 WiFi meter.
The decrease in self generation can be attributed to me changing the SoC threshold from 20% to 30% due to stage 5/6 load shedding earlier in the cycle.
Thinking of setting the SoC threshold back to 20%.
I've saved R65,611 over the three years (about 30% of the investment).
CoJ have added a R230 fixed fee to prepaid (with larger fixed fee to come).
Also Eskom want a 43.55% increase for municipalities for 2025.
These increases seem to make it financially viable to add another 5kWh battery and 8xPV panels to go from 80% to 95% off-grid which I'm considering.
-
system32 got a reaction from WannabeSolarSparky in Feeding back to grid- challengesIt's very common for homes to sell excess to grid - read up on Australia and California and Europe.
Not so common in South Africa for homes to grid feed due to:
registering process is is tedious (red tape) - needs streamlining registration process is costly due to consultants - needs streamlining bi-directional meter can be expensive - need cheaper meters limited to "net-zero" - can only receive money for what you consume - allow to sell all generated PV electricity rates paid to consumers are low making cost recovery difficult - better rates (eg CT has better rates) Most of us just give up and only self-use.
This is a real pity as lots of excess home PV electricity power goes to waste.
Not sure why Metros don't encourage electricity from home users.
1kWh from the my PV system is the same as 1kWh from Eskom and mine is much cheaper.
If the grid-feed was encouraged, then new installs would be built and sized for that.
Instead they sized home PV for self consumption.
Electricity Minister Kgosientsho Ramokgopa needs to push Nersa, Eskom, Metros to fix the process for the benefit of the country.
-
system32 got a reaction from Travis Slier in Eskom coming for solar usersEskom is making the finance case to add an additional battery add 8 more panels and go from 20% grid usage to 0% grid usage.
Then I disconnect and go 100% offgrid.
Problem solved.
-
system32 reacted to Beat in Solar Assistant not seeing 3x Bluenova batteriesI had similar problem with LEOCH batteries. Finally Averge instructed that all packs must be parallel connected with RS485 and then to my laptop with a RS485/USB adapter.
The newest version of the 48100-S battery needs a protocol change to communicate with RS485. Important: set on each pack a different identification address on the dip switches.
-
system32 got a reaction from TheMafiaMan - NotMuffinMan in Eskom coming for solar usersEskom is making the finance case to add an additional battery add 8 more panels and go from 20% grid usage to 0% grid usage.
Then I disconnect and go 100% offgrid.
Problem solved.
-
system32 got a reaction from zsde in Eskom coming for solar usersEskom is making the finance case to add an additional battery add 8 more panels and go from 20% grid usage to 0% grid usage.
Then I disconnect and go 100% offgrid.
Problem solved.
-
system32 got a reaction from Jacques Ester in Eskom coming for solar usersEskom is making the finance case to add an additional battery add 8 more panels and go from 20% grid usage to 0% grid usage.
Then I disconnect and go 100% offgrid.
Problem solved.
-
system32 got a reaction from WannabeSolarSparky in Eskom coming for solar usersEskom is making the finance case to add an additional battery add 8 more panels and go from 20% grid usage to 0% grid usage.
Then I disconnect and go 100% offgrid.
Problem solved.
-
system32 got a reaction from james naidoo in Eskom coming for solar usersEskom is making the finance case to add an additional battery add 8 more panels and go from 20% grid usage to 0% grid usage.
Then I disconnect and go 100% offgrid.
Problem solved.
-
system32 got a reaction from ibiza in Eskom coming for solar usersEskom is making the finance case to add an additional battery add 8 more panels and go from 20% grid usage to 0% grid usage.
Then I disconnect and go 100% offgrid.
Problem solved.
-
Batteries are like so many things - they're a resource that you have to manage. One management task is to maximise the electrical work done during the sunny hours, leaving less for the battery to do after hours.
I have half the battery that Jacques does. I get through the night. My rule of thumb is that if the battery is fully charged at 16:00 then I will be OK (above 40% SOC) until 8:00 the next day, as long as nobody goes bonkers with appliances in the morning. By 8:00 the sun will be up, or I will have given dire warnings to all and sundry (IE wife, housekeeper, dog) about the need to be careful. Though I am less bellicose about this now because we are 200-and-something days without load shedding.
But I still want to get through the night on batteries. That keeps the bill down.
At night we have 3 fridges/freezers running (all fairly new, with inverter drives), external lights on (LED, they draw next to nothing), wifi, alarm, electric fence, TV, some interior lights, occasional use of kettle and air fryer. So we have adjusted our routines to, as I said, make as much use as we can of free power from the sun and don't do a lot at night. It helps that we have a full gas stove, but if we had electric we'd be observing the same routines anyway. Water heating is done with a heat pump (much more efficient than a regular geyser) and twice a day (early morning, which is included in my "until 8:00" calculations) and then again at midday. The geyser has a blanket on it to reduce heat losses.
I think most homes would struggle to get through the night consistently on 5kWh (effectively 4.5, since the battery usually shuts down at 10% remaining SOC), though I sometimes come in at that mark, but with 10 and some discipline it's definitely doable.
My system is set to resort to grid if SOC gets to 40%, so I will always have at least 3kWh of backup in the event of an outage. If we had a power cut starting early morning and overcast weather, then I might get through to 11:30 with some restraint. Getting all the way off the grid is hard, but you can certainly make a big difference to your bill.
Though I'm not making the difference that Jacques is.
-
system32 got a reaction from flatfourfan in Max panels with Sunsynk 8kw hybrid inverterHere is an example with 400W panels:
https://solar.co.za/how-to-size-a-pv-array#cs3
-
system32 got a reaction from LUMOnergy in Hubble Lithium Battery AM-2 5.5kWhThe batteries are in a shaded, well ventilated large basement garage.
The garage is at Johannesburg indoor temperatures.
The garage is too big to cool.
The garage is used for my motor bike & bicycle. (no car)
The temperature above is whilst charging.
What's your temperature whilst peak charging?
EDIT:
SA seems to report the wrong temperatures compared to RIOT.
-
system32 reacted to madness_za in Inverter settings in absence of load sheddingWithout panels it’s not even worth cycling the battery at night because it’s gonna cost you to grid charge and you lose due to conversion inefficiency. I would switch over to grid completely and boot up the inverter maybe once a week to charge, then shut down
-
system32 reacted to Bl4d3 in City Power pre-paid disconnectionsHappened to my parents this past weekend. They bought as much as they could before the increase. Since then, they havent bought any units because they have about 2000 units in the meter.
They still used the utility to run the oven + charge up batteries, but didnt need to buy.
Come Sunday, power is off. They phoned CoCT who sent someone out within an hour. They were told that they were disconnected because they are clearly tampering with the meter. A new meter was fitted and they lost all 1500 remaining units. They were told they're now being investigated but not to expect to get any of their units back and they wont get any answers for at least 2 months.
-
system32 got a reaction from james naidoo in City Power pre-paid disconnectionsUnethical and unfair to disconnect you because you don't buy for a few months.
Then to demand R12,000 to reconnect is completely outrageous.
I'm also on CoJ pre-paid.
Fortunately I'd heard of this disconnect issue, so I decided to purchase a small amount every month.
No issues so far with CoJ.
-
system32 reacted to macafrican in Feeding back to grid- challengesIt’s really not that big an issue and we have NRS that limit capacity export. The variability in a minute of my solar is LESS than the variability in a minute of my loads. The grid handles fine my loads ranging eg between 200 and 250kw in a minute, it handles exact same way, my solar export ranging between 200 and 250 kw.
As long as users stick to decent equipment and connect correctly, distributed generation actually IMPROVES the distribution grid because we help lift voltage in the street. When they get smart, we will get to stage where I only export in peak time of use when they have a big need but then they need to pay me properly. Then I’ll export from battery a constant kVA value.
There are far too many people spreading doubt, uncertainty, fear. Usually those councils that don’t like losing revenue, or people selling solutions that need to pretend things are difficult.
-
system32 reacted to Bobster. in Feeding back to grid- challengesNot my business really, but is your system registered with your utility? Most places you will need a special meter to sell back, and the regular meter will either trip when the current starts going the wrong way, or will bill you as if you were drawing the same amount from the grid.
Certainly in Johannesburg if you are serviced by City Power you need to first register your system with them, then switch to the reseller's tariff which carries extra admin fees and which requires a special meter - at your expense. Which is why I don't sell back: I wouldn't even break even, I can only lose on the deal.
-
@system32
Just had to pop in and say thank you for sharing this information. I appreciate it more than you know.
I translated this into arduino code for an ESP32 and it seem to work just fine. The documentation I have on how to read the inverter via Rs232 does not include the CRC bytes.
To give some back , Incase anyone is interested in example code, see below.
The ESP32 runs a web server and the second serial RX,TX pins GPIO 16 & 17 is connected to the inverter's RS232 port using a TTL converter.
You can send a request for any register you want and it will read 3 of them at a time starting with the one you requested. and it will save the RAW hex to a log file on the ESP32's flash memory.
Special Note: Most TTL converters that comes with a DB 9 is a female port and my Sunsynk 5Kw inverter's port is also female. A gender changer does not work for some reason. (Unless the one i have is faulty , I did check the pins with a multimeter and it looks fine, or my brain is too small to visualize where the RX TX pins has to go 🙂 )
I created a temporary Frankenstein board that allows me to tap into the TX/RX lines along with a 5V voltage regulator to bring down 12V to 5V for the VIN pin on the ESP32.
Warning an LM7805 becomes extremely hot and will most probably give up if you use it for long periods, this was just a proof of concept.
Once the server is up,
you can request any value you want.
http://ipaddress/send?registeraddress=182 and then retrieve the response like this
http://ipaddress/log
#include "LittleFS.h" #include <WiFi.h> #include <WiFiClient.h> #include <WebServer.h> const char* ssid = "SSID"; const char* password = "PASSWORD"; WebServer server(80); //Define Serial Port 2 #define RXD2 16 #define TXD2 17 int incomingBytePort2=0; void setup() { pinMode(2, OUTPUT); digitalWrite(2, LOW); Serial.begin(9600); // opens serial port, sets data rate to 9600 bps Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2); LittleFS.begin(); WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); Serial.print("Connecting "); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.print("Connected to "); Serial.println(ssid); Serial.print("IP address: "); Serial.println(WiFi.localIP()); server.on("/", handleRoot); server.on("/log",ServeLog); server.on("/deletelog", DeleteLog); server.on("/formatfs",FormatFS); server.on("/send",SendCMD); server.begin(); } void loop() { server.handleClient(); // Read Serial Port 2 if (Serial2.available() > 0) { // read the incoming byte: incomingBytePort2 = Serial2.read(); Serial.print(incomingBytePort2, HEX); Serial.print(","); File file = LittleFS.open("/log.txt", FILE_APPEND); file.print(String(incomingBytePort2,HEX)); file.print(","); file.close(); } } void ServeLog(){ File file = LittleFS.open("/log.txt", "r"); size_t sent = server.streamFile(file, "text/plain"); file.close(); } void handleRoot() { String MainPage=""; MainPage = MainPage + "<a href=""/formatfs"">Format Filesystem</a><br><br><br>"; MainPage = MainPage + "<a href=""/deletelog"">Delete Log</a><br><br><br>"; MainPage = MainPage + "<a href=""/log"">View Log</a><br><br><br>"; MainPage = MainPage + "URL Example /send?registeraddress=184<br><br>"; MainPage = MainPage + "<a href=""/send?registeraddress=182"">Send CMD 182, Batt Temp, Batt Voltage, Batt Capacity </a><br><br><br>"; server.send(200, "text/html", MainPage); } void DeleteLog(){ LittleFS.remove("/log.txt"); server.send(200, "text/plain", "log.txt deleted"); } void FormatFS(){ LittleFS.format(); server.send(200, "text/plain", "FS Formatted"); } void SendCMD(){ int registeraddress=0; String strRegisterAddress=""; for (uint8_t i = 0; i < server.args(); i++) { //Serial.println(server.argName(i)); if(server.argName(i)=="registeraddress") { Serial.println(""); Serial.print("Reading Register:"); Serial.print(server.arg(i)); strRegisterAddress = server.arg(i); registeraddress=strRegisterAddress.toInt(); } } Serial.println(""); Serial.println("Sending Read Request...."); int slave = 1; int count = 3; read_registers(slave, registeraddress, count); server.send(200, "text/plain", "cmd sent"); } // https://github.com/LacobusVentura/MODBUS-CRC16 static uint16_t MODBUS_CRC16_v3(const unsigned char *buf, unsigned int len) { static const uint16_t table[256] = { 0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241, 0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440, 0xCC01, 0x0CC0, 0x0D80, 0xCD41, 0x0F00, 0xCFC1, 0xCE81, 0x0E40, 0x0A00, 0xCAC1, 0xCB81, 0x0B40, 0xC901, 0x09C0, 0x0880, 0xC841, 0xD801, 0x18C0, 0x1980, 0xD941, 0x1B00, 0xDBC1, 0xDA81, 0x1A40, 0x1E00, 0xDEC1, 0xDF81, 0x1F40, 0xDD01, 0x1DC0, 0x1C80, 0xDC41, 0x1400, 0xD4C1, 0xD581, 0x1540, 0xD701, 0x17C0, 0x1680, 0xD641, 0xD201, 0x12C0, 0x1380, 0xD341, 0x1100, 0xD1C1, 0xD081, 0x1040, 0xF001, 0x30C0, 0x3180, 0xF141, 0x3300, 0xF3C1, 0xF281, 0x3240, 0x3600, 0xF6C1, 0xF781, 0x3740, 0xF501, 0x35C0, 0x3480, 0xF441, 0x3C00, 0xFCC1, 0xFD81, 0x3D40, 0xFF01, 0x3FC0, 0x3E80, 0xFE41, 0xFA01, 0x3AC0, 0x3B80, 0xFB41, 0x3900, 0xF9C1, 0xF881, 0x3840, 0x2800, 0xE8C1, 0xE981, 0x2940, 0xEB01, 0x2BC0, 0x2A80, 0xEA41, 0xEE01, 0x2EC0, 0x2F80, 0xEF41, 0x2D00, 0xEDC1, 0xEC81, 0x2C40, 0xE401, 0x24C0, 0x2580, 0xE541, 0x2700, 0xE7C1, 0xE681, 0x2640, 0x2200, 0xE2C1, 0xE381, 0x2340, 0xE101, 0x21C0, 0x2080, 0xE041, 0xA001, 0x60C0, 0x6180, 0xA141, 0x6300, 0xA3C1, 0xA281, 0x6240, 0x6600, 0xA6C1, 0xA781, 0x6740, 0xA501, 0x65C0, 0x6480, 0xA441, 0x6C00, 0xACC1, 0xAD81, 0x6D40, 0xAF01, 0x6FC0, 0x6E80, 0xAE41, 0xAA01, 0x6AC0, 0x6B80, 0xAB41, 0x6900, 0xA9C1, 0xA881, 0x6840, 0x7800, 0xB8C1, 0xB981, 0x7940, 0xBB01, 0x7BC0, 0x7A80, 0xBA41, 0xBE01, 0x7EC0, 0x7F80, 0xBF41, 0x7D00, 0xBDC1, 0xBC81, 0x7C40, 0xB401, 0x74C0, 0x7580, 0xB541, 0x7700, 0xB7C1, 0xB681, 0x7640, 0x7200, 0xB2C1, 0xB381, 0x7340, 0xB101, 0x71C0, 0x7080, 0xB041, 0x5000, 0x90C1, 0x9181, 0x5140, 0x9301, 0x53C0, 0x5280, 0x9241, 0x9601, 0x56C0, 0x5780, 0x9741, 0x5500, 0x95C1, 0x9481, 0x5440, 0x9C01, 0x5CC0, 0x5D80, 0x9D41, 0x5F00, 0x9FC1, 0x9E81, 0x5E40, 0x5A00, 0x9AC1, 0x9B81, 0x5B40, 0x9901, 0x59C0, 0x5880, 0x9841, 0x8801, 0x48C0, 0x4980, 0x8941, 0x4B00, 0x8BC1, 0x8A81, 0x4A40, 0x4E00, 0x8EC1, 0x8F81, 0x4F40, 0x8D01, 0x4DC0, 0x4C80, 0x8C41, 0x4400, 0x84C1, 0x8581, 0x4540, 0x8701, 0x47C0, 0x4680, 0x8641, 0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040 }; uint8_t Xor = 0; uint16_t crc = 0xFFFF; while (len--) { Xor = (*buf++) ^ crc; crc >>= 8; crc ^= table[Xor]; } return crc; } // https://modbus.org/docs/PI_MBUS_300.pdf int read_registers(uint8_t slave, uint16_t registeraddress, uint16_t number_of_registers) { // See Data and Control Functions - Page 19 // PI_MBUS_300.pdf - Figure 7 Master Query with ASCII/RTU Framing // send cmd buffer to slave byte cmd_buffer[8] = {0}; cmd_buffer[0] = slave; cmd_buffer[1] = 3; // READ REGISTERS cmd_buffer[2] = highByte(registeraddress); cmd_buffer[3] = lowByte(registeraddress); cmd_buffer[4] = highByte(number_of_registers); cmd_buffer[5] = lowByte(number_of_registers); uint16_t crc = MODBUS_CRC16_v3(cmd_buffer, 6); cmd_buffer[6] = lowByte(crc); cmd_buffer[7] = highByte(crc); //Serial.print("cmd_buffer="); //Serial.print(cmd_buffer); //Serial.println(sizeof(cmd_buffer)); Serial2.write(cmd_buffer, sizeof(cmd_buffer)); return 0; }
-
system32 got a reaction from MartinViljoen in Sunsynk RS485 Modbus RTU request, bytes level/* * g++ -std=c++17 -o read_registers read_registers.cpp * Author: system32 * Date: 17 Jun 2022 * Version: 0.1 * Copyright: public domain * * See: * https://modbus.org/specs.php * https://modbus.org/docs/PI_MBUS_300.pdf * https://github.com/LacobusVentura/MODBUS-CRC16 * https://www.cmrr.umn.edu/~strupp/serial.html */ #include <string> #include <unistd.h> #include <fcntl.h> #include <termios.h> /* POSIX terminal control definitions */ #include <iostream> // macro version https://www.microchip.com/forums/m393549.aspx #define GET_LO_BYTE(a) *((uint8_t *)&a) #define GET_HI_BYTE(a) *(((uint8_t *)&a) + 1) using namespace std; // https://github.com/LacobusVentura/MODBUS-CRC16 static uint16_t MODBUS_CRC16_v3(const unsigned char *buf, unsigned int len) { static const uint16_t table[256] = { 0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241, 0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440, 0xCC01, 0x0CC0, 0x0D80, 0xCD41, 0x0F00, 0xCFC1, 0xCE81, 0x0E40, 0x0A00, 0xCAC1, 0xCB81, 0x0B40, 0xC901, 0x09C0, 0x0880, 0xC841, 0xD801, 0x18C0, 0x1980, 0xD941, 0x1B00, 0xDBC1, 0xDA81, 0x1A40, 0x1E00, 0xDEC1, 0xDF81, 0x1F40, 0xDD01, 0x1DC0, 0x1C80, 0xDC41, 0x1400, 0xD4C1, 0xD581, 0x1540, 0xD701, 0x17C0, 0x1680, 0xD641, 0xD201, 0x12C0, 0x1380, 0xD341, 0x1100, 0xD1C1, 0xD081, 0x1040, 0xF001, 0x30C0, 0x3180, 0xF141, 0x3300, 0xF3C1, 0xF281, 0x3240, 0x3600, 0xF6C1, 0xF781, 0x3740, 0xF501, 0x35C0, 0x3480, 0xF441, 0x3C00, 0xFCC1, 0xFD81, 0x3D40, 0xFF01, 0x3FC0, 0x3E80, 0xFE41, 0xFA01, 0x3AC0, 0x3B80, 0xFB41, 0x3900, 0xF9C1, 0xF881, 0x3840, 0x2800, 0xE8C1, 0xE981, 0x2940, 0xEB01, 0x2BC0, 0x2A80, 0xEA41, 0xEE01, 0x2EC0, 0x2F80, 0xEF41, 0x2D00, 0xEDC1, 0xEC81, 0x2C40, 0xE401, 0x24C0, 0x2580, 0xE541, 0x2700, 0xE7C1, 0xE681, 0x2640, 0x2200, 0xE2C1, 0xE381, 0x2340, 0xE101, 0x21C0, 0x2080, 0xE041, 0xA001, 0x60C0, 0x6180, 0xA141, 0x6300, 0xA3C1, 0xA281, 0x6240, 0x6600, 0xA6C1, 0xA781, 0x6740, 0xA501, 0x65C0, 0x6480, 0xA441, 0x6C00, 0xACC1, 0xAD81, 0x6D40, 0xAF01, 0x6FC0, 0x6E80, 0xAE41, 0xAA01, 0x6AC0, 0x6B80, 0xAB41, 0x6900, 0xA9C1, 0xA881, 0x6840, 0x7800, 0xB8C1, 0xB981, 0x7940, 0xBB01, 0x7BC0, 0x7A80, 0xBA41, 0xBE01, 0x7EC0, 0x7F80, 0xBF41, 0x7D00, 0xBDC1, 0xBC81, 0x7C40, 0xB401, 0x74C0, 0x7580, 0xB541, 0x7700, 0xB7C1, 0xB681, 0x7640, 0x7200, 0xB2C1, 0xB381, 0x7340, 0xB101, 0x71C0, 0x7080, 0xB041, 0x5000, 0x90C1, 0x9181, 0x5140, 0x9301, 0x53C0, 0x5280, 0x9241, 0x9601, 0x56C0, 0x5780, 0x9741, 0x5500, 0x95C1, 0x9481, 0x5440, 0x9C01, 0x5CC0, 0x5D80, 0x9D41, 0x5F00, 0x9FC1, 0x9E81, 0x5E40, 0x5A00, 0x9AC1, 0x9B81, 0x5B40, 0x9901, 0x59C0, 0x5880, 0x9841, 0x8801, 0x48C0, 0x4980, 0x8941, 0x4B00, 0x8BC1, 0x8A81, 0x4A40, 0x4E00, 0x8EC1, 0x8F81, 0x4F40, 0x8D01, 0x4DC0, 0x4C80, 0x8C41, 0x4400, 0x84C1, 0x8581, 0x4540, 0x8701, 0x47C0, 0x4680, 0x8641, 0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040 }; uint8_t Xor = 0; uint16_t crc = 0xFFFF; while (len--) { Xor = (*buf++) ^ crc; crc >>= 8; crc ^= table[Xor]; } return crc; } // https://www.cmrr.umn.edu/~strupp/serial.html int open_serial(const std::string& port, const speed_t baud) { // open a serial port and return fd int fd = open(port.c_str(), O_RDWR | O_NOCTTY | O_NDELAY); if (fd == -1) { perror(("open_serial: unable to open " + port).c_str()); exit(1); } // fcntl(fd, F_SETFL, FNDELAY); // no delay read fcntl(fd, F_SETFL, 0); // blocked read struct termios options; tcgetattr(fd, &options); // Get the current options for the port... cfsetspeed(&options, baud); // Set the baud rates cfmakeraw(&options); // Enable Raw Mode options.c_cc[VMIN] = 0; options.c_cc[VTIME] = 10; // 1 second timeout tcsetattr(fd, TCSANOW, &options); // Set the new options for the port... return fd; } void print_buffer(const char* msg, const uint8_t buffer[], int count) { printf(msg); for (int i=0; i<count; i++) if (i+1 < count) printf("0x%.2x, ", buffer[i]); else printf("0x%.2x\n", buffer[i]); } // https://modbus.org/docs/PI_MBUS_300.pdf int read_registers(int fd, uint8_t slave, uint16_t registeraddress, uint16_t number_of_registers) { // See Data and Control Functions - Page 19 // PI_MBUS_300.pdf - Figure 7 Master Query with ASCII/RTU Framing // send cmd buffer to slave uint8_t cmd_buffer[8] = {0}; cmd_buffer[0] = slave; cmd_buffer[1] = 3; // READ REGISTERS cmd_buffer[2] = GET_HI_BYTE(registeraddress); cmd_buffer[3] = GET_LO_BYTE(registeraddress); cmd_buffer[4] = GET_HI_BYTE(number_of_registers); cmd_buffer[5] = GET_LO_BYTE(number_of_registers); uint16_t crc = MODBUS_CRC16_v3(cmd_buffer, 6); cmd_buffer[6] = GET_LO_BYTE(crc); cmd_buffer[7] = GET_HI_BYTE(crc); print_buffer("cmd_buffer=",cmd_buffer,sizeof(cmd_buffer)); write(fd, cmd_buffer, sizeof(cmd_buffer)); sleep(1); // read the result // See PI_MBUS_300.pdf - Figure 8 Slave Response with ASCII/RTU Framing uint8_t result_buffer[64] = {0}; int expect = 5 + number_of_registers * 2; size_t rc = read(fd, result_buffer, expect); print_buffer("result_buffer=",result_buffer,expect); return 0; } int main(int argc, char** argv) { int fd = open_serial("/dev/ttyUSB0", B9600); int slave = 1; int registeraddress = 182; int count = 3; read_registers(fd, slave, registeraddress, count); close(fd); return 0; } Tested on RPI3 attached to SunSynk 8k
cmd_buffer=0x01, 0x03, 0x00, 0xb6, 0x00, 0x03, 0xe4, 0x2d
result_buffer=0x01, 0x03, 0x06, 0x04, 0xbc, 0x14, 0x6d, 0x00, 0x5c, 0xe5, 0x3e
Register 182 (Temperature) = 0x04bc = (1212 - 1000)/10 = 21.2C
Register 183 (Volts) = 0x146d = 5229 / 100 = 52.29V
Register 184 (SoC) = 0x005c = 92%
-
system32 got a reaction from JacquesStrydom in Deye 8kw Power DC Clipping at 9000WJust to confirm:
The Deye 8k has 2 MPPT controllers.
You have connected the solar panels as follows:
MPPT1: 8s+8s x 460W NE = 7360W MPPT2: 8s x 460W NW = 3680W The reason I'm asking is I'm considering adding an additional string to my Sunsynk 8k.
Now:
MPPT1: 8s x 400W N = 3200W MPPT2: 8s x 400W N = 3200W Proposed:
MPPT1: 8s+8s x 400W N = 6400W MPPT2: 8s x 400W E = 3200W Sorry, not trying to go off-topic, but I think many are interested in adding more strings.
Thanks in advance.
-
system32 got a reaction from Yellow Measure in City of Joburg - 2024/2025 Prepaid RatesWhat happens if I don't buy prepaid for 3 months?
Will I have to pay 3x230 on my next purchase?
I understand there are ~275,372 prepaid meters in CoJ, so this will generate:
R63.3m per month extra taxes for no improvement in service.
Also in the OP, CoJ don't mention the total increase
Why is there an R70+VAT admin fee on prepaid?
R2,360.57 - R1,916.76 = R443.81 increase per month
R2,714.66 - R2,204.27 = R510.38 increase inc VAT per month or 23.2% increase - not the 12.72% they brag about.
I use ~300kWh per month, which results in a 45% increase - this is unaffordable.
-
Friends!
I bring to your attention the program for monitoring a solar station on Deye inverters.
The program is still under development, but the presented functionality works.
You can download and use it.
Program website: http://doro.poltava.ua/dsolar/index.html
The program interface is in English (by default) and Ukrainian.