Author Topic: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100  (Read 139259 times)

0 Members and 1 Guest are viewing this topic.

Offline keckec

  • Senior Member
  • **
  • Posts: 62
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #275 on: April 30, 2014, 12:40:14 AM »
Initially on the Gateway the red LED was flashing. I pushed the button after using the Gateway Advanced Setup and after a while the red LED went solid.

dump.log wrote out 3 entries:
2014-04-29 21:18:47   Packet Type 00:10 Length: 0 bytes
     No Data
2014-04-29 21:19:22   Packet Type 00:20 Length: 0 bytes
     No Data
2014-04-29 21:19:28   Packet Type 00:30 Length: 0 bytes
     No Data

I then held the Rain button on the weather station until it beeped.
REG flashed for a few seconds the there were 2 beeps and INTERNET flashed.

dump.log now has:
2014-04-29 21:19:38   Packet Type 00:70 Length: 0 bytes
     No Data

No matter what I do I only get packet types 00:70.

Stuck and looking for ideas?
You might try adding the following code right before the comment that says "All output created here", near line 1128 on mine but our line numbers probably differ at this point. You'll have to adjust the curly braces. This should log any other packets the gateway sends along.
Code: [Select]
    } else {
        // Log any other packets that come along
        $postdata = file_get_contents("php://input");
        write_dump_log($postdata,$id1.":".$id2);
    }
Maybe it isn't happy with the serial number you're using. You could try the serial number I used, 7fff14763c3b5b61. It's quite possible this number is derived from some other part of my initial exchange and won't work for you. Do you have Wireshark or tcpdump (Linux) available? If so you could capture the actual exchange. This is all new territory, and maybe there's something else we don't know about. Also, check the logs from your web server to make sure there isn't some other problem.

I'm out of ideas but will post back if I think of more.

Offline Scott_A

  • Member
  • *
  • Posts: 7
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #276 on: April 30, 2014, 12:59:28 AM »
Finally got it to work:

