A Forum run by Enthusiasts of MidNite Solar

Charge Controllers and Clippers => The "Classic" charge controller => Topic started by: binkino on September 15, 2017, 09:28:40 AM

Title: for the Classic: Webview and server for the datas?
Post by: binkino on September 15, 2017, 09:28:40 AM
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)

Title: Re: for the Classic: Webview and server for the datas?
Post by: ClassicCrazy on September 15, 2017, 01:47:41 PM
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
Title: Re: for the Classic: Webview and server for the datas?
Post by: binkino on September 15, 2017, 03:53:05 PM
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 ;)

Title: Re: for the Classic: Webview and server for the datas?
Post by: ClassicCrazy on September 15, 2017, 08:03:58 PM
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
Title: Re: for the Classic: Webview and server for the datas?
Post by: dgd on September 16, 2017, 09:57:30 PM
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
Title: Re: for the Classic: Webview and server for the datas?
Post by: binkino on September 17, 2017, 07:47:43 AM
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?
Title: Re: for the Classic: Webview and server for the datas?
Post by: binkino on September 17, 2017, 08:15:11 AM
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.

Title: Re: for the Classic: Webview and server for the datas?
Post by: dgd on September 19, 2017, 04:29:08 AM
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
Title: Re: for the Classic: Webview and server for the datas?
Post by: australsolarier on September 19, 2017, 10:02:51 PM
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.
Title: Re: for the Classic: Webview and server for the datas?
Post by: binkino on September 21, 2017, 01:27:59 PM
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.
Title: Re: for the Classic: Webview and server for the datas?
Post by: 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.
Title: Re: for the Classic: Webview and server for the datas?
Post by: binkino on September 24, 2017, 11:59:59 AM
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
Title: Re: for the Classic: Webview and server for the datas?
Post by: ClassicCrazy on September 24, 2017, 12:16:38 PM
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
Title: Re: for the Classic: Webview and server for the datas?
Post by: binkino on September 24, 2017, 01:58:43 PM
Can we let the Mod move it to the "PI" section? ;)
Title: Re: for the Classic: Webview and server for the datas?
Post by: ClassicCrazy on September 24, 2017, 10:05:42 PM
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

Title: Re: for the Classic: Webview and server for the datas?
Post by: binkino on September 25, 2017, 09:34:56 PM
Have received the filed from welmore, thanks again,
fresh installed my BananaPI with Raspbian Jessie, + web server

Just Linux like, have some fights with the rights of the files and folders ... But it is running.
Title: Re: for the Classic: Webview and server for the datas?
Post by: welmore on September 25, 2017, 11:40:28 PM
I did not know there was a Pi section.  Yes this can move to the Pi section.

Binkino is looking at it now. After his input and maybe some changes, I have no problem sharing the project.

Title: Re: for the Classic: Webview and server for the datas?
Post by: bscloutier on September 26, 2017, 10:02:13 AM
Is there a spec for Classic communications? I am not familiar but wondering if I can adapt monitoring for it. I run SMA inverters (sorry) and report via web. Check out http://www.cloutieronline.com (http://www.cloutieronline.com).

While my site is PC based I have been converting it run using a JNIOR which is already reading the inverter's RS-485 netowrk. I wonder if that is an option for the Classic?
Title: Re: for the Classic: Webview and server for the datas?
Post by: ClassicCrazy on September 26, 2017, 01:43:26 PM
Quote from: bscloutier on September 26, 2017, 10:02:13 AM
Is there a spec for Classic communications? I am not familiar but wondering if I can adapt monitoring for it. I run SMA inverters (sorry) and report via web. Check out http://www.cloutieronline.com (http://www.cloutieronline.com).

While my site is PC based I have been converting it run using a JNIOR which is already reading the inverter's RS-485 netowrk. I wonder if that is an option for the Classic?

Yes - it is here
http://www.midnitesolar.com/pdfs/classic_register_map_Rev-C5-December-8-2013.pdf

