Monitoring a Classic with Mango SCADA software

Started by stephendv, January 04, 2013, 04:31:33 AM

Previous topic - Next topic

stephendv

Hi all,

I came across Mango which is a free-for-non-commercial-use software package that can be used to data log, monitor and alert based on various data sources.  It supports modbus TCP as one of the data sources so it can talk directly to the classic.  I've created a short howto to describe getting it connected to the Classic here:

http://www.casanogaldelasbrujas.com/blog/2013/01/04/how-to-configure-mango-to-monitor-the-midnite-classic-controller/

It has a built in Pachube module, so my pachube feed is now much easier to set up, and more reliable: https://cosm.com/feeds/75889

boB


We are using Mango in the lab here at Midnite.

We really like it !

boB
K7IQ 🌛  He/She/Me

TomW

I tried to install Mango on Ubuntu this afternoon but cannot get it to work. Probably paths and /or permissions. Kind of sparce documentation. It looks interesting but I can't rationalize forking over $400 for a version with support.

If you know of a "Mango for Dummies" document, I would appreciate a link.

Tom


Do NOT mistake me for any kind of "expert".

( ͡° ͜ʖ ͡°)


24 Trina 310 watt modules, SMA SunnyBoy 7.7 KW Grid Tie inverter.

I thought that they were angels, but much to my surprise, We climbed aboard their starship and headed for the skies

stephendv

You'll need to install a Java JDK first:

sudo apt-get install openjdk-6-jdk

Some features don't work on jdk 7 yet.
There's some help in the forums: http://mango.serotoninsoftware.com/forum/forums/list.page

I migrated it to the raspberry pi yesterday.  It's limping along with only 20mb free, but it does work.  It's currently setup to read the actual current into the batteries from the sunny island's shunt and then force the classic to end absorb based on that value.

TomW

Quote from: stephendv on January 05, 2013, 02:15:24 AM
You'll need to install a Java JDK first:

sudo apt-get install openjdk-6-jdk

Some features don't work on jdk 7 yet.
There's some help in the forums: http://mango.serotoninsoftware.com/forum/forums/list.page

I migrated it to the raspberry pi yesterday.  It's limping along with only 20mb free, but it does work.  It's currently setup to read the actual current into the batteries from the sunny island's shunt and then force the classic to end absorb based on that value.

stephendv;

Thanks. I already had openjdk-6-jdk installed. My PI is already quite "busy" so I doubt it can handle Mango also. Maybe I will get another PI for that.

Thanks for the info.

Tom

Do NOT mistake me for any kind of "expert".

( ͡° ͜ʖ ͡°)


24 Trina 310 watt modules, SMA SunnyBoy 7.7 KW Grid Tie inverter.

I thought that they were angels, but much to my surprise, We climbed aboard their starship and headed for the skies

Stevededrick

Hi everyone-

I am a sales rep for Infinite Automation, who distributes Mango.  A couple people referenced this forum as where they heard about Mango.  Sweet!  Can you control the Classic over Modbus TCP too?  or just monitor?  I would be real easy to build a template that looks just like the classic in DGLux and then control it over the web using iPhone, etc.  Over the last 10 years I have installed several off-grid systems.  My first classic was just last year - best charge controller I've used so far!

If you need installation assistance check our our forum http://forum.infiniteautomation.com/forum/forums/show/20.page

Tom, if you need any more help on that installation let me know,

Steve
4.6kW Evergreen 200's
2 - Xantrex MPPT 60's (should have bought a classic...)
8 - 8A8D batteries 245ah@48V
Xantrex XW inverter
Midnite Epanel
(also extensively tested Heart Transverter's in place of my Xantrex for 2 years)

stephendv

Hi Steve, good to hear from someone from Mango :)

Yes you can control the classic over modbus too.  I'm a mango newbie so perhaps I've missed something in mango's functions, but it seems that the event handlers only support setting a data point or executing a command line script.  So I wrote a python script to modify the classic over modbus... but if you're suggesting that you can perform modbus writes directly from the event handlers that would be MUCH better. 

midnite_andy

Hi Steve,
I use Mango here at MidNite Solar for developing new products.  You can control the Classic with Modbus.  You will also be able to control some of our new products using Modbus as well.  We should talk more about this.
-Andy

TomW

I dropped Mango onto my daily driver laptop and it went in like a greased d... seems to work after I reconfigured tomcat for another port.

Now on to figuring out how to use it before I put it on the ArchLinux Pi I just set up dedicated to the Classic project.

It  gave me issues on the Raspbian (Debian) image on my first Pi. That image and board have a 3 day between lockups issue and I think it is simply overloaded as my uptime /load log shows it hitting double digit load averages. Slowly whittling it down to bare bones. I do not trust it for the Mango  application which should be on reliable 24/7 hardware.

I will be watching this thread as it develops hoping I get up to speed with it.

The folks at Mango responded quickly to the email questions I had and have a support forum.

Thanks for the discussion.

Tom
Do NOT mistake me for any kind of "expert".

( ͡° ͜ʖ ͡°)


24 Trina 310 watt modules, SMA SunnyBoy 7.7 KW Grid Tie inverter.

I thought that they were angels, but much to my surprise, We climbed aboard their starship and headed for the skies

TomW

As a test I got Mango to run on my daily driver laptop with Ubuntu 11.10 on it.

Was pretty straight forward. Downloaded the app and a couple modules, unpacked the core file, copied the modules into the right place and fired it up, after changing a conflicting port assignment on tomcat.

It ran all day yesterday and seemed fine.