Started off by adding $do_reply=1 above this section because I already knew I wanted to send a 14:00 packet:
Code: [Select]
$do_reply=1;
                if($do_reply)
                {
                        // Reply with 14:00 and 38 bytes of data.  This data is likely configuation of the WS
                        header('HTTP_FLAGS: 14:00');

After this it still didn't work so I left the above and set the serial manually here:
Code: [Select]
//      $reply.=$station_serial;
$reply.=chr(0x7f).chr(0xff);                                                           
$reply.=chr(0x20).chr(0x14).chr(0x04).chr(0x29).chr(0x25).chr(0x94);

Still no go so I changed the checksum back to the original:
Code: [Select]
// Checksum
    $reply=$reply.chr(checksum8($reply));
     //      $csum=checksum16($reply)+0x17;
     //      $reply.=chr($csum>>8).chr($csum&0xff);

Looks like it registered and INTERNET is showing on the WS. It also correctly set my date and time which I manually messed up first.

Contents of dump.log
Code: [Select]
2014-04-29 22:47:50   Packet Type 00:70 Length: 0 bytes
     No Data
2014-04-29 22:49:02   Packet Type 7F:10 Length: 13 bytes
     |00|01|02|03|04|05|06|07|08|09|0a|0b|0c
00 - |01|02|03|04|05|06|07|08|02|00|22|73|4d
2014-04-29 22:49:03   Packet Type 01:14 Length: 14 bytes
     |00|01|02|03|04|05|06|07|08|09|0a|0b|0c|0d
00 - |7f|ff|20|14|04|29|25|94|02|00|22|14|5e|63
2014-04-29 22:49:06   Packet Type 01:01 Length: 197 bytes
     |00|01|02|03|04|05|06|07|08|09|0a|0b|0c|0d|0e|0f|10|11|12|13|14|15|16|17|18|19|1a|1b|1c|1d|1e|1f
00 - |01|64|14|01|01|30|10|10|03|51|30|10|10|01|06|18|00|61|20|06|18|00|01|30|10|10|00|11|30|10|10|00
20 - |16|11|00|61|10|0a|a1|00|01|30|10|10|00|11|30|10|10|00|16|11|00|61|10|0a|aa|a0|13|01|01|00|01|13
40 - |01|01|00|35|36|29|29|13|01|01|00|01|13|01|01|00|01|32|32|aa|00|00|00|00|00|00|00|00|00|00|00|00
60 - |00|00|00|00|00|00|00|00|00|00|13|01|01|00|01|00|00|00|00|00|00|13|01|01|00|32|00|00|00|00|00|00
80 - |00|00|00|00|00|a0|00|00|00|13|01|01|00|00|00|00|00|00|00|00|55|00|bb|bb|13|01|01|00|01|00|00|00
a0 - |00|00|00|15|00|bb|bb|02|99|21|01|32|02|99|11|01|28|02|99|31|01|35|13|01|01|00|01|13|01|01|00|31
c0 - |05|53|07|e9|1f
2014-04-29 22:49:15   Packet Type 01:00 Length: 5 bytes
     |00|01|02|03|04
00 - |41|64|15|c0|f9
2014-04-29 22:49:15   Packet Type 14:01 Length: 38 bytes
     |00|01|02|03|04|05|06|07|08|09|0a|0b|0c|0d|0e|0f|10|11|12|13|14|15|16|17|18|19|1a|1b|1c|1d|1e|1f
00 - |01|7f|ff|20|14|04|29|25|94|00|32|00|0b|00|00|00|0f|00|00|00|03|00|3e|de|10|49|15|29|04|14|53|07
20 - |04|00|00|00|05|18
2014-04-29 22:49:17   Packet Type 00:70 Length: 0 bytes
     No Data
2014-04-29 22:53:18   Packet Type 00:70 Length: 0 bytes
     No Data
2014-04-29 22:53:21   Packet Type 01:01 Length: 197 bytes
     |00|01|02|03|04|05|06|07|08|09|0a|0b|0c|0d|0e|0f|10|11|12|13|14|15|16|17|18|19|1a|1b|1c|1d|1e|1f
00 - |01|64|14|01|01|40|42|91|05|31|30|10|10|01|06|18|00|61|20|06|17|00|01|30|10|10|00|11|30|10|10|00
20 - |16|11|00|61|10|0a|a1|00|01|30|10|10|00|11|30|10|10|00|16|11|00|61|10|0a|aa|a0|13|01|01|00|01|14
40 - |04|29|10|53|36|29|29|13|01|01|00|01|13|01|01|00|01|32|32|aa|00|00|00|00|00|00|00|00|00|00|00|00
60 - |00|00|00|00|00|00|00|00|00|00|13|01|01|00|01|00|00|00|00|00|00|14|04|29|10|52|00|00|00|00|00|00
80 - |00|00|00|00|00|a0|00|00|00|13|01|01|00|00|00|00|00|00|00|00|55|00|bb|bb|13|01|01|00|01|00|00|00
a0 - |00|00|00|15|00|bb|bb|02|99|31|01|35|02|99|11|01|28|02|99|31|01|35|13|01|01|00|01|14|04|29|10|53
c0 - |04|53|07|a4|bc
2014-04-29 22:57:19   Packet Type 00:70 Length: 0 bytes
     No Data
2014-04-29 22:57:35   Packet Type 01:01 Length: 197 bytes
     |00|01|02|03|04|05|06|07|08|09|0a|0b|0c|0d|0e|0f|10|11|12|13|14|15|16|17|18|19|1a|1b|1c|1d|1e|1f
00 - |01|64|14|01|01|40|42|91|05|41|30|10|10|01|06|18|00|61|20|06|17|00|01|30|10|10|00|11|30|10|10|00
20 - |16|11|00|61|10|0a|a1|00|01|30|10|10|00|11|30|10|10|00|16|11|00|61|10|0a|aa|a0|13|01|01|00|01|14
40 - |04|29|10|57|36|29|29|13|01|01|00|01|13|01|01|00|01|32|32|aa|00|00|00|00|00|00|00|00|00|00|00|00
60 - |00|00|00|00|00|00|00|00|00|00|13|01|01|00|01|00|00|00|00|00|00|14|04|29|10|56|00|00|00|00|00|00
80 - |00|00|00|00|00|a0|00|00|00|13|01|01|00|00|00|00|00|00|00|00|55|00|bb|bb|13|01|01|00|01|00|00|00
a0 - |00|00|00|15|00|bb|bb|02|99|31|01|35|02|99|11|01|28|02|99|31|01|35|13|01|01|00|01|14|04|29|10|57
c0 - |04|53|07|f1|8f

Thanks to everyone who has contributed so far!

Offline Scott_A

  • Member
  • *
  • Posts: 7
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #277 on: April 30, 2014, 08:58:56 AM »
Now that everything is registered I changed the gateway to point to my windows box and to the SkySpy service so it starts collecting some data to my MySQL database.
Hopefully keckec is working on getting the php to write data to the same database.  :grin:

One thing to note for those running SkySpy in win7. When you run SkySpy Monitor right-click and run as Administrator otherwise any changes to the database settings tab will not 'stick'.

Once again a big thanks to everyone who has contributed code, test data or other knowledge to this endeavor!

 =D>

Offline keckec

  • Senior Member
  • **
  • Posts: 62
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #278 on: April 30, 2014, 10:17:38 AM »
Finally got it to work:
Outstanding work!!!   =D>

That's a big hurdle in this process you've overcome.
Quote
After this it still didn't work so I left the above and set the serial manually here:
Code: [Select]
//      $reply.=$station_serial;
$reply.=chr(0x7f).chr(0xff);                                                           
$reply.=chr(0x20).chr(0x14).chr(0x04).chr(0x29).chr(0x25).chr(0x94);
Where did you get the serial number? Did you just make it up?

Quote
Looks like it registered and INTERNET is showing on the WS. It also correctly set my date and time which I manually messed up first.
Congratulations. Looks like you're set.

I'm curious if your gateway is sending out 210-byte 01:01 packets. I think the GW is supposed to send these out for about 15 minutes, then stop. My gateway is still sending these, about every 2 seconds, with occasional breaks for a minute or two. I turned off logging of those packets in the php file, but it might still be writing the binary contents to a file postdata210.bin. Do you see this file in the same directory as the php file? If so, does its last modification time show that it's still being written to, or was it only written to right after you registered it.

Yes, my plan is to have the php code dump data into a mysql database, and have other php code to display historical data, graphs, etc. That might be down the line a bit as I have some other projects that need attention.

Offline Scott_A

  • Member
  • *
  • Posts: 7
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #279 on: April 30, 2014, 07:42:45 PM »
Quote
Where did you get the serial number? Did you just make it up?
I made it up - 7fff201404292594
7fff - Someone said they all started with this
20140429 - Yesterdays date
2594 - My address  :-)