Nice job on your webpage .

Larry
Title: Re: for the Classic: Webview and server for the datas?
Post by: bscloutier on September 26, 2017, 02:21:31 PM
This is a simple application for a JNIOR. An application program can collect data points via MODBUS and create a dynamic webpage to display the data. We can piece this together here but don't have access to a Classic data port. Is it possible to open one up over a public IP address so we here in Pittsburgh can work with it for a couple of days? The result would be open source and available to all of you.

My solar plant is monitored and the data can be seen here http://www.cloutieronline.com (http://www.cloutieronline.com). This is PC-based and uses SMA inverters (sorry). I had been considering converting over to the JNIOR as that would be better to leave with the next owner. Otherwise they would lose the monitoring since it is on my server now.

Anyway, we're interested in trying to do it for the Classic. That is if any of you would be interested in that.
Title: Re: for the Classic: Webview and server for the datas?
Post by: binkino on September 26, 2017, 08:10:22 PM
Quote from: welmore on September 25, 2017, 11:40:28 PM
I did not know there was a Pi section.  Yes this can move to the Pi section.

Binkino is looking at it now. After his input and maybe some changes, I have no problem sharing the project.

Is working great ;)

I am also working on the design now, did some changes in the code, so I also see the temperatures in °C
This can also be copied for all who have use for it.


If someone wants to see it:
http://a68k.de:81/Solar/Solar_Monitor_de.php
his  original site on my PI:
http://a68k.de:81/Solar/Solar_Monitoring.php
I am just working on the design, so the reload of the site is 2 seconds, don't care about it please.

I just don't know the exact direction of the design for me, I am just playing around and find a combination ;)
This was a very good refresh for me today in writing html and php by hand again
(also with a lot try and error ... )
Like in old times, when we only hat a text editor on the Amiga... :D


The server is a BananaPI M1, 1Ghz 1GB Ram, Sata, USB 2.0 x2, OTG USB, and the best: solder points for a 3.7V battery, also charges the battery.
Sata was importand for me, as it was running as a NAS. But it can do this job later again.
OS:  Raspbian_Jessie + VNC ++ Apache & Co.
Tried some OS distris, this appears the only, that works for me.

Title: Re: for the Classic: Webview and server for the datas?
Post by: binkino on September 26, 2017, 08:16:48 PM
Quote from: bscloutier on September 26, 2017, 02:21:31 PM
This is a simple application for a JNIOR. An application program can collect data points via MODBUS and create a dynamic webpage to display the data. We can piece this together here but don't have access to a Classic data port. Is it possible to open one up over a public IP address so we here in Pittsburgh can work with it for a couple of days? The result would be open source and available to all of you.

My solar plant is monitored and the data can be seen here http://www.cloutieronline.com (http://www.cloutieronline.com). This is PC-based and uses SMA inverters (sorry). I had been considering converting over to the JNIOR as that would be better to leave with the next owner. Otherwise they would lose the monitoring since it is on my server now.

Anyway, we're interested in trying to do it for the Classic. That is if any of you would be interested in that.

I have open ports to my 2 Classics, but if you connect, I can't ... mh...
;)
Title: Re: for the Classic: Webview and server for the datas?
Post by: ClassicCrazy on September 26, 2017, 10:08:59 PM
Looks good Bikino !
Nice when all the collaboration gets such good results.
Any way to change the type of graph easily ?

Larry
Title: Re: for the Classic: Webview and server for the datas?
Post by: ClassicCrazy on September 26, 2017, 10:11:41 PM
Quote from: bscloutier on September 26, 2017, 02:21:31 PM
This is a simple application for a JNIOR. An application program can collect data points via MODBUS and create a dynamic webpage to display the data. We can piece this together here but don't have access to a Classic data port. Is it possible to open one up over a public IP address so we here in Pittsburgh can work with it for a couple of days? The result would be open source and available to all of you.

