for the Classic: Webview and server for the datas?

Started by binkino, September 15, 2017, 09:28:40 AM

Previous topic - Next topic

binkino

Hi,
like I wrote time ago, I would be happy to have something like a server /buffer, that reads the datas from the classic, and I can access to it by more then one device.
Also it would a really useful thing, if I could display all these datas on a website.

So i.e. a PI could read the datas from the Classic(s) and serve/share them to other devices.

I am sure, I am not the only one who runs into that problem, has installed i.e. Graham's great Apk on one tablet, and on a smartphone, and why ever, the app is open on one device and you can not access from the other device.
That happens often to me, either I forget to close the app at home, or something wakes up the display of the tablet at home, with this the app is active again.


BUT I have no idea how th do this.

I know, that the Classic gives datas via USB port too. Should the Classic(s) be connected to the PI via USB or let the PI read the datas via LAN?

When the PI has read the datas, it must serve these datas to a device, asking in the PI's Addresse and port(s)

Also on a website, some scripts or so, must ask the PI for this and that datas.

My easy way to think about it.



It would also be a good thing, if it would be possible, to send a command to the classic, to switch an AUX on/off/auto, for manual override i.e. the fan or what ever a user wants to switch.
(like, you have an inverter, that itself switches between grid and battery, but you know there will come enough energy today, and you have a relay to disconnet the inverter, that then works like a UPS. To open everytime the LA is to much thing. Also the old problem here, ony one device, and on a phone or tablet, you get mad to do some changes)

PV-OUTPUT: http://pvoutput.org/list.jsp?id=38617
Classic Lite 200 + Classic 200 + Easun ISolar-SMX-II-5.6KW + 12x240Wp + 12x255Wp + 2x10kWh LFP
http://a68k.de/Solar/Monitor_LC2.php

ClassicCrazy

dgd created  some webservers that work with Arduino - you will also find some other home brew software in this section that will let you control Classic

http://midniteftp.com/forum/index.php?board=35.0

Larry
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

binkino

Thank you, Larry,

but this is not what I am looking for ;)

The Arduino needs a Network and a Serial Interface additional.

A *PI has this all on board. And When you have 2 Classic, it would need a 2nd Arduino Kit.

You can connect to the Classic, because a UNO connects to the serial. But I would like to have some kind of "buffer" that reads the datas, stores them I can connect to it like direct to the Classic, and can connect with more then 1 device - and can get the datas for a website - if not generated by the *PI ;)

PV-OUTPUT: http://pvoutput.org/list.jsp?id=38617
Classic Lite 200 + Classic 200 + Easun ISolar-SMX-II-5.6KW + 12x240Wp + 12x255Wp + 2x10kWh LFP
http://a68k.de/Solar/Monitor_LC2.php

ClassicCrazy

#3
I don't think anyone has written a program like that yet - it would be great if there was one to do that. It would need to talk modbus to the classic.

I use a raspberry pi with a weather station and program that does something like you are talking about - has a webserver so you can just connect up to it. That program is called Weewx . I wish I had the technical smarts to write a webserver program like that for the Classic but I don't !

This is where people have been working on interfaces with Raspberry Pi to Classic
http://midniteftp.com/forum/index.php?board=33.0

Larry
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

Binkino,

What you want doesn't look too difficult to do with an rPi.  A quick search shows that there is a modbus RTU for the Pi and also an ethernet modbus interface. So getting data from the Classic really depends on how often you want the data and how much you want to store
There is a lot of useful code to do this in zoneblue's cubie based system.
The fun part is then making the Pi a web server and sorting out some html pages to display the data or transfer it in some format to your computer/browser or whatever.
As you develop this then please post your code here for other rPi users...

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

binkino

thanks, dgd

but if I would be able to code and glue this all together, I wouldn't ask in this topic for it ;)

Back in the days, doing something like this on a 64 or an Amiga ... with the things we had these days, it would be a thing of a job over night =empty coffee machine, and go to work.
But to much time is gone and I am so much out of a programming world and not enough space in the head and time to get in something for these things. (and if you see how much help you get in an Arduino forum - not! - then you are done again to start something again)
Doing it step by step from a manual works.

Yesterday I spoke to a "temporary help guy" in our company, he is studying something in IT, may be he can help me too?
PV-OUTPUT: http://pvoutput.org/list.jsp?id=38617
Classic Lite 200 + Classic 200 + Easun ISolar-SMX-II-5.6KW + 12x240Wp + 12x255Wp + 2x10kWh LFP
http://a68k.de/Solar/Monitor_LC2.php