Quote
I'm curious if your gateway is sending out 210-byte 01:01 packets.
Yes it is, in less than 10 hours the postdata210.bin file has grown to 2.2 MB

Offline keckec

  • Senior Member
  • **
  • Posts: 62
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #280 on: April 30, 2014, 08:01:35 PM »
Quote
Where did you get the serial number? Did you just make it up?
I made it up - 7fff201404292594
7fff - Someone said they all started with this
20140429 - Yesterdays date
2594 - My address  :-)
That's great news. I was hoping we could choose anything. The numbers we've seen from LCX all start with 7FFF, so that may be important.
Quote
Quote
I'm curious if your gateway is sending out 210-byte 01:01 packets.
Yes it is, in less than 10 hours the postdata210.bin file has grown to 2.2 MB
You can disable saving that data if you want. It probably won't do you any good unless you want to analyze it. What it writes is the system date as a 4-byte integer, followed by the 210-byte payload from the packet. Each time your GW sends one of these it adds another 214 bytes to the file. You can turn this off by commenting out the following line near the bottom of the file:
Code: [Select]
file_put_contents($filename,$packtime.$postdata,FILE_APPEND);That line saves all the packets we haven't really figured out yet.
That the GW sends these packets really doesn't matter for the PHP code, but I think it may significantly shorten battery life of the console. I see the Internet annunciator on the console blink when it sends one of these, so I think it's probably firing up its RF transmitter to send the data to the GW. Doing that every 2 seconds instead of every 4 minutes is bound to take more power. Skydvr doesn't see this on his, so there's bound to be something that will stop it. I'm working on that.