My solar plant is monitored and the data can be seen here http://www.cloutieronline.com (http://www.cloutieronline.com). This is PC-based and uses SMA inverters (sorry). I had been considering converting over to the JNIOR as that would be better to leave with the next owner. Otherwise they would lose the monitoring since it is on my server now.

Anyway, we're interested in trying to do it for the Classic. That is if any of you would be interested in that.

Yes - as Bikino said - only one application can connect at a time to the Classic so you would have to find someone who isn't monitoring their data every day with one of the other monitoring apps.

Larry
Title: Re: for the Classic: Webview and server for the datas?
Post by: Westbranch on September 26, 2017, 11:51:16 PM
PM sent to bscloutier...
Title: Re: for the Classic: Webview and server for the datas?
Post by: bscloutier on September 27, 2017, 09:54:57 AM
Quote from: ClassicCrazy on September 26, 2017, 10:11:41 PM
Yes - as Bikino said - only one application can connect at a time to the Classic so you would have to find someone who isn't monitoring their data every day with one of the other monitoring apps.

Larry

Yeah the SMA Webbox is like that too. It only allows one login. I don't think it was a security feature. I think there is just a single thread running in the thing and it can't multi-task. Maybe the Classic is the same. It takes some serious OS experience to properly write a preemptive multi-tasking system.

The JNIOR can act both as a MODBUS Client and a MODBUS Server. So I suppose we could eventually use it to expand the Classic so you can access it simultaneously from multiple clients through the JNIOR like a hub and continue to monitor with existing software.

Ideally we'll want to work with someone where we won't disturb the status quo. I agree.

Is there a Classic running someplace in southwest Pennsylvania?
Title: Re: for the Classic: Webview and server for the datas?
Post by: ClassicCrazy on September 27, 2017, 11:23:31 AM
Quote from: binkino on September 26, 2017, 08:16:48 PM
Quote from: bscloutier on September 26, 2017, 02:21:31 PM
This is a simple application for a JNIOR. An application program can collect data points via MODBUS and create a dynamic webpage to display the data. We can piece this together here but don't have access to a Classic data port. Is it possible to open one up over a public IP address so we here in Pittsburgh can work with it for a couple of days? The result would be open source and available to all of you.

My solar plant is monitored and the data can be seen here http://www.cloutieronline.com (http://www.cloutieronline.com). This is PC-based and uses SMA inverters (sorry). I had been considering converting over to the JNIOR as that would be better to leave with the next owner. Otherwise they would lose the monitoring since it is on my server now.

Anyway, we're interested in trying to do it for the Classic. That is if any of you would be interested in that.

I have open ports to my 2 Classics, but if you connect, I can't ... mh...
;)

Bikino - does this program just gather the data via IP modbus ?  No physical connection to the Classic ? I am guessing that is how it works. 
Larry
Title: Re: for the Classic: Webview and server for the datas?
Post by: bscloutier on September 27, 2017, 11:37:22 AM
We're looking at the spec. There's the Daily Total which we can easily actively display. Is there an Instantaneous Power? Even on a clear blue sky day my panels detect con trails from passing air traffic. There was a nice dip from the recent solar eclipse. Unfortunately that wasn't a clear day and a rain storm earlier in the morning made a similar dip. But it's nice to see how the day goes.

We display the curve as background for our record production day. I also keep a Top 100 list of daily production. On good solar days people checking the site often try to predict where on the list the day will end. We display a seasonal range for every couple of hours on the chart. That shows the average on the low end and the maximum at the top for a two week period around the current day at that hour. So if the day's curve passes through there we are happy. Below the range is no good. I don't know how much of that we can do with the JNIOR but we need basically the instantaneous power level from somewhere.

