A Forum run by Enthusiasts of MidNite Solar

MidNite Solar Monitoring software and hardware => MidNite Monitoring FAQ'S => Topic started by: TomW on November 06, 2012, 08:23:40 AM

Title: Modpoll command line to poll the Classic?
Post by: TomW on November 06, 2012, 08:23:40 AM
I am looking for a command line for modpoll Linux (Ubuntu 11.10) to use in a crond script to poll the Classic over ethernet. I just cannot seem to pass it the right options? Or, perhaps it cannot do it that way?

I am not interested in GUI methods as I just want raw data to process.

BTW, my Local status panel communication issue "may" have been network hardware and not the Classic. I upgraded some gear here and it has been running fine for about 36 hours so I am starting to succumb to my data logging addiction again. :o

Thanks in advance for any help.

Tom

Edit: Additional info:

Regardless of the options I pass I get this error:

Quote
Can't reach server/slave! Check TCP/IP and firewall settings.

I can ping it by name or IP and the status panel connects fine.

I know I cannot do more than one connection at a time so I close the Status Panel when I am using modpoll.

t
Title: Re: Modpoll command line to poll the Classic?
Post by: boB on November 06, 2012, 04:23:05 PM
Tom,

when I was playing around with modpol at home, this is the contents
of my .BAT file I used to continuously read a bunch of registers...


:loop

modpoll -m tcp -t4:hex -r 4101 -c 50 -1 192.168.1.38

goto loop


This would read back 50 registers in hex format from   that local IP address.

I would imagine (haven't tried it) that you would need to add on the port
number to the end of that if you are coming from the outside.  Maybe like this ???


modpoll -m tcp -t4:hex -r 4101 -c 50 -1 192.168.1.38:502


That would be for port 502.   You might give that at try.

boB


Title: Re: Modpoll command line to poll the Classic?
Post by: TomW on November 06, 2012, 06:34:05 PM
Thanks, boB.

Getting some data now!  ;D Next I get to sort out the register decoding process. I saw some posts on that but it seemed a bit confused.

Thanks.

Tom

Title: current register map?
Post by: TomW on November 07, 2012, 07:26:26 AM
boB;

What is the most current register map? The one I have is classic_register_map_Rev-A-May21-2011.pdf. A lot of it seems to be  overmarked "preliminary".

How many registers are there? I get timeouts with any value greater than 61 for the register count.

I also noticed that you must specify the port the Classic is using(-p ###). The -h help states 502 is the default but until I specified it I got access errors. Just FYI for the next person.

Just where I am now.

Thanks.

Tom

Title: Re: Modpoll command line to poll the Classic?
Post by: boB on November 07, 2012, 06:19:55 PM

I had a problem reading 100 registers so I told it to read only 50 and that worked.

Sounds like you're finding that you can only read 61 registers with modpol.
Not sure why ??

All of the battery voltage and currents near the bottom of the map have not
changed.   Will be working on a newer map soon as a few things have changed
but none of those important ones.

I am in the process of changing a few of the enable flags around register 4186  around
to make some new compatibilites with the Classic Lite though as its firmware
cannot be updated in the field and tends to reset some of the newer enable flags I
am adding for Follow Me etc.

boB
Title: Re: Modpoll command line to poll the Classic?
Post by: TomW on November 07, 2012, 08:40:57 PM
boB;

Thanks. I am not getting fancy just extracting some basics and did not want to chase my tail on the wrong registers. for now I have been grepping one register per command line. Like this:

Quote
tomw@VAIO:~$ modpoll -m tcp -p 502 -t4 -r 4100 -c 55 -10 192.168.2.129 |grep 4114|awk '{ print $2/10,"Volts DC"}'
23.9 Volts DC


Not very elegant but a learning tool.

FYI for anyone looking at doing this.. modpoll doesn't work (yet) on my Asus EEEPC with an Atom processor running Ubuntu. Must be a library thing. It runs but bitches about improper options that work on the "regular" laptop.

Thanks.

Tom
Title: Re: Modpoll command line to poll the Classic?
Post by: Westbranch on November 07, 2012, 08:45:38 PM
Tom, which ASUS? there area a bunch of models...
Title: Re: Modpoll command line to poll the Classic?
Post by: TomW on November 07, 2012, 09:24:39 PM
Quote from: Westbranch on November 07, 2012, 08:45:38 PM
Tom, which ASUS? there area a bunch of models...

From /proc/cpuinfo:

model      : 28
model name   : Intel(R) Atom(TM) CPU N280   @ 1.66GHz

It is an Asus 1000HE. I used to use it for my laptop but it is so small I can't type on the keyboard. Now it sits on a shelf doing most of my logging and monitoring.

Tom
Title: Re: Modpoll command line to poll the Classic?
Post by: Westbranch on November 07, 2012, 09:55:59 PM
We have an Eee PC 4G, on of the earliest versions, that was not really designed for upgrades to the Linux OS or any of the onboard programs either... I thought it might make do just as you are doing, logging data/

Been contemplating a new one due to the small size, my fingers are too big  and my eyes too weak.
Title: Re: Modpoll command line to poll the Classic?
Post by: TomW on November 07, 2012, 10:44:43 PM
Quote from: Westbranch on November 07, 2012, 09:55:59 PM

Been contemplating a new one due to the small size, my fingers are too big  and my eyes too weak.

If it has USB maybe you could use a USB keyboard and if it has a video out you could use a monitor for a display to get it set up to do logging. If..if..

Once its running Linux you don't need the keyboard or monitor / display as you can log in to it from the network to operate it. My Asus has not had the lid opened in months. The screen is powered off to lower power use, too.

In fact, if it can boot from USB you can run a live Linux image off the USB stick without modifying your current programs. If..

More than one way to defur a feline.

Tom
Title: Re: Modpoll command line to poll the Classic?
Post by: Westbranch on November 07, 2012, 11:46:57 PM
Oh, it is fully functioinal but it has an early version of Linux on it ????, if that is what you are saying, just that the last programing i did was in FORTRAN on a 64 k behemoth that occupied 4 floors (in '73) of the Electrical engineering building a UBC.... was the largest IBM CPU on the west coast at the time