Offline skydvrz

  • Senior Contributor
  • ****
  • Posts: 224
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #281 on: April 30, 2014, 10:11:35 PM »
I'm still struggling with the 38 byte RTC packet.  Everything is sent correctly in the content part of the packet and I am now creating the checksum  using the 7-offset.  Still no clock reset / Internet indicator.  I even hand-calculated / double-checked the checksum on several packets.  Everything is perfect in the content.

Not so, in the HTML header.  #-o

I am beginning to think the GW HTML parser firmware is pretty dumb and can't grok header lines received out of order.  Using the HTML library I have, I don't have full control over which line each header value appears on.  All the lines are in there just fine, just not in the normal IIS order.

I can reconnect to LCX and the clock resets within a minute or two.  Using SkySpy, the Internet indicator shuts off and the clock begins to drift (very slowly).

I will look into alternate setups of my TCP/IP & HTML libraries (Internet Direct, aka "Indy").  Maybe I can better simulate IIS  ](*,)

For the record, SkySpy sends this in each header (I may have not capitalized the text correctly - I was working from hand-written notes):

Code: [Select]
Connection: close
Content-Type: application/octet-stream
Content-Length: 38
Cache-Control: private
Date: Thu, 01 May 2014 00:45:15 GMT
X-Powered-By: ASP.NET
X-Aspnet-Version: 2.0.50727
HTTP_FLAGS: 14:01
Server: Microsoft-IIS/8.0

What IIS Sends:

Code: [Select]
Cache-Control: private
Content-Length: 38
Contenty-Type: application/octet-stream
Server: Microsoft-IIS/8.0
X-Aspnet-Version: 2.0.50727
HTTP_FLAGS: 14:01
X-Powered-By: ASP.NET
Date: Thu, 01 May 2014 00:45:15 GMT
Connection: close

Can somebody check if an out-of-order header causes the GW to ignore the 38 byte packet?

I have not had enough time to set up my Apache server (Windows) to enable PUTs and run funny-named PHP files.  It is a working, public server, so I can't make big changes on it without knocking my users off the air.

Offline keckec

  • Senior Member
  • **
  • Posts: 62
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #282 on: May 01, 2014, 10:32:37 AM »
For the record, SkySpy sends this in each header (I may have not capitalized the text correctly - I was working from hand-written notes):
Code: [Select]
Connection: close
Content-Type: application/octet-stream
Content-Length: 38
Cache-Control: private
Date: Thu, 01 May 2014 00:45:15 GMT
X-Powered-By: ASP.NET
X-Aspnet-Version: 2.0.50727
HTTP_FLAGS: 14:01
Server: Microsoft-IIS/8.0

What IIS Sends:

Code: [Select]
Cache-Control: private
Content-Length: 38
Contenty-Type: application/octet-stream
Server: Microsoft-IIS/8.0
X-Aspnet-Version: 2.0.50727
HTTP_FLAGS: 14:01
X-Powered-By: ASP.NET
Date: Thu, 01 May 2014 00:45:15 GMT
Connection: close
Can somebody check if an out-of-order header causes the GW to ignore the 38 byte packet?
Here are the headers, in order, that my php code is sending out:
Code: [Select]
Date: Thu, 01 May 2014 14:05:12 GMT
Server: Apache/2.2.22.(Ubuntu)
X-Powered-By: ASP.NET
HTTP_FLAGS: 14:01
X-ApsNet-Version: 2.0.50727
Cache-Control: private
Content-Length: 38
Connection: close
Content-Type: application/octet-stream..
This is setting the clock, but obviously something is wrong since it keeps sending the 210-byte packets out. I tried changing the php code to make the headers just like IIS, but failed miserably. From what I read, PHP doesn't have full control of headers either. Apache puts in its own before sending the packet out, and it removes any conflicting ones from PHP.