So what data are you all interested in seeing? Can you point to it in the MODBUS spec?
Title: Re: for the Classic: Webview and server for the datas?
Post by: binkino on September 27, 2017, 08:09:01 PM
Quote from: ClassicCrazy on September 26, 2017, 10:08:59 PM
Looks good Bikino !
Nice when all the collaboration gets such good results.
Any way to change the type of graph easily ?

Larry

Thank you :)
Have continued - now the temps are displayed in a graphic way
It is Trek-like - sorry ;-) but I love it hehe
that's the way I will go, but I will use both versions on 2 independent pages later.


Title: Re: for the Classic: Webview and server for the datas?
Post by: binkino on September 27, 2017, 08:13:24 PM
Quote from: ClassicCrazy on September 27, 2017, 11:23:31 AM
Bikino - does this program just gather the data via IP modbus ?  No physical connection to the Classic ? I am guessing that is how it works. 
Larry


Yes, over IP modbus - via the home network.
The php software / webpage, polls every x seconds the datas from the Classic and stores them in a text file.
The further handling happens on the server (reading, logging, displaying)
So it is also possible to connect to the Classic with the Android App, just between the connects of the php
Title: Re: for the Classic: Webview and server for the datas?
Post by: ClassicCrazy on September 28, 2017, 08:23:21 PM
Quote from: binkino on September 27, 2017, 08:13:24 PM
Quote from: ClassicCrazy on September 27, 2017, 11:23:31 AM
Bikino - does this program just gather the data via IP modbus ?  No physical connection to the Classic ? I am guessing that is how it works. 
Larry


Yes, over IP modbus - via the home network.
The php software / webpage, polls every x seconds the datas from the Classic and stores them in a text file.
The further handling happens on the server (reading, logging, displaying)
So it is also possible to connect to the Classic with the Android App, just between the connects of the php

Will look forward to seeing this when you guys get all the bugs worked out - ha ha .
That is interesting if you can get the data and also connect up Android app ? Wouldn't they collide and one or both of them get kicked off ?

Larry
Title: Re: for the Classic: Webview and server for the datas?
Post by: binkino on September 29, 2017, 07:03:18 AM
Quote from: ClassicCrazy on September 28, 2017, 08:23:21 PM
Will look forward to seeing this when you guys get all the bugs worked out - ha ha .
That is interesting if you can get the data and also connect up Android app ? Wouldn't they collide and one or both of them get kicked off ?

Larry

You can not run them the same time and display on both updated datas
you can log with the PI and between the data polls from the PI you can connect the Classic with an App, without causing problems. The PI will try, but get nothing and try again.
Just will not update the datas in the browser. But will get the datas again and complete them, when you close the App again and the PI gets datas again.
PI only connects a short time to get datas and between these polls you can connect with the App and keep the connection.
Once a connection is established, no other connection can
Title: Re: for the Classic: Webview and server for the datas?
Post by: RossW on September 29, 2017, 05:15:57 PM
I wrote my "newmodbus" code back in early 2013. The source was (and I presume still is) available in various places, or from me. It included all the modbus communications directly over IP, without requiring a direct connection to the Classic.

It would be trivial to have it read the entire data table and write to disk, and allow other applications to access that data, or only slightly more time-consuming to make it act as a "relay", permitting simultaneous access from other devices and serving data from its own internal cache/buffer that is updated periodically from the classic.

Was written in standard C, should compile and run on just about anything.

RossW
Title: Re: for the Classic: Webview and server for the datas?
Post by: binkino on September 29, 2017, 05:48:05 PM
Hi RossW,
have seen the newmodbus and played with it, but I couldn't go further then writing to a log file.
Didn't know how to work with the log file to display the datas
also on the website there was no contact, so I couldn't ask
The solution from welmore is like this, but has a webpage with it :)
Possible we can combine it, also expanding your newmodbus for a "relay"
Title: Re: for the Classic: Webview and server for the datas?
Post by: binkino on October 08, 2017, 05:52:46 PM
http://a68k.de:81/Solar/Solar_Monitoring_2b.php
Gauges. More gauges. To many :D

