Open Source Android App available on Google Play

Started by Graham, October 19, 2014, 11:29:58 AM

Previous topic - Next topic

dgd

Quote from: Graham on April 05, 2015, 10:48:32 AM
The old version (1.7.x) of my app worked with a tristar last summer, I haven't had a chance to test the version 2.x of the app with a real tristar.
The app will try to access modbus register 4101, if it succeeds then it assumes a classic, if it fails then it tries address 0001 (triStar) if that succeeds then it assumes it's a tristar.

Graham,
Do you have a modbus register map for the mppt Tristar or can you point me where to download it?
The only one I can find is corrupted and the d/l fails

dgd
Classic 250, 150,  20 140w, 6 250w PVs, 2Kw turbine, MN ac Clipper, Epanel/MNdc, Trace SW3024E (1997), Century 1050Ah 24V FLA (1999). Arduino power monitoring and web server.  Off grid since 4/2000
West Auckland, New Zealand

ClassicCrazy

Quote from: dgd on April 05, 2015, 04:45:58 PM
Quote from: Graham on April 05, 2015, 10:48:32 AM
The old version (1.7.x) of my app worked with a tristar last summer, I haven't had a chance to test the version 2.x of the app with a real tristar.
The app will try to access modbus register 4101, if it succeeds then it assumes a classic, if it fails then it tries address 0001 (triStar) if that succeeds then it assumes it's a tristar.

Graham,
Do you have a modbus register map for the mppt Tristar or can you point me where to download it?
The only one I can find is corrupted and the d/l fails

dgd

Do you mean this one dgd ? It just downloaded for me .
http://support.morningstarcorp.com/wp-content/uploads/2014/07/TSMPPT.APP_.Modbus.EN_.10.2.pdf
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

dgd

Thanks, thats it.
I needed to update adobe reader then it worked ok

dgd
Classic 250, 150,  20 140w, 6 250w PVs, 2Kw turbine, MN ac Clipper, Epanel/MNdc, Trace SW3024E (1997), Century 1050Ah 24V FLA (1999). Arduino power monitoring and web server.  Off grid since 4/2000
West Auckland, New Zealand

Resthome

Quote from: ClassicCrazy on April 05, 2015, 11:57:32 AM
Did you try restarting your classic ?
Seems like it took me awhile to get it to work or for it to show up on the new webpage. But I didn't know what I was doing so not sure exactly what made it finally show up .

I think Andrew has said in the past that any changes to the network parameters requires the Classic to be restarted. I wouldn't think that for effect the username/password not working on the new site. Just wouldn't see the Classic logging data.

Maybe set the Classic for auto restart at 23:59
John

10 x Kyocera KC140, Classic 150 w/WBJr, Link10 Battery Monitor, 850 AH @ 12v Solar One 2v cells, Xantrex PROwatt SW2000
Off Grid on Houseboat Lake Don Pedro, CA

atop8918

The network parameters are weird -- in fact most changes do not require a restart; however, the DNS settings, for some unimaginable reason, I did differently from the other settings and so any changes to the DNS settings (including setting the classic FROM STATIC to DHCP resulting in getting a new DNS server from the DHCP server) will require a reboot. I believe I rectified this in the latest network code but we still haven't released this for general consumption yet.
Sorry for the mess.

Graham

Quote from: dgd on April 05, 2015, 04:45:58 PM
Quote from: Graham on April 05, 2015, 10:48:32 AM
The old version (1.7.x) of my app worked with a tristar last summer, I haven't had a chance to test the version 2.x of the app with a real tristar.
The app will try to access modbus register 4101, if it succeeds then it assumes a classic, if it fails then it tries address 0001 (triStar) if that succeeds then it assumes it's a tristar.

Graham,
Do you have a modbus register map for the mppt Tristar or can you point me where to download it?
The only one I can find is corrupted and the d/l fails

dgd

Here are the registers I use for Tristar, the values need to be converted using the scaling factor found in register 1 & 3