binkino

Larry,
yes Modbus, that is what I told the "temporary help guy" (how do you call someone like him in english?)
he first tried to see the output in a web browser ;) don't work - I knew :D
But he will read about this all and hopeful we will get a solution. If he can do it, or at least give us a base for future use, he also wouldn't have to do it for free.
We will see.

------------------------------------------------------------------------

What I found yesterday:
http://www.zoneblue.org/cms/page.php?view=getting-data-off-midnite-classic
http://support.rossw.net/midnite/

I tried the newmodbus and it gave me some datas back.

On his website he quotes the output of the terminal window:
Quote
peter@atom:~$ ./newmodbus   192.168.0.223 4101-4111
ID CLASSIC
ClassicTime 12:38:34   02/07/2013
4101 1174 (0x496)
4102 2012 (0x7DC)
4103 2061 (0x80D)
4104 0 (0x0)
4105 0 (0x0)
4106 7061 (0x1B95)
4107 3840 (0xF00)
4108 24605 (0x601D)
4109 0 (0x0)
4110 0 (0x0)
4111 3042 (0xBE2)

i get similar and as I changed the address range 4101-4111 to other numbers, I get a
Quotemodbus reply error
Failed to read serial number

I just get
Quote$ ./newmodbus 192.168.1.222 4101-4111
ID PV 2880
ClassicTime 14:06:18  17/09/2017
4101 1224 (0x4C8)
4102 2016 (0x7E0)
4103 794 (0x31A)
4104 5 (0x5)
4105 0 (0x0)
4106 32618 (0x7F6A)
4107 3840 (0xF00)
4108 24605 (0x601D)
4109 65432 (0xFF98)
4110 65535 (0xFFFF)
4111 64487 (0xFBE7)

and

Quote$ ./newmodbus 192.168.1.223 4101-4111
ID PV 1020
ClassicTime 14:07:38  17/09/2017
4101 1224 (0x4C8)
4102 2016 (0x7E0)
4103 794 (0x31A)
4104 2 (0x2)
4105 0 (0x0)
4106 18998 (0x4A36)
4107 3840 (0xF00)
4108 24605 (0x601D)
4109 0 (0x0)
4110 0 (0x0)
4111 17286 (0x4386)

Now something has to get such datas and put in in a ? database ? ?
There mus be more datas, have to check the "legal ranges" to poll from the Modbus manual
From that, another script has to send it to the network again, like the Classic does. (so we have our "buffer")
Also a script from a website reads these database entries and converts it in datas, we unterstand.
(Graham did this in his app perfect, we need a Apk to website converter haha and add this "buffer")


But no helping documentation for it on the website.

And he links to a zipped php, but when you look in the zip, a init.php is missing or an info, how to get or generate it.

Also there is no contact on his site, to ask.

So I can forget it to continue on this way.

I get sick, if there is so often only half of the information, you need.
I hate it to find incomplete solutions. As on Linux. Big readme files. But no hint, how to install it.
For someone how only scratches on a surface, a night mare and then the wonder, why so many users go back to Windos.

PV-OUTPUT: http://pvoutput.org/list.jsp?id=38617
Classic Lite 200 + Classic 200 + Easun ISolar-SMX-II-5.6KW + 12x240Wp + 12x255Wp + 2x10kWh LFP
http://a68k.de/Solar/Monitor_LC2.php

dgd

Binkino,
What data do you want from the Classic and what do you want to do with that data?
Try to provide some detail rather than just say 'display on web page'
Are you able to develop and run C code on your Pi?  Have you written and compiled/run any programs on your Pi?
Can you write html web pages and know how to set up a web server?
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

australsolarier

all my solar things are on one dedicated laptop. the laptop runs 24h/day. i access the solar programs via  team viewer. you can change settings etc. usually works til windows decides to update. but i suppose you can disable automatic update.
so i can watch it at work and check if everything is as it should be. or from overseas.

binkino

#9
Hi DGD,

Quote from: dgd on September 19, 2017, 04:29:08 AM
What data do you want from the Classic and what do you want to do with that data?
Try to provide some detail rather than just say 'display on web page'

All datas, I can get and see from both Classics:
PV Volts, AMps, Watts
Battery Volts, Amps - charging amps and power used
state of the battery - here also from the above, and charge state in % and Ah
Energy from the day generated

So like the app from Graham. Doesn't need to be so perfect in grafic like his app

And the PI as a repeater for all the datas, the classic provides