Offline skydvrz

  • Senior Contributor
  • ****
  • Posts: 224
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #283 on: May 01, 2014, 12:31:58 PM »
There are two people trying to use a private MySQL database that are filling up my bug reporting system with error reports.

Their names are "Scott" and "Joea".

Please run the MySQL utility script found earlier in this thread.  You will not be able to successfully run SkySpy until you do. 

Either that, or run SkySpy in embedded mode.

Offline skydvrz

  • Senior Contributor
  • ****
  • Posts: 224
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #284 on: May 02, 2014, 12:52:43 PM »
This is setting the clock, but obviously something is wrong since it keeps sending the 210-byte packets out.

Are you ACKing the 210 byte packet?  If you never reply, then the GW may keep trying.

Offline skydvrz

  • Senior Contributor
  • ****
  • Posts: 224
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #285 on: May 03, 2014, 06:59:06 PM »
Ok, I figured out what the problem was with my 38 byte packet generator.  The HTML/TCP/IP library I am using was encoding the bytes as UTF-8 instead of raw binary.  This tweaked exactly one byte - right in the middle of my serial number.  Not only did this invalidate my serial number, but it also affected the checksum since the byte was tweaked after it was calculated.  I only caught it by running Wireshark and snooping my own packets.

I started using streams instead of a string for a buffer for the 38 byte payload and things started to work - this bypasses the encoder.  I got a beep, the display contrast changed, the clock reset, and the Internet indicator turned on.  Yaaay!   =D>

Unfortunately, this triggered a storm of 210 byte packets.  Boooo!  #-o

Sound familiar?  Read on for some good news:

I was able to stop the GW from jabbering by connecting to the LCX server - it would jabber long SDP packets for anywhere from 10-50 times and then mysteriously quit after the usual handshakes and LCX sending a 38 byte Real Time Clock (RTC) packet.

After analyzing what was going on, I found that the Epoch word in the RTC packet is the key.  It must match what the GW expects or it goes into jabber mode.  You can't set it to a constant value, unless you also trash your "serial number" - but then the Internet indicator goes off and clock updates cease.  Don't forget that the Epoch word changes every two hours.  The current version of SkySpy uses a bad SN (and my personal Epoch number), so you don't get jabbering.

Once I set the Epoch correctly, everything started to work!!!!  \:D/  No more jabbering!

Unfortunately, everyone's Epoch value is different.  I think it depends on the date and time that you register the GW.  You can figure it out by looking at what LCX sends you in the 38 byte packet - note the current local time/date and current Epoch value.  Then you can use this algorithm to simulate it in your own 38 byte RTC packet:

Code: [Select]
    SeedDate         := EncodeDate(2014, 5, 3) + EncodeTime(15, 10, 00, 0);
    StartingEpoch    := $7da8; // my epoch value on 3 May 2014 at 15:10:00 local time

    ElapsedTime   := (Now() - SeedDate);  // calc integer days plus fraction of 24 hours
    ElapsedEpochs := TRUNC(ElapsedTime / (2.0 / 24.0)); // Epoch updates every 2 hours
    RawEpoch      := ElapsedEpochs * $12;  // Epoch increases by 0x12 each period
    RawEpoch      := RawEpoch + StartingEpoch; // calc new Epoch
    RawEpoch      := RawEpoch MOD $7FFF; // Epoch rolls over at $7FFF so use modulus

    R.Epoch := SwapWordBytes(RawEpoch); // Make it big-endian and write it to offset 0x16..0x17 in the RTC payload

I know you PHP guys have figured out a way to simulate a registration.  Does this initialize the Epoch to zero, or does it retain the original value?

If it set the Epoch to zero, then we are in Fat City - because everyone can use the same StartingEpoch.  If not, then something else will have to be done.  I would like to remove all dependency on the LCX cloud server.