Thanks to Wade, I have now a working code for continuing with gauges.
The other "graphic" page, http://a68k.de:81/Solar/Solar_Monitor_LC_de.php is also in work.


Now after the Banana OS made me crazy (hangs a lot and had to reboot it all night) I installed now  LEMAKER's Raspian and that runs much better. Stable and no problems.

Meanwhile another PI arrived to me, an "ORANGE PI PC" ... don't buy it!
It is a nightmare. There is only one OS it boots with, all the others, also from Roange, son't even switch it on. Spend hours and hours with it ... put it back in the box and if I don't forget its existence, someday I will hold out for newer OS images.

Title: Re: for the Classic: Webview and server for the datas?
Post by: ClassicCrazy on October 08, 2017, 10:50:40 PM
Looking good Bikino - nice to see the progress and every thing working .

Larry
Title: Re: for the Classic: Webview and server for the datas?
Post by: binkino on October 09, 2017, 06:30:28 AM
Thank you ;)

I am currently aiming the optimization for a resolution of 1024x768, then I can comfortably hook up a PI to an old 15 "monitor and display this all time
And this dimension is also good for a view from the internet in my opinion.
But - any tips, recommendations and suggestions are allways welcome :)

In the "gauge page" I was now playing with the colors. Give them a matching theme for their function.
Yellow/Orange für the incoming energy, like the sun. But I am still not 100% happy, satisfied with it.

First, I tried to design it like Graham's app gui, but it is hard readable then - the numbers are not outside of the gauge lines, and the color flow from a light blue and a darker didn't look so good here.
So first will finish that version, then new ideas will come and possible I can do a design matching version.
I like the blue theme of Graham ;)


For mobile device i have Graham's app, so no need for a mobile version - or do we?
It would make it more complicated.
The App has direct connection and shows changes just in time, no wait for reload of the page :)

May be, show both versions and do a "night version" with the blue theme hehehe

Too many ideas are spooking in my head (as always...)

Title: Re: for the Classic: Webview and server for the datas?
Post by: grgdgreek on October 13, 2017, 08:51:57 AM
Nice !
Title: Re: for the Classic: Webview and server for the datas?
Post by: binkino on October 15, 2017, 07:04:07 PM
haha that is so amazing great ...
Now with AUX states.
see: http://a68k.de:81/Solar/gauges.php

I let it interpret the AUX state from clear text ("on"..."Off" and so on) to the function.

Energie:   PV/Batterie = it uses energy from battery and font color is green.
If the AUX powers the big relay between the grid and the inverter, it is red and says like "on grid" (in german..)

Energie:   PV/Batterie = tells, if the AUX powers another relay, that powers the fan for exhausting the gases from the batteries while charging.
if OFF = light blue font color
if ON it has green color.

I also have to modify my inverter, to get a signal, if it is "on grid" or "on battery"
it has LEDs in the front, possible use the led power for a small circuit to a relay contact,
or if I can get some contact to the big relay inside ... will see.

The Westech has contacts for generator, but they didn't work for me like expected.
Didn't find infos in the web, in wich condition, they change state ... will use these connection for the signal, i need.
Title: Re: for the Classic: Webview and server for the datas?
Post by: binkino on October 19, 2017, 09:39:52 AM
So ... now back on the "Lcars" (Star Trek) style version ....