Quote
Are you able to develop and run C code on your Pi?  Have you written and compiled/run any programs on your Pi?

Sadly I am a big dumb a.. there.
back in the days ... on a 64 I was good. Later on the Amigas, many things changed, I scratched on the surface, never wrote programs, only made some suitable for my use.
Then also interests changed when you are past the 20y and you don't have the time and motivation to knee in new programming languages.
Some years ago I tried with Arduino. I wanted to make something cool for my car. But I only run against walls, as I have the feeling, I have only meet "gods" they do like they know everything, but can't help you in the internet forums.
So this sleep in again and the Arduino was back in the package, after I was done with using it for "floppy music" :D

QuoteCan you write html web pages and know how to set up a web server?

yes I do.
simple html websites and picking in php forum files, I can do many things - have my own forum on my "home server" and my websites.
Actually runs on a Lattepanda with the worst Windos ever. Some day I will kick it and replace with a Linux. Actually it works (knocking on wood...)
My home computers are all with Linux Mint now. Learned some things, but often I need to search for infos in the web.
For playing around, I have a cheap BananaPI M1 - at last used as a NAS for backups (OMV) but its USB2.0 is so slow ... will have to use the USB3.0 of the Lattepanda and unplug the HDD when not needed. So the Babana is free for new things.
Just testing some distris on it, not sure which OS I should use.


So this was my thought: have a program, that reads all datas, write them in the tables ob a Database (SQL..?) and forwards them on request of i.e. Graham's App,
so it simulates a Classic on the data output. Telling the App the address of the "repeater" or how we should call it, and other devices can connect at same time to it.
And a website could read these datas from the Database and show them.
On searching in the web, I have seen some MODBUS sites, OpenModbus and so ... possible there is something useful but I can not put these things together.


please excuse again, my English skills are not the best to write my thoughts and ideas so good.
PV-OUTPUT: http://pvoutput.org/list.jsp?id=38617
Classic Lite 200 + Classic 200 + Easun ISolar-SMX-II-5.6KW + 12x240Wp + 12x255Wp + 2x10kWh LFP
http://a68k.de/Solar/Monitor_LC2.php

welmore

I am working on a Raspberry Pi based server that will read my two Classics and provide a web based display.  It is written in HTML and PHP Besides the Pi, no special hardware is required.   If you are interested, I would be happy to  share the files and get suggestions for improvements.  Keep in mind, this is a work in progress.

At present, this does not send commands to the Classics. It just reads the registers, does some math and provides a display.

binkino

#11
Quote from: welmore on September 24, 2017, 12:19:22 AM
I am working on a Raspberry Pi based server that will read my two Classics and provide a web based display.  It is written in HTML and PHP Besides the Pi, no special hardware is required.   If you are interested, I would be happy to  share the files and get suggestions for improvements.  Keep in mind, this is a work in progress.

At present, this does not send commands to the Classics. It just reads the registers, does some math and provides a display.

Hey, that sounds fantastic, yes! I would be so glad!

Wrote you email, don't know if that works in the forum.
If you did not receive my email, let me know
PV-OUTPUT: http://pvoutput.org/list.jsp?id=38617
Classic Lite 200 + Classic 200 + Easun ISolar-SMX-II-5.6KW + 12x240Wp + 12x255Wp + 2x10kWh LFP
http://a68k.de/Solar/Monitor_LC2.php

ClassicCrazy

#12
Quote from: welmore on September 24, 2017, 12:19:22 AM
I am working on a Raspberry Pi based server that will read my two Classics and provide a web based display.  It is written in HTML and PHP Besides the Pi, no special hardware is required.   If you are interested, I would be happy to  share the files and get suggestions for improvements.  Keep in mind, this is a work in progress.

At present, this does not send commands to the Classics. It just reads the registers, does some math and provides a display.

I would also be interested in trying this out if you would like to share your project.
Maybe post it on Pi topic of forum ?  http://midniteftp.com/forum/index.php?board=33.0

Thanks
Larry
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

binkino

PV-OUTPUT: http://pvoutput.org/list.jsp?id=38617
Classic Lite 200 + Classic 200 + Easun ISolar-SMX-II-5.6KW + 12x240Wp + 12x255Wp + 2x10kWh LFP
http://a68k.de/Solar/Monitor_LC2.php

ClassicCrazy

Maybe this will be of help for the project ?
Modbus Raspberry Pi logging  for Morningstar
https://github.com/DaKaZ/ts_mppt_60_raspberrypi_monitor

Larry

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