Offline skydvrz

  • Senior Contributor
  • ****
  • Posts: 224
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #286 on: May 04, 2014, 01:27:53 PM »
It turns out that the GW squawks its own Epoch value in the 30 byte 01:01 packet at offset 0x1A. Maybe it does not need to be calculated after all.
« Last Edit: May 04, 2014, 01:46:10 PM by skydvrz »

Offline Scott_A

  • Member
  • *
  • Posts: 7
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #287 on: May 04, 2014, 05:00:33 PM »
I have begun working on a web based presentation layer. I won't be able to spend much time on it this week so I thought I would give you a sneak peak, and perhaps some of you could improve on it.  :grin:

You will need your data in the MySQL database with the schema from skydvrz and you will also need a php webserver.
Extract the files to the root of the web server or virtual directory. Edit data.php and insert appropriate MySQL credentials. Browse to the page.

Download the code here:
https://www.dropbox.com/s/0xrf1vgn76s5bf9/Weather.zip

Some of my earlier data isn't very pretty as I was jumping my gateway between skydvrz windows service and the php gateway code. (The windows service is currently capturing the data.)

Note: The chart library is licensed free for non commercial use.
« Last Edit: May 10, 2014, 03:45:15 PM by Scott_A »

Offline keckec

  • Senior Member
  • **
  • Posts: 62
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #288 on: May 05, 2014, 12:45:13 AM »
Ok, I figured out what the problem was with my 38 byte packet generator.  The HTML/TCP/IP library I am using was encoding the bytes as UTF-8 instead of raw binary.  This tweaked exactly one byte - right in the middle of my serial number.  Not only did this invalidate my serial number, but it also affected the checksum since the byte was tweaked after it was calculated.  I only caught it by running Wireshark and snooping my own packets.

I started using streams instead of a string for a buffer for the 38 byte payload and things started to work - this bypasses the encoder.  I got a beep, the display contrast changed, the clock reset, and the Internet indicator turned on.  Yaaay!   =D>

Unfortunately, this triggered a storm of 210 byte packets.  Boooo!  #-o
Contratulations!!!!  And welcome to the club  :-|

Quote
The current version of SkySpy uses a bad SN (and my personal Epoch number), so you don't get jabbering.
I found that giving it an incorrect checksum would do the same thing.
Quote
Code: [Select]
    RawEpoch      := RawEpoch MOD $7FFF; // Epoch rolls over at $7FFF so use modulus
Should that be RawEpoch MOD $8000
Quote
I know you PHP guys have figured out a way to simulate a registration.  Does this initialize the Epoch to zero, or does it retain the original value?
I haven't actually done this. I think to do this the GW must be reset and maybe the console too.
I found instructions to do the GW at
http://weatherdirect.com/help/gatewayhelp4.aspx
and for the console on page 3 of the manual.
Quote
If it set the Epoch to zero, then we are in Fat City - because everyone can use the same StartingEpoch.  If not, then something else will have to be done.  I would like to remove all dependency on the LCX cloud server.
I'm not sure about the 2-hour period for incrementing the epoch. Looking at the 38-byte packets in my capture from LCX cloud, it seems to match for a time, then something changes and the next group of packets match a slightly different StartingEpoch. It seems like the time might be something slightly different than 2 hours. I only have about 60 captured 38-byte packets from LCX, so it's hard to tell.

My capture spans across the change to daylight savings time. The epoch didn't change across that boundary, so probably the Now() and SeedDate used to find the ElapsedTime should be in GMT.

Also, I think the 01:01 30-byte packets are the tail end of the history data sent out in the 210-byte 01:01 packets. Data seems to be sent out in 210-byte packets as long as there is enough data to fill 210 bytes, then a short packet at the end to finish up. I've seen various length packets for this. Any 01:01 packet that starts with 0x21 0x64 is one of these. The "epoch" in these doesn't look like the same epoch in the 38-byte RTC packets. In the 0x21 0x64 packets, one epoch is sent in bytes 6 and 7, and a different one in the two bytes right before the 2-byte crc at the end, regardless of the overall packet length. These epochs are relative to the date/time of the data in the packet, not the current time. And, these epochs seem to increment by 0x12 every 15 minutes. Also, the data records in these packets are mostly 18 (0x12) bytes long. Maybe more than coincidence that that's the amount the epoch increments. I am beginning to think these are not strictly time-related, but maybe a database index, or ???