Register[] registers = modbusMaster.readMultipleRegisters(0, 80);
                if (registers != null && registers.length == 80) {
                    readings.set(RegisterName.BatVoltage, VScale(registers[24].getValue()));
                    readings.set(RegisterName.PVVoltage, VScale(registers[27].getValue()));
                    readings.set(RegisterName.BatCurrent, IScale(registers[28].getValue()));
                    readings.set(RegisterName.PVCurrent, IScale(registers[29].getValue()));
                    readings.set(RegisterName.Power, PScale(registers[58].getValue()));
                    readings.set(RegisterName.EnergyToday, WHr(registers[68].getValue()));
                    readings.set(RegisterName.TotalEnergy, (float) registers[57].getValue());
                }

    private float WHr(float val) {
        val /= 1000;
        return val;
    }

    private float PScale(float val) {
        val = val * v_pu * i_pu;
        val /= 131072;
        return val;
    }

    private float VScale(float val) {
        val = val * v_pu;
        val /= 32768;
        return val;
    }

    private float IScale(float val) {
        val = val * i_pu;
        val /= 32768;
        return val;
    }

                if (registers != null && registers.length == 4) {
                    foundTriStar = registers[0].toShort() != 0;
                    if (foundTriStar) {
                        float hi = registers[0].toShort();
                        float lo = registers[1].toShort();
                        lo = lo / 65536;
                        v_pu = hi + lo;

                        hi = (float) registers[2].toShort();
                        lo = (float) registers[3].toShort();
                        lo = lo / 65536;
                        i_pu = hi + lo;
                        reference = 0;
                    }
                }
            }
Off-Grid Island cottage, Lac Simon QC Canada
370 Ahrs @ 24V (4 8L16 batteries)
4 x 250watt panels on dual axis trackers http://tinyurl.com/hfpkgr5
Classic 150, Whizbang Jr.
Android Monitor: http://tinyurl.com/lomzq3s

dgd

Thanks Graham
Those registers are all I probably need to get the Mppt Tristar interfaced via modbus RTU to my Arduino DUE web server. One of my customer sites has an unused  mppt60 since I installed a Classic 150 last year, time now to borrow it and start playing  :)

Dgd
Classic 250, 150,  20 140w, 6 250w PVs, 2Kw turbine, MN ac Clipper, Epanel/MNdc, Trace SW3024E (1997), Century 1050Ah 24V FLA (1999). Arduino power monitoring and web server.  Off grid since 4/2000
West Auckland, New Zealand

Graham

Quote from: dgd on April 06, 2015, 01:28:25 PM
Thanks Graham
Those registers are all I probably need to get the Mppt Tristar interfaced via modbus RTU to my Arduino DUE web server. One of my customer sites has an unused  mppt60 since I installed a Classic 150 last year, time now to borrow it and start playing  :)

Dgd

BTW
these offsets are origin 0 so register[24] is modbus register address 25 (I always get this wrong...)

here is a table I used in my netduino project with the address @ origin 1

// TriStar modbus table
//            new Register { Address = 1, Label = "V Scale", UnitOfMeasure = "", Conversion = socketAddress => U32(socketAddress)},
//            new Register { Address = 3, Label = "A Scale", UnitOfMeasure = "", Conversion = socketAddress => U32(socketAddress)},
//            new Register { Address = 25, Label = "Average battery voltage", UnitOfMeasure = "Volts", Conversion = socketAddress => VScale(socketAddress)},
//            new Register { Address = 28, Label = "PV input voltage", UnitOfMeasure = "Volts", Conversion = socketAddress => VScale(socketAddress)},
//            new Register { Address = 29, Label = "Average battery current", UnitOfMeasure = "Amps", Conversion = socketAddress => IScale(socketAddress)},
//            new Register { Address = 30, Label = "Average PV current", UnitOfMeasure = "Amps", Conversion = socketAddress => IScale(socketAddress)},
//            new Register { Address = 45, Label = "Info flag", UnitOfMeasure = "", Conversion = socketAddress => Info(socketAddress)},
//            new Register { Address = 51, Label = "Battery charge state", UnitOfMeasure = "", Conversion = socketAddress => ChargeState(socketAddress)},
//            new Register { Address = 58, Label = "Total kWhours", UnitOfMeasure = "kWh", Conversion = socketAddress => U16(socketAddress)},
//            new Register { Address = 59, Label = "Average power to the battery", UnitOfMeasure = "Watts", Conversion = socketAddress => PScale(socketAddress)},
//            new Register { Address = 69, Label = "Average energy to the battery", UnitOfMeasure = "kWh", Conversion = socketAddress => WHr(socketAddress)}