I could not get it running on Archlinux due to a jdk dependancy issue from a missing package on the repository (sqlite). I abandoned that effort and wrote a fresh Raspbian "Wheezy" to a fresh SD card for my #1 Pi. Mango installed fine as it did on the Archlinux Pi. I fired it off with the start script and it has not errored but is still loading after 10 minutes or so. Not sure if it is hung up or what but it has not bailed out. I just killed and restarted it after 20 minutes it gets hung up at this line, apparently permanently:

INFO  2013-01-18 11:30:33,706 (com.serotonin.util.properties.ReloadingProperties.checkForReload:142) - (dglux) Found updated file(s) at [/home/tomw/Mango/web/modules/dglux/classes/dglux.properties]. Reloading properties



So, what brand of Linux are you using on that Pi, Stephen? And do you have a link to an image to use or did you build it yourself?

Getting it fired up on my laptop has me believing it is a simple issue on the Pi releases I am using.

Thanks for any info. I am very interested in getting Mango running on a Pi.

Tom
Do NOT mistake me for any kind of "expert".

( ͡° ͜ʖ ͡°)


24 Trina 310 watt modules, SMA SunnyBoy 7.7 KW Grid Tie inverter.

I thought that they were angels, but much to my surprise, We climbed aboard their starship and headed for the skies

stephendv

Hi Tom,

The key to getting it on the Pi is to use the Oracle 8 JDK preview release: http://jdk8.java.net/fxarmpreview/ 
Sorry, I thought I'd mentioned it here, but obviously didn't.

The very first time you access a page it takes a while to load, but after that it's pretty fast.





TomW

Quote from: stephendv on January 18, 2013, 01:56:04 PM
Hi Tom,

The key to getting it on the Pi is to use the Oracle 8 JDK preview release: http://jdk8.java.net/fxarmpreview/ 
Sorry, I thought I'd mentioned it here, but obviously didn't.

The very first time you access a page it takes a while to load, but after that it's pretty fast.

I grabbed that and installed to /opt as instructed on the site. Do I need to pass the path to the ma-start.sh script somehow?

Get to the same point and it just hangs.

I posted on Mango's forum but so far nobody has responded.  I suppose that would be a better place to discuss Mango installation issues. :o

Thanks for the tip.

Tom
Do NOT mistake me for any kind of "expert".

( ͡° ͜ʖ ͡°)


24 Trina 310 watt modules, SMA SunnyBoy 7.7 KW Grid Tie inverter.

I thought that they were angels, but much to my surprise, We climbed aboard their starship and headed for the skies

stephendv

You'd need to edit the ma-start.sh script to use the correct value for JAVA_HOME (/opt/jdk1.8.0 in my case) and there was one other change... which I've forgotten what it was.  My modified script attached.


TomW

Quote from: stephendv on January 18, 2013, 03:22:20 PM
You'd need to edit the ma-start.sh script to use the correct value for JAVA_HOME (/opt/jdk1.8.0 in my case) and there was one other change... which I've forgotten what it was.  My modified script attached.

Stephen;

Still no go with your script.

I sure appreciate your help but I am just not getting it here.

Kind of  committed  now but never expected it to be such an arse pain or to consume so much effort to install.

Thanks again.

Tom
Do NOT mistake me for any kind of "expert".

( ͡° ͜ʖ ͡°)


24 Trina 310 watt modules, SMA SunnyBoy 7.7 KW Grid Tie inverter.

I thought that they were angels, but much to my surprise, We climbed aboard their starship and headed for the skies

Stevededrick

Quote from: stephendv on January 17, 2013, 01:14:47 PM
Hi Steve, good to hear from someone from Mango :)

Yes you can control the classic over modbus too.  I'm a mango newbie so perhaps I've missed something in mango's functions, but it seems that the event handlers only support setting a data point or executing a command line script.  So I wrote a python script to modify the classic over modbus... but if you're suggesting that you can perform modbus writes directly from the event handlers that would be MUCH better. 

@stephendv, as long as your modbus point is configured to be settable you can used the event handler to perform modbus writes.  I also use the watch list to create quick lists of control settings that can be easily modified.  DGLux or the old graphic view tool can make this happen in a visual mannar.

Also, Many of you may be using the older Mango M2M version.  Mango Automation is totally redesigned from the ground up to be modular, fast, and robust.  http://infiniteautomation.com/index.php/download-mango.html

You guys will be really interested in our scripting data source.  You can basically write automation scripts that can make your classic behave in strange and amazing ways.  Custom charging, the sky's the limit.   ;D

Here's an overview:

The Scripting allows users to use ECMA scripts to determine point values. It is similar to the Meta data source, but allows the setting of multiple point values within a single script rather than setting the point using the output of a per point.

JavaScript / ECMAScript

This data source requires some knowledge of JavaScript, also known as ECMAScript. (The full specification for ECMAScript is available here.) JavaScript is arguably the most popular scripting language in use today, it being the only language available for use in every popular web browser. The result is that, by far the common usage of JavaScript is in web pages. The context within the Meta data source is of course different, there being no "window" or "document" objects, among other more subtle differences. Contextual differences aside, a full and complete implementation of ECMAScript is available within this data source. Specifically, the Rhino implementation is used.

4.6kW Evergreen 200's
2 - Xantrex MPPT 60's (should have bought a classic...)
8 - 8A8D batteries 245ah@48V
Xantrex XW inverter
Midnite Epanel
(also extensively tested Heart Transverter's in place of my Xantrex for 2 years)