Offline keckec

  • Senior Member
  • **
  • Posts: 62
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #289 on: May 05, 2014, 11:28:08 AM »
I have begun working on a web based presentation layer. I won't be able to spend much time on it this week so I thought I would give you a sneak peak, and perhaps some of you could improve on it.  :grin:

Very cool, Scott_A  =D>
I haven't installed Skydvr's schema yet but I'll try it and your code out on my system.

Have you tried Skydvr's epoch calculations to stop the GW from sending lots of 210-byte data? So far I it hasn't worked for me.

Offline mycal

  • Member
  • *
  • Posts: 24
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #290 on: May 05, 2014, 01:32:10 PM »

Hi guys, been out of pocket for a while,  Good work continuing it looks like.  I looked at keckec's new reqeust.breq great that it keeps evolving.

I've never had any problem with the internet indicator, mine has been solid for the last month on my PHP code,  I don't think I do anything on the epoch.   I do see the 210 byte packets on occasion, but no storm.  I'll have too look at the new data to see what I set the epoch on registration too.  I have not found a way to reset the weather station SN after it has been set FYI.  I have reset the weather station and the gateway and registered them both but I had to use the original weather station SN (which I set to all zeros) to re-register it.

I did also figure out the frequency setting to control how often the gateway pings the service, but I have to dig out those notes.

Anyway I will try to get some time to play with some of this new information this week.


-M



Offline mycal

  • Member
  • *
  • Posts: 24
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #291 on: May 05, 2014, 02:57:56 PM »

I tried MyCal's method in SkySpy and noticed the same thing.  This needs more research. 

He also says he could adjust his LCD clock, but I have not been able to duplicate that result.  I'd like to see some code that uses dynamic values instead of hard-coded constants like MyCal's example.

Shoot me some PHP code if you make any progress.  I speak PHP.

I will have to check my PHP code on dropbox against my server, since it is all dynamic on the server and has been keeping time for over a month perfectly.

-M



Offline keckec

  • Senior Member
  • **
  • Posts: 62
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #292 on: May 05, 2014, 03:13:08 PM »
Hi MyCal, great to see you back.

Has anyone looked at the 18-byte 70:00 packets sent from LCX in response to the 00:70 packets from the GW? I see several kinds of data in them, which looks like possibly a bit mask. Maybe a way to remotely reset stuff on the GW or console?

Offline mycal

  • Member
  • *
  • Posts: 24
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #293 on: May 05, 2014, 04:04:25 PM »
Hi MyCal, great to see you back.

Has anyone looked at the 18-byte 70:00 packets sent from LCX in response to the 00:70 packets from the GW? I see several kinds of data in them, which looks like possibly a bit mask. Maybe a way to remotely reset stuff on the GW or console?

Yes I captured these packets while talking to lacross alerts and changing the interval time on their website and I have the data,  I need to get those packets decoded and posted.  It was not what I expected, but I think I made sense of it.  I need to find my notes on this.

-M

Offline skydvrz

  • Senior Contributor
  • ****
  • Posts: 224
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #294 on: May 07, 2014, 10:57:59 PM »
I am successfully setting the clock, lighting up the Internet indicator and preventing jabbering of large packets.  The trick is to let it jabber (from a bad RTC packet/invalid epoch) and then parse the 210 byte packet.  It contains several copies of the Epoch value.  Grab one and save it to non-volatile storage (I use the DB). Also note the date and time - save that too.  Each time the unit requests a 38 byte RTC packet, then use the DB values to calculate the correct Epoch - remember, it changes every 2 hours.  Send that value and the jabbering stops completely.

If it ever restarts jabbering, the state machine mentioned above will stop it.  Also, this algorithm should work on anyone's unit, no matter where in the Epoch cycle they are.

