A Forum run by Enthusiasts of MidNite Solar

Charge Controllers and Clippers => The "Classic" charge controller => Classic and Classic Lite BETA Firmware... => Topic started by: TomW on December 11, 2012, 01:12:28 PM

Title: Linux based Midnite firmware updater
Post by: TomW on December 11, 2012, 01:12:28 PM
Folks;

Not sure if this is ready for general use yet, but I can confirm that it works.

A few "gotchas" were encountered but it works.

One thing I discovered is that the USB connection can go through a powered hub to update the firmware but it does not seem to work if another device, in my case a USB stick, is attached to the hub.

I have successfully installed both 1072 and 1181 to the Classic 150 I have and the MNGP using this tool.

I have to say thanks to Ryan, Andy and boB for seeing the need for this tool and putting the resources into developing it. It is a Python script and I think that makes it truly cross platform support.

So, for those of you that do not use Windows I think they may have this tool ready for prime time soon.

I used this tool with my Vaio laptop running Ubuntu 11.10 and my Raspberry Pi running Debian Raspbian "Wheezy". I also use the Pi to monitor the USB data dump feature on the Classic.

Both simply needed to have the python-serial package installed to use it which takes  a couple minutes to install using sudo apt-get install python-serial.

Thanks again for the tool and a chance to test it, Midnite guys!

Tom
Title: Re: Linux based Midnite firmware updater
Post by: boB on December 11, 2012, 03:01:16 PM
Tom, can you really update a Classic and MNGP from a  Raspberry Pi  ???

If so, this might be useful for field updating for installers/dealers etc.

This is very cool and useful !

boB
Title: Re: Linux based Midnite firmware updater
Post by: TomW on December 11, 2012, 03:46:30 PM
Quote from: boB on December 11, 2012, 03:01:16 PM
Tom, can you really update a Classic and MNGP from a  Raspberry Pi  ???

If so, this might be useful for field updating for installers/dealers etc.

This is very cool and useful !

boB

boB;

Absolutely!

tomw@raspberrypi ~ $ cat /proc/cpuinfo
Processor   : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS   : 697.95
Features   : swp half thumb fastmult vfp edsp java tls
CPU implementer   : 0x41
CPU architecture: 7
CPU variant   : 0x0
CPU part   : 0xb76
CPU revision   : 7

Hardware   : BCM2708
Revision   : 000f

running Raspbian: wheezy/sid

It does not have a display or keyboard but they make some cool gear to get past that. It has composite and HDMI video and usb keyboards work.

A real geek could set it up to do it headless.  Seems you could have it run a script on boot that uploads it on its own. Could even drive a GPIO pin to light an LED when its ready to power up the Classic and to indicate it is finished. Its Linux so it could do things nobody has even dreamed of yet.

You could make your own image that just has the bits you need. When things change just update the image and distriubute that so the installer can write it to an SD card.

Cheap, too!

Just spitballing there but ...

Tom
Title: Re: Linux based Midnite firmware updater
Post by: TomW on December 11, 2012, 03:52:18 PM
Additionally, as long as we are dreaming.

Maybe could integrate it into your systems to handle logging / communications, maybe a web based programming GUI? @ $40 its a very versatile piece of kit.

Tom
Title: Re: Linux based Midnite firmware updater
Post by: dgd on December 15, 2012, 06:20:54 AM
Quote from: TomW on December 11, 2012, 01:12:28 PM

Not sure if this is ready for general use yet, but I can confirm that it works.

I have successfully installed both 1072 and 1181 to the Classic 150 I have and the MNGP using this tool.

OK so where is this linux updater program?

dgd
Title: Re: Linux based Midnite firmware updater
Post by: TomW on December 15, 2012, 07:11:41 AM
Quote from: dgd on December 15, 2012, 06:20:54 AM

OK so where is this linux updater program?

dgd

dgd;

It was emailed to me but I am not sure I can pass it on. I didn't exactly sign an NDA but it is beta software so I will let Ryan,boB or Andy decide if it can go public.

They may release it  but it is not my decision to make.

Tom
Title: Re: Linux based Midnite firmware updater
Post by: Halfcrazy on December 15, 2012, 07:13:58 AM
It is actually linked in each revision of beta firmware. This thread here:  http://midnitesolar.com/smf_forum/index.php?topic=913.0
Title: Re: Linux based Midnite firmware updater
Post by: TomW on December 15, 2012, 07:51:22 AM
Quote from: Halfcrazy on December 15, 2012, 07:13:58 AM
It is actually linked in each revision of beta firmware. This thread here:  http://midnitesolar.com/smf_forum/index.php?topic=913.0

Great! I must have missed that or was having what I like to refer to as a Senior Moment.  :o
Title: Re: Linux based Midnite firmware updater
Post by: Westbranch on February 24, 2013, 09:26:26 PM
OK just tried to use my Linux based machine to use the most recent version of the updater,  BUT no go.  The above link does not work either???

