A Forum run by Enthusiasts of MidNite Solar

Charge Controllers and Clippers => The "Classic" charge controller => Topic started by: stephendv on January 04, 2013, 04:31:33 AM

Title: Monitoring a Classic with Mango SCADA software
Post by: stephendv on January 04, 2013, 04:31:33 AM
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/ (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 (https://cosm.com/feeds/75889)
Title: Re: Monitoring a Classic with Mango SCADA software
Post by: boB on January 04, 2013, 02:27:11 PM

We are using Mango in the lab here at Midnite.

We really like it !

boB
Title: Re: Monitoring a Classic with Mango SCADA software
Post by: TomW on January 04, 2013, 07:11:51 PM
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


Title: Re: Monitoring a Classic with Mango SCADA software
Post by: 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.
Title: Re: Monitoring a Classic with Mango SCADA software
Post by: TomW on January 05, 2013, 08:16:36 AM
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

Title: Re: Monitoring a Classic with Mango SCADA software
Post by: Stevededrick on January 17, 2013, 01:08:17 PM
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
Title: Re: Monitoring a Classic with Mango SCADA software
Post by: 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. 
Title: Re: Monitoring a Classic with Mango SCADA software
Post by: midnite_andy on January 17, 2013, 06:05:06 PM
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
Title: Re: Monitoring a Classic with Mango SCADA software
Post by: TomW on January 17, 2013, 09:55:50 PM
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 (http://forum.infiniteautomation.com/forum/forums/list.page).

Thanks for the discussion.

Tom
Title: Re: Monitoring a Classic with Mango SCADA software
Post by: TomW on January 18, 2013, 12:47:19 PM
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
Title: Re: Monitoring a Classic with Mango SCADA software
Post by: 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.




Title: Re: Monitoring a Classic with Mango SCADA software
Post by: TomW on January 18, 2013, 03:18:20 PM
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
Title: Re: Monitoring a Classic with Mango SCADA software
Post by: 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.

Title: Re: Monitoring a Classic with Mango SCADA software
Post by: TomW on January 18, 2013, 03:56:47 PM
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
Title: Re: Monitoring a Classic with Mango SCADA software
Post by: Stevededrick on January 18, 2013, 04:13:10 PM
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.

Title: Re: Monitoring a Classic with Mango SCADA software
Post by: Stevededrick on January 18, 2013, 04:25:46 PM
You guys might also be interested to know that it would be real easy to add a modbus controller to mango along with your classic that has relays and sensor inputs.  You could easily add:
All for a fraction of the cost that Draker or Fat Spaniel :)

Then you could use the Mango Automation scripting data source to create automation logic that will control loads, adjust thermostats, turn on pumps, you name it.  Here is an old example we did in the coldest place in the lower 48 states - Frasier Colorado.  http://infiniteautomation.com/index.php/solution-examples/4-ecodashboard.html

Have fun!
Steve
Title: Re: Monitoring a Classic with Mango SCADA software
Post by: mtdoc on January 18, 2013, 04:34:29 PM
Quote from: Stevededrick on January 18, 2013, 04:25:46 PM

All for a fraction of the cost that Draker or Fat Spaniel :)


Couldn't you do the same thing with an Arduino for even less money?
Title: Re: Monitoring a Classic with Mango SCADA software
Post by: Stevededrick on January 18, 2013, 05:03:29 PM
The Arduino might be a good way to go too.  I'm not really familiar with all its features.  A lot of Arduino users have downloaded Mango Automation. 

Does the Arduino have much of a UI?  Does it store data and serve up trending?  I've been meaning to investigate this more.

Take care,
Steve
Title: Re: Monitoring a Classic with Mango SCADA software
Post by: Westbranch on January 18, 2013, 05:35:04 PM
Steve I think your post # 15 is missing a few links...??
Title: Re: Monitoring a Classic with Mango SCADA software
Post by: mtdoc on January 18, 2013, 05:38:06 PM
Quote from: Stevededrick on January 18, 2013, 05:03:29 PM
The Arduino might be a good way to go too.  I'm not really familiar with all its features.  A lot of Arduino users have downloaded Mango Automation. 

Does the Arduino have much of a UI?  Does it store data and serve up trending?  I've been meaning to investigate this more.

Take care,
Steve

Well, I'm just learning Arduino myself- got one a few weeks ago - so no expert here.  I'm also no programmer- though in the past I've done a fair amount of programming with LabView and have played a bit with Python.  I'm just now learning Arduino's very friendly IDE.  What  I know is that the  Arduino has multiple analog and digital I/O's and has decent A/D capability.  It connects via USB (or wirelessly with a bluetooth, Wifi, or Xbee shield) to a host computer (could be a Raspberry Pi).

UI is via the IDE on  the host computer.  The possibilities for using it to stream data from multilple sensors (or log data for later delivery) to a host computer or directly to a web host seem endless given the numerous hardware shields available, large user community,  etc...  All for a very low cost.

There is a modbus  library for the Arduino IDE.

So it seems to me that it could do what the DataNab "relay output module" does with a lot more flexibility and for less money.

The sensor data from the Arduino could then be put to good use by something like Mango or Labview... :D

But - I'm still learning this stuff.....

Title: Re: Monitoring a Classic with Mango SCADA software
Post by: Stevededrick on January 18, 2013, 05:39:14 PM
Quote from: Westbranch on January 18, 2013, 05:35:04 PM
Steve I think your post # 15 is missing a few links...??
Opps - I just modified the post and added this link to a project we did http://infiniteautomation.com/index.php/solution-examples/4-ecodashboard.html

www.Datanab.com has a fair amount of the sensors we used.

Steve
Title: Re: Monitoring a Classic with Mango SCADA software
Post by: stephendv on January 19, 2013, 03:20:57 AM
Quote from: TomW on January 18, 2013, 03:56:47 PM
Still no go with your script.

Pity!  Well it's raining cats and dogs here, so no outside work for me.  If you're feeling brave you could give me SSH access into your rPI and I'll try and fix it for you.
You can get me on email at: stephendv at gmail dot com.
Title: Re: Monitoring a Classic with Mango SCADA software
Post by: TomW on January 19, 2013, 10:25:33 AM
Stephen;

Email sent.

Thanks.

Tom
Title: Re: Monitoring a Classic with Mango SCADA software
Post by: Stevededrick on January 21, 2013, 02:56:40 AM
I'd love to hear more about your testing as it goes.  Looks very promising!

Take care,
Steve

Quote from: mtdoc on January 18, 2013, 05:38:06 PM
Quote from: Stevededrick on January 18, 2013, 05:03:29 PM
The Arduino might be a good way to go too.  I'm not really familiar with all its features.  A lot of Arduino users have downloaded Mango Automation. 

Does the Arduino have much of a UI?  Does it store data and serve up trending?  I've been meaning to investigate this more.

Take care,
Steve

Well, I'm just learning Arduino myself- got one a few weeks ago - so no expert here.  I'm also no programmer- though in the past I've done a fair amount of programming with LabView and have played a bit with Python.  I'm just now learning Arduino's very friendly IDE.  What  I know is that the  Arduino has multiple analog and digital I/O's and has decent A/D capability.  It connects via USB (or wirelessly with a bluetooth, Wifi, or Xbee shield) to a host computer (could be a Raspberry Pi).

UI is via the IDE on  the host computer.  The possibilities for using it to stream data from multilple sensors (or log data for later delivery) to a host computer or directly to a web host seem endless given the numerous hardware shields available, large user community,  etc...  All for a very low cost.

There is a modbus  library for the Arduino IDE.

So it seems to me that it could do what the DataNab "relay output module" does with a lot more flexibility and for less money.

The sensor data from the Arduino could then be put to good use by something like Mango or Labview... :D

But - I'm still learning this stuff.....
Title: Re: Monitoring a Classic with Mango SCADA software
Post by: fca on July 18, 2013, 06:00:41 PM
Hi there
I'm using a fork of mango ScadaBR and here you have my first view, viewed by mango


http://tinyurl.com/o7vfbox
Title: Re: Monitoring a Classic with Mango SCADA software
Post by: boB on July 19, 2013, 03:39:18 AM
Quote from: fca on July 18, 2013, 06:00:41 PM
Hi there
I'm using a fork of mango ScadaBR and here you have my first view, viewed by mango


http://tinyurl.com/o7vfbox


That's pretty cool, FCA !!

boB