//            new Tupple { Description = "(Start) System startup.", Value = 0 },
//            new Tupple { Description = "(Night check) No power, detecting nightfall.", Value = 1 },
//            new Tupple { Description = "(Disconnected) No power.", Value = 2 },
//            new Tupple { Description = "(Night) No power, waiting for power source.", Value = 3 },
//            new Tupple { Description = "(Fault) Detected fault.", Value = 4 },
//            new Tupple { Description = "(Bulk) Max power point tracking until absorb voltage reached.", Value = 5 },
//            new Tupple { Description = "(Absorb) Regulating battery voltage at absorb set point until the batteries are charged.", Value = 6 },
//            new Tupple { Description = "(Float) Max power point tracking. Seeking float set point voltage.", Value = 7 },
//            new Tupple { Description = "(Equalize) Regulating battery voltage at equalize set point.", Value = 8 },
//            new Tupple { Description = "(Slave) State set by master charge controller.", Value = 9 }
Off-Grid Island cottage, Lac Simon QC Canada
370 Ahrs @ 24V (4 8L16 batteries)
4 x 250watt panels on dual axis trackers http://tinyurl.com/hfpkgr5
Classic 150, Whizbang Jr.
Android Monitor: http://tinyurl.com/lomzq3s

Resthome

Graham

Is it possible to  have the PVoutput transfer work if using your app with BlueStacks? Are the daily logs save somewhere when using BlueStacks?
John

10 x Kyocera KC140, Classic 150 w/WBJr, Link10 Battery Monitor, 850 AH @ 12v Solar One 2v cells, Xantrex PROwatt SW2000
Off Grid on Houseboat Lake Don Pedro, CA

Graham

Quote from: Resthome on April 07, 2015, 07:46:45 PM
Graham

Is it possible to  have the PVoutput transfer work if using your app with BlueStacks? Are the daily logs save somewhere when using BlueStacks?

It's the first time I hear about BlueStacks, I'll try it later this week.
Are you on Windows 7?

Graham.
Off-Grid Island cottage, Lac Simon QC Canada
370 Ahrs @ 24V (4 8L16 batteries)
4 x 250watt panels on dual axis trackers http://tinyurl.com/hfpkgr5
Classic 150, Whizbang Jr.
Android Monitor: http://tinyurl.com/lomzq3s

Resthome

Quote from: Graham on April 08, 2015, 09:10:15 AM
Quote from: Resthome on April 07, 2015, 07:46:45 PM
Graham

Is it possible to  have the PVoutput transfer work if using your app with BlueStacks? Are the daily logs save somewhere when using BlueStacks?

It's the first time I hear about BlueStacks, I'll try it later this week.
Are you on Windows 7?

Graham.

I'm on Win8.1
John

10 x Kyocera KC140, Classic 150 w/WBJr, Link10 Battery Monitor, 850 AH @ 12v Solar One 2v cells, Xantrex PROwatt SW2000
Off Grid on Houseboat Lake Don Pedro, CA

Graham

Quote from: Resthome on April 07, 2015, 07:46:45 PM
Graham

Is it possible to  have the PVoutput transfer work if using your app with BlueStacks? Are the daily logs save somewhere when using BlueStacks?


I finally got around to testing the app under bluestacks with the pvOutput upload

I ran wireshark to monitor the ip.dst==pvoutput.org with the test site http://pvoutput.org/list.jsp?id=30606&sid=28034

it took a couple of minutes to get started but it worked,
you can clear the log file in the app in the settings and try the upload again by restarting the app after pressing clear logs...

Graham.
Off-Grid Island cottage, Lac Simon QC Canada
370 Ahrs @ 24V (4 8L16 batteries)
4 x 250watt panels on dual axis trackers http://tinyurl.com/hfpkgr5
Classic 150, Whizbang Jr.
Android Monitor: http://tinyurl.com/lomzq3s

Resthome

Clearing the logs seem to be the trick. Thanks Graham
John

10 x Kyocera KC140, Classic 150 w/WBJr, Link10 Battery Monitor, 850 AH @ 12v Solar One 2v cells, Xantrex PROwatt SW2000
Off Grid on Houseboat Lake Don Pedro, CA