Loaded just fiiiiiiine on the desktop with XP home
Title: Re: Linux based Midnite firmware updater
Post by: TomW on February 24, 2013, 09:31:22 PM
Quote from: Westbranch on February 24, 2013, 09:26:26 PM
The above link does not work either???

Yeah got this error:


The topic or board you are looking for appears to be either missing or off limits to you.


Tom
Title: Re: Linux based Midnite firmware updater
Post by: dgd on February 24, 2013, 09:45:01 PM

Yes,  I get the same error, Who do you see about getting this problem resolved?

dgd
Title: Re: Linux based Midnite firmware updater
Post by: boB on February 25, 2013, 02:07:37 AM

I get the error too.   If you are talking about the Linux updater to use with this latest beta code and
cannot wait, download the older one here     http://fusion.midnitesolar.com/MNupdateForLinux_12-1-2012.rar
and also the windows beta code, run the windows exe file (in windoze) to extract the files and copy the
.ctl an .rem  files over to the Linux install directory.   The actual files to update with (ctl and rem) are
the same.  The .rem (MNGP, remote) has not changed though.

boB

Title: Re: Linux based Midnite firmware updater
Post by: Westbranch on February 26, 2013, 01:33:24 PM
Did some reading and Python 2.7 is needed. 
I assume that Py 2.73, the  latest version, is the one to use?
Title: Re: Linux based Midnite firmware updater
Post by: TomW on February 26, 2013, 01:58:44 PM
Quote from: Westbranch on February 26, 2013, 01:33:24 PM
Did some reading and Python 2.7 is needed. 
I assume that Py 2.73, the  latest version, is the one to use?

mnupdate.py for sure works with:

python --version
Python 2.7.2+

Editted for clarity:

It does NOT work with:

[tomw@pi2 ~]$ python --version
Python 3.3.0

Tosses this error:

[tomw@pi2 ~]$ ./mnupdate.py
  File "./mnupdate.py", line 28
    print "Error: Unable to import python serial module (pyserial)."
                                                                   ^
SyntaxError: invalid syntax

Chokes on "import serial" Might be a diff syntax on 3.3.0

Thios is my lone ArchLinux version  Pi that I use for monitoring the Classics. and I am going to replace Arch with The Raspbian image when I get ambitious. It has the proper version for that script.



Tom
Title: Re: Linux based Midnite firmware updater
Post by: Vern Faulkner on December 05, 2015, 09:54:12 AM
Returning from the build-off-grid-cabin-on-short-notice dormancy, i see a press to update the classics to the latest and greatest firmware.

Small problem: no windoze machine at hand.... just ubuntu and android around here.  Is there a linux updater, or, alternately, wine-based process I can use?
Title: Re: Linux based Midnite firmware updater
Post by: atop8918 on December 06, 2015, 08:17:45 AM
I'm such a geek -- I run my pi headless. Actually more just because I'm CHEAP.
Title: Re: Linux based Midnite firmware updater
Post by: dgd on December 08, 2015, 04:25:30 PM
Andrew,
What IDE are you and Mario using for software development for Classic and KID cpus ?
Is it hosted on Win* and /or Linux ?

dgd
Title: Re: Linux based Midnite firmware updater
Post by: atop8918 on December 09, 2015, 03:14:47 AM
Sorry, didn't understand "cpus"?

I think most of us use Windows-based tools though I've been using Gnu/Linux ones where possible. Eclipse is nice as an IDE because I can host whatever tools I want on it, including hosting them on another machine (like a windows box) and it runs equally well on Linux and Windows so there's really very little difference. I can even put my projects on an external drive and use whichever machine is closest to my dent in the sofa.
Title: Re: Linux based Midnite firmware updater
Post by: boB on December 09, 2015, 03:35:02 AM
Quote from: atop8918 on December 09, 2015, 03:14:47 AM
Sorry, didn't understand "cpus"?


CPU's  I think he meant.

We mainly use the IAR  IDE / compiler.
Mario has been using NXP/ARM Espresso, or is that Expresso ?

boB
Title: Re: Linux based Midnite firmware updater
Post by: atop8918 on December 11, 2015, 08:22:28 AM
Duh, I'm an idiot.
Thanks boB!
Title: Re: Linux based Midnite firmware updater
Post by: zamboni on January 20, 2016, 02:05:46 AM
Hey there, i'm looking for some help on using the Mac tool to update firmware. This post came up in search because it contains the exact error phrase i'm getting: "Error: Unable to import python serial module (pyserial)"...but it seems like y'all are operating well above my level.

I am NOT conversant in command-line stuff, just a technically-minded person with a mac, who doesn't mind using Terminal if necessary.

I installed Xcode, python 2.7.10, and pyserial from Macports, per the MNUpdate MAC Readme.txt file. Had to install Java at some point, too.
I don't see any errors in the text returned after executing any of those commands.
When i try to run the update script, it returns only that error message above, followed by "See README.txt for further information".

I'd be very grateful to anyone who can suggest what i should try next. I don't have access to any windows machines to update my firmware with.

Thanks!