sagreen83
Posts: 22
Joined: Wed Sep 05, 2018 2:54 pm

Re: Using a Pi to Log Data in a Magnum Energy System

Sun Nov 18, 2018 11:29 pm

CharlesGodwin wrote:
Sun Nov 18, 2018 11:10 pm
I have not tested that way for a while. I use eclipse which is slightly different. I'll look at it later. I'm not near my PC.
Ok, I just installed the normal (non build) way. If I add .SSSZ to the date format, as follows, the webserver does not return results (must be crashing somewhere in the json build).

dateformat=yyyy-MM-dd HH:mm:ss.SSSZ

If I drop the SSSZ it works fine. I'm not seeing anything in the server log, and on a hope I added trace=true to the server.options file but that didnt produce any more output.

Scott...

CharlesGodwin
Posts: 62
Joined: Wed Aug 22, 2012 9:57 pm
Location: Ottawa Canada

Re: Using a Pi to Log Data in a Magnum Energy System

Sun Nov 18, 2018 11:35 pm

Strange. I did that earlier and it worked. The old code worked by just dropping the Z.

I'm still not near my PC

sagreen83
Posts: 22
Joined: Wed Sep 05, 2018 2:54 pm

Re: Using a Pi to Log Data in a Magnum Energy System

Sun Nov 18, 2018 11:42 pm

CharlesGodwin wrote:
Sun Nov 18, 2018 11:35 pm
Strange. I did that earlier and it worked. The old code worked by just dropping the Z.

I'm still not near my PC
No hurry. The new code works by dropping the Z as well. so if i do .SSS it works. Its the Z that is killing it. Hoping I'm not confusing things. I assumed that you were trying to fix the Z (timezone) part of dateformat.

Scott...

CharlesGodwin
Posts: 62
Joined: Wed Aug 22, 2012 9:57 pm
Location: Ottawa Canada

Re: Using a Pi to Log Data in a Magnum Energy System

Mon Nov 19, 2018 2:53 pm

@scott

I am confused as all my tests with release 1.0.6 supports the Z. This morning I did the following:

Note: There are some changes to prior build instructions. I will list them at the bottom. I am also attaching a log of all these activities.
  • I created a new directory on a Pi
  • I installed ant and a Java Development Kit (JDK) as all I had previously was just a runtime.
  • I downloaded a zip of the source for Release_1.0.6 branch from gitHub
    https://gitlab.com/Magnum_Energy/distri ... _1.0.6.zip
  • I deleted 2 files that should not be in the zip file(No longer needed)
  • I followed build instructions in BUILD_INFO.md
  • I created a new test directory
  • I copied the two files needed for an install into the test directory
  • I ran the setup program
  • Because I have no Magnum system nearby I modified the magnum_server.options file to reference a mock json file and I copied the .json file into the folder
  • I started the server with an override of the dateformat

    Code: Select all

    ./startserver dateformat="yyyy-MM-dd'T'HH:mm:ss.SSSZ"
  • I got the expected result from the server using

    Code: Select all

    curl localhost:19450
    . The full record is in the log but it starts with {"Date":"2018-11-19T09:05:49.373-0500","timezone":"-05:00"
  • I then modified the options file to include dateformat=yyyy-MM-dd'T'HH:mm:ss.SSSZ setting instead of using the command line override
  • I restarted the server and got the same result.
I'm not sure where your problem is. I can only guess. Did you copy the pair of files for an install to your target directory (magnum_xxxx.zip and setup_xxxx) and then run the setup_xxxxx script? This is important as it modifies some jar file names in the lib directory. Can you send me a directory listing of the lib folder? "ls -l lib"

What is 'wrong' with the zip file?

The interim release source zip file contains two files that should NOT be included. Once you have unzipped the source files delete these two files before the first ant step.

As of 2018/11/19 10:20 Eastern these files were removed from the zip file.

The document BUILD_INFO.md has been revised to include how to install ant and JDK for Pi systems and some refinements to the steps. The fundamentals remain unchanged.

I will remove the two extra files before the official release.
Attachments
magnumbuild.zip
(5.04 KiB) Downloaded 12 times

CharlesGodwin
Posts: 62
Joined: Wed Aug 22, 2012 9:57 pm
Location: Ottawa Canada

Re: Using a Pi to Log Data in a Magnum Energy System

Mon Nov 19, 2018 4:54 pm

@scott

I notice that building extra plugins can be complicated if you need to checkout the entire source, add your code and then build a private version. That's a lot of work.

My method is to have a separate project for just compiling the extra plugin code. I then build a jar file with a different name containing just that code. I then place that jar into the pi lib directory and all is good. I only need to rebuild this jar when my code changes.

It would not be too much effort to create an ant build file and short document to support this. Is anyone interested?

sagreen83
Posts: 22
Joined: Wed Sep 05, 2018 2:54 pm

Re: Using a Pi to Log Data in a Magnum Energy System

Thu Nov 29, 2018 12:00 pm

Thats interesting... I just ran the same commandline as you did.

./startserver dateformat="yyyy-MM-dd'T'HH:mm:ss.SSSZ"

I get the following in the logger log...

2018-11-29 05:53:55 Error encountered:file_get_contents(http://localhost:19450/): failed to open stream: HTTP request failed!
2018-11-29 05:53:55 Sleeping for 60 seconds

I'll try to do this with the process you described in your message.

Scott...

CharlesGodwin
Posts: 62
Joined: Wed Aug 22, 2012 9:57 pm
Location: Ottawa Canada

Re: Using a Pi to Log Data in a Magnum Energy System

Thu Nov 29, 2018 1:07 pm

I hope its' something simple.
Before you rebuild and replace I suggest you delete all your magnum*.jar files in the lib directory so there are no old rogue versions getting in the way.

Code: Select all

rm lib/magnum*.jar
If you hit glitches please email me as my responses can be quicker and more specific. Thanks

CharlesGodwin
Posts: 62
Joined: Wed Aug 22, 2012 9:57 pm
Location: Ottawa Canada

Re: Using a Pi to Log Data in a Magnum Energy System

Thu Jan 10, 2019 10:07 pm

This is addressed to anyone using my software.
I haven’t published any changes to my software but I plan a cleanup. More like pruning dead branches. Take a look at this https://gitlab.com/Magnum_Energy/distri ... FOR_2.0.md and tell me if there are any problems. I’m trying to make it simpler to use, maintain and document.

If you are using my software please email me so I know who is out there when I plan changes.

magnum-at-godwin-dot-ca

Return to “Automation, sensing and robotics”