Thanks to Wade I was able to complete my "gauge page" (that is not 100% finish, but close to be) with his AUX code
and now I returned back to my "Lcars" version and added the AUX states to it.
Also we changed from pure php code to easy to create and modify html code with php codes/command.
For a 1024x768 display: http://a68k.de:81/Solar/Monitor_LC.php
(old version: http://a68k.de:81/Solar/Monitor_LC_old.php )
The old Lcars version is still in the old code, not sure I will use it longer. But keep the file for me it as reference.
and as the browser all do not display all the same***, I made a "Mobile" version, in portrait scale
http://a68k.de:81/Solar/Monitor_LCm.php
that fits my 7" ASUS Android tablet and is just okay for my Android phones.

!!! I just cleaned up and have renamed the files! (if you have an old link)

It is for sure the biggest shame, that after 20 years (official) internet, we have to fight with the incompetence of the web browser programmers.
It was not enough, that in the early years we uses to write the same damn web page for each browser (IE and Netscape, then Mozille/Firefox) --- no not enough.
I have 6 different browsers on my tablet, to check styles and other purposes. In every browser it looks different.
They invent new technics, new functions, new ... senseless crap. What ever. But are not able to let the browser match the displayed output.
All these endless programming languages, do not solve it. And this nightmare continues.

how every. I had to yell that out ;-)



If someone has good ideas, suggestions, ... let me know.
Title: Re: for the Classic: Webview and server for the datas?
Post by: ClassicCrazy on October 19, 2017, 11:14:29 AM
Do you have this running on your new Raspberry Pi now ?
Are you going to share this code ?

You have sure come a long way since you first asked about this not too long ago !

Larry
Title: Re: for the Classic: Webview and server for the datas?
Post by: binkino on October 19, 2017, 01:18:24 PM
Quote from: ClassicCrazy on October 19, 2017, 11:14:29 AM
Do you have this running on your new Raspberry Pi now ?
Are you going to share this code ?

You have sure come a long way since you first asked about this not too long ago !

Larry

Hi Larry

I have my BananaPI M1 running with the service.
Some weeks ago I bought a "OrangePi PC" but that thing sucks. I can only recommend the BananaPI as cheaper alternative for a PI.
(better price, faster, has Sata)


Yes we will share the code, but I first have to wait until Wade gives his 'ok' because the base code is from him.
I will also write some notes to my pages. Also about the used OS, hardware, links to the sources, examples, and my files.
We can keep this topic alive, for further questions and so on ;)

That's right :)
I had some very useful lessons and refresh of many things in writing web code by hand :D




btw what is the difference between a Linux as web server and a windos based?
I also tried to run it on ma Lattepanda (that nice piece of hardware, that was castrated with win10) but didn't run on it.

Title: Re: for the Classic: Webview and server for the datas?
Post by: Graham on October 19, 2017, 01:19:09 PM
Quote from: binkino on October 19, 2017, 09:39:52 AM
So ... now back on the "Lcars" (Star Trek) style version ....

Thanks to Wade I was able to complete my "gauge page" (that is not 100% finish, but close to be) with his AUX code
and now I returned back to my "Lcars" version and added the AUX states to it.
Also we changed from pure php code to easy to create and modify html code with php codes/command.
For a 1024x768 display: http://a68k.de:81/Solar/Monitor_LC.php
(old version: http://a68k.de:81/Solar/Monitor_LC_old.php )
The old Lcars version is still in the old code, not sure I will use it longer. But keep the file for me it as reference.
and as the browser all do not display all the same***, I made a "Mobile" version, in portrait scale
http://a68k.de:81/Solar/Monitor_LCm.php
that fits my 7" ASUS Android tablet and is just okay for my Android phones.

!!! I just cleaned up and have renamed the files! (if you have an old link)

It is for sure the biggest shame, that after 20 years (official) internet, we have to fight with the incompetence of the web browser programmers.
It was not enough, that in the early years we uses to write the same damn web page for each browser (IE and Netscape, then Mozille/Firefox) --- no not enough.
I have 6 different browsers on my tablet, to check styles and other purposes. In every browser it looks different.
They invent new technics, new functions, new ... senseless crap. What ever. But are not able to let the browser match the displayed output.
All these endless programming languages, do not solve it. And this nightmare continues.

how every. I had to yell that out ;-)



If someone has good ideas, suggestions, ... let me know.


looks great Andy, nice job.