Code: [Select]
    T210ByteSquawk = PACKED RECORD
        Unknown1:     word;  // 0-1
        Unknown2:     word;  // 2-3
        CurrentEpoch: word;  // 4-5
        Unknown3:     ARRAY[1..204] OF Byte; // dont care
    END;

Code: [Select]
FUNCTION TsssDm.CalcEpoch : word;
VAR
    ElapsedTime :   TDateTime;
    C,
    ElapsedEpochs : Integer;
    StartingEpoch,
    RawEpoch :      word;
    SeedDate :      TDateTime;
    Strg :          STRING;
BEGIN
    Strg     := VarDefault(GlobalSetting['EpochCusp'], '');
    SeedDate := TD24StrToDateTime(Strg);
    Strg     := VarDefault(GlobalSetting['CurrentEpoch'], '$0');
    Val('$' + Strg, StartingEpoch, C);

    ElapsedTime   := (Now() - SeedDate);  // days plus fraction of 24 hours
    ElapsedEpochs := TRUNC(ElapsedTime / (2.0 / 24.0));
    RawEpoch      := ElapsedEpochs * $12;
    RawEpoch      := RawEpoch + StartingEpoch;
    RawEpoch      := RawEpoch MOD $8000;
    Result           := RawEpoch;
END;

Offline keckec

  • Senior Member
  • **
  • Posts: 62
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #295 on: May 08, 2014, 11:03:31 AM »
I am successfully setting the clock, lighting up the Internet indicator and preventing jabbering of large packets.  The trick is to let it jabber (from a bad RTC packet/invalid epoch) and then parse the 210 byte packet.  It contains several copies of the Epoch value.  Grab one and save it to non-volatile storage (I use the DB). Also note the date and time - save that too.  Each time the unit requests a 38 byte RTC packet, then use the DB values to calculate the correct Epoch - remember, it changes every 2 hours.  Send that value and the jabbering stops completely.

If it ever restarts jabbering, the state machine mentioned above will stop it.  Also, this algorithm should work on anyone's unit, no matter where in the Epoch cycle they are.

YOU DID IT!!! Thank you! Thank you! My chatterbox has stopped blabbering!!!  =D>

I suspect the epoch value is actually a memory address. And it seems to wrap to 0x01a6, not zero. I think the 210-byte packets (and many other sizes, which all start with 0x2164) are dumps of history memory. I have about 60MB of this stuff to examine, when I get time. Thanks again, Skydvrz.
« Last Edit: May 08, 2014, 11:07:53 AM by keckec »

Offline keckec

  • Senior Member
  • **
  • Posts: 62
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #296 on: May 08, 2014, 03:54:04 PM »
Skydvrz, what do you have your history interval set to on LCX Alerts, on the Edit Device Page? Is it 2 hours?

I think this sets the time period over which the epoch increments by 0x12. Mine is incrementing every 15 minutes, which is what I have the history interval set to on LCX Alerts page. I'm not sure how LCX sets this in the GW, but the epoch in the 38-byte packets sent by LCX changed by 0x24 in 2 minutes when I changed the history interval from 15 minutes to 30 minutes on the LCX Alerts web site.

Offline skydvrz

  • Senior Contributor
  • ****
  • Posts: 224
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #297 on: May 08, 2014, 04:02:26 PM »
If you are talking about alerts/alarms on the LCD panel, then I think I have them shut off. 

If you are talking about the LCX web site, then I don't know.  That was the major reason I dumped them and started SkySpy - their alerts system is awful.

I will check both when I get home from work.

Offline skydvrz

  • Senior Contributor
  • ****
  • Posts: 224
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #298 on: May 08, 2014, 04:09:05 PM »
I just checked the LCX web site - my "history interval" is 15 Minutes.

Offline keckec

  • Senior Member
  • **
  • Posts: 62
Re: LaCrosse Wireless Internet Gateway Model GW1000U ERF-100
« Reply #299 on: May 08, 2014, 04:11:07 PM »
Hmm. Yes, that's the setting I was thinking of. I don't know why the difference in the epoch update interval. More to learn...

 

anything