Author Topic: Vantage Vue Linksys Router Server  (Read 25334 times)

0 Members and 1 Guest are viewing this topic.

Offline CLGuy1542

  • Member
  • *
  • Posts: 25
Vantage Vue Linksys Router Server
« on: August 20, 2012, 11:01:08 AM »
Hey everyone,

Just got around to purchasing a Vantage Vue station to monitor my summer cabin in Northern Iowa.  I am in the process of getting everything set up and ready to go.  I want to be able to use the online monitoring features of the station, preferably without a computer.  I have done some snooping around the forum and found that a gentleman over in New Zealand has successfully converted his Linksys WRT54G router to upload to weather underground directly from the Vantage Vue.  His website talking about what he did is below.

http://blog.ancient-workshop.com/post/2011/12/10/Weather-Station-Hacking 

I am very technologically savvy and I know my way around computers, routers, and firmware, but I have absolutely no idea what he did.....plus I am a second year medical student and I have no time (or interest!) to learn programming code.

Does anyone on here know how he did this or have any directions as to what needs to be done.  I have the router and I have it loaded with OpenWRT.  I know that I have to do the serial mod to the router which isn't a big deal.  Any directions on the programming would be greatly appreciated.  Also, if anyone has done this conversion and just wants to send me the modified OpenWRT firmware that has everything ready to go directly, that would be awesome!  Thanks for the help!

-Erik

Offline dalecoy

  • Forecaster
  • *****
  • Posts: 6448
    • Lee's Summit, MO
Re: Vantage Vue Linksys Router Server
« Reply #1 on: August 20, 2012, 12:34:35 PM »
Well, he did supply the source code for the weather software:  blog.ancient-workshop.com/public/davisrcv.lua

Some modification required, of course.

And are you comfortable with the hardware modifications (connections) that you will have to do to the VUE console and the router?

Offline CLGuy1542

  • Member
  • *
  • Posts: 25
Re: Vantage Vue Linksys Router Server
« Reply #2 on: August 20, 2012, 12:38:02 PM »
Yes connecting the console to the router is not a big deal to do as well.  There really isn't much to it. 

I am aware that he posted the Lua script, but there is also other the other "code" that he posted:


> stty -F /dev/ttyS1 -a
speed 19200 baud;stty: /dev/ttyS1
 line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z;
rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke


I have no idea what this is for and if I need to actually use it.  Am I just supposed to use the Lua file he has posted?  If so, how do I go about putting it in the router?  I think I know how to activate it through the startup menu in the router firmware.

Offline dalecoy

  • Forecaster
  • *****
  • Posts: 6448
    • Lee's Summit, MO
Re: Vantage Vue Linksys Router Server
« Reply #3 on: August 20, 2012, 12:46:34 PM »
Well, first you have to modify the code, to put in your own personal Weather Underground information (and password, etc.).

I think you need to recruit a Computer Science student to help you with this project.  I doubt that it will be practical to get simple, understandable assistance in this forum (perhaps, of course, there are other forums).

Offline CLGuy1542

  • Member
  • *
  • Posts: 25
Re: Vantage Vue Linksys Router Server
« Reply #4 on: August 20, 2012, 01:10:56 PM »
Which is why I was hoping someone else on this forum had done this before and would have the completed firmware. 

Offline dalecoy

  • Forecaster
  • *****
  • Posts: 6448
    • Lee's Summit, MO
Re: Vantage Vue Linksys Router Server
« Reply #5 on: August 20, 2012, 01:32:16 PM »
Which is why I was hoping someone else on this forum had done this before and would have the completed firmware. 

Nobody will have the "completed firmware" that contains your personal Weather Underground information.

Offline CLGuy1542

  • Member
  • *
  • Posts: 25
Re: Vantage Vue Linksys Router Server
« Reply #6 on: August 20, 2012, 01:41:37 PM »
I am aware of that.  But it is much easier to search for and change the log in data in the completed firmware than to compile the firmware yourself...

Offline dalecoy

  • Forecaster
  • *****
  • Posts: 6448
    • Lee's Summit, MO
Re: Vantage Vue Linksys Router Server
« Reply #7 on: August 20, 2012, 02:04:42 PM »
I am aware of that.  But it is much easier to search for and change the log in data in the completed firmware than to compile the firmware yourself...

That's true.  How do you handle the checksum?

Offline DeKay

  • Forecaster
  • *****
  • Posts: 399
    • Mad Scientist Labs
Re: Vantage Vue Linksys Router Server
« Reply #8 on: August 20, 2012, 02:36:07 PM »
I am very technologically savvy and I know my way around computers, routers, and firmware, but I have absolutely no idea what he did.....plus I am a second year medical student and I have no time (or interest!) to learn programming code.

Does anyone on here know how he did this or have any directions as to what needs to be done.  I have the router and I have it loaded with OpenWRT.  I know that I have to do the serial mod to the router which isn't a big deal.  Any directions on the programming would be greatly appreciated.  Also, if anyone has done this conversion and just wants to send me the modified OpenWRT firmware that has everything ready to go directly, that would be awesome!  Thanks for the help!

Why are you doing the serial mod?  The levels on the WRT-54G are LVTTL and you should be able to connect directly to the console with three wires.  The console isn't exactly 3.3V (I measured 2.9V recently) but I think you'd still be OK.  Check the Atmel datasheet to be sure.  I am not liable if you blow up your console, blah blah blah.

> stty -F /dev/ttyS1 -a
speed 19200 baud;stty: /dev/ttyS1
 line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z;
rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke


I have no idea what this is for and if I need to actually use it.  Am I just supposed to use the Lua file he has posted?  If so, how do I go about putting it in the router?  I think I know how to activate it through the startup menu in the router firmware.

man stty

The command he shows prints all (-a) the parameters for the second serial port.  He said to configure it to work with the console.  He didn't say what he specifically had to send that was different from the default.  However, I'm pretty sure that this is equivalent to the

stty -F /dev/ttyS1 0:0:cbe:0:3:1c:7f:15:1:0:0:0:11:13:1a:0:12:f:17:16:4:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0

near the bottom of the post.

Note that he mentioned he had to recompile the firmware to build stty so it sounds like that command is not standard in OpenWRT's busybox.  You should be able to get it from optware or use Tomato instead.

Files can be moved to and from the router using scp as described here.

And if you have any questions on what he did, why not email him?  I did once and he got back to me pretty quickly.

That's true.  How do you handle the checksum?

The Lua script does this.

Offline dalecoy

  • Forecaster
  • *****
  • Posts: 6448
    • Lee's Summit, MO
Re: Vantage Vue Linksys Router Server
« Reply #9 on: August 20, 2012, 08:15:33 PM »
I am aware of that.  But it is much easier to search for and change the log in data in the completed firmware than to compile the firmware yourself...

That's true.  How do you handle the checksum?

The Lua script does this.

I'm certainly a novice in this area, so please clarify.  I understood that the Lua script was code that handles the console communications (and therefore the checksum in the console packet).  But morter01 wants to edit the completed firmware.  Doesn't that firmware have a checksum that needs to be re-computed after the content is edited?

Offline DeKay

  • Forecaster
  • *****
  • Posts: 399
    • Mad Scientist Labs
Re: Vantage Vue Linksys Router Server
« Reply #10 on: August 21, 2012, 10:32:03 AM »
I'm certainly a novice in this area, so please clarify.  I understood that the Lua script was code that handles the console communications (and therefore the checksum in the console packet).  But morter01 wants to edit the completed firmware.  Doesn't that firmware have a checksum that needs to be re-computed after the content is edited?

Here is the code.  Lua is an interpreted language like Python so the code, in and of itself, is not executable.  It is the Lua interpreter that runs the code (think back to BASIC).  There is no checksum.  There is no associated firmware.  Change the script (a plain text file), run it it with "lua /root/davisrcv.lua &" (the ampersand is a Unix / Linux thing that runs the script in the background), and that is it.

Even if the file were a compiled binary, there would be no associated checksum to worry about.  It doesn't work that way.

If morter01 wants to mod his router, I'd suggest the SD Card mod.  That lets you attach extra flash to the router to have more room for these and other programs, such as a text editor like vim to edit the script directly on the router.

Offline Beaudog

  • Forecaster
  • *****
  • Posts: 1217
Re: Vantage Vue Linksys Router Server
« Reply #11 on: August 21, 2012, 10:36:25 AM »
I guess I don't understand the problem. Why not just use the Weather Link IP logger and then a standard unmodified router. No computer needed and a whole lot easier to setup.

Offline dalecoy

  • Forecaster
  • *****
  • Posts: 6448
    • Lee's Summit, MO
Re: Vantage Vue Linksys Router Server
« Reply #12 on: August 21, 2012, 10:52:49 AM »
  Lua is an interpreted language like Python so the code, in and of itself, is not executable.  It is the Lua interpreter that runs the code (think back to BASIC).  There is no checksum.  There is no associated firmware.  Change the script (a plain text file), run it it with "lua /root/davisrcv.lua &" (the ampersand is a Unix / Linux thing that runs the script in the background), and that is it.

Ah!  Thanks for the clarification.

Offline CLGuy1542

  • Member
  • *
  • Posts: 25
Re: Vantage Vue Linksys Router Server
« Reply #13 on: August 21, 2012, 11:19:15 AM »
The reason why I don't want to use weatherlink IP is because it costs $250.00...unless someone on here has one they are trying to get rid of for cheap.

I can modify the router and hook it up to the Vantage Vue for free....

Offline DeKay

  • Forecaster
  • *****
  • Posts: 399
    • Mad Scientist Labs
Re: Vantage Vue Linksys Router Server
« Reply #14 on: August 21, 2012, 08:36:51 PM »
Why not just use the Weather Link IP logger...

Because that wouldn't be nearly as cool.   8-)

Offline DeKay

  • Forecaster
  • *****
  • Posts: 399
    • Mad Scientist Labs
Re: Vantage Vue Linksys Router Server
« Reply #15 on: August 21, 2012, 09:55:34 PM »
The command he shows prints all (-a) the parameters for the second serial port.  He said to configure it to work with the console.  He didn't say what he specifically had to send that was different from the default.  However, I'm pretty sure that this is equivalent to the

stty -F /dev/ttyS1 0:0:cbe:0:3:1c:7f:15:1:0:0:0:11:13:1a:0:12:f:17:16:4:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0

near the bottom of the post.

I confirmed my suspicion.  He would have set up the serial port as he needed to and then would have used the "-g" option to stty to generate the magic string of gibberish seen above.  That configures the port as required when the router boots.

Offline CLGuy1542

  • Member
  • *
  • Posts: 25
Re: Vantage Vue Linksys Router Server
« Reply #16 on: August 22, 2012, 09:36:36 AM »
Dekay,

So it seems like you know what you are doing when dealing with this area.  So, I know this is hard to explain, but could you give us some rough "directions" on what needs to actually be implemented into the router and how to do it?  I know there are a lot of people out there who are wanting to do this modification.  You would be a life saver!!!!


Offline DeKay

  • Forecaster
  • *****
  • Posts: 399
    • Mad Scientist Labs
Re: Vantage Vue Linksys Router Server
« Reply #17 on: August 22, 2012, 08:40:02 PM »
morter01

I am having trouble reconciling this statement...

I am very technologically savvy and I know my way around computers, routers, and firmware

with this one...

Dekay,

So it seems like you know what you are doing when dealing with this area.  So, I know this is hard to explain, but could you give us some rough "directions" on what needs to actually be implemented into the router and how to do it?  I know there are a lot of people out there who are wanting to do this modification.  You would be a life saver!!!!

Let me ask you: what specifically do you not understand between his blog and mine?  Have you gone to the effort to carefully read what he did and take it from there?  IMHO, between what he and I have posted, you already have far more than "rough directions" as to what to do.

Then there is this bit...

plus I am a second year medical student and I have no time (or interest!) to learn programming code.

The blog you referenced has this statement regarding the code: "If you use it, you'll have to edit the script to add your own station id and password."  That is it.  There is no "code" to do besides editing two obvious strings in a text file.

I think it is very reasonable for me to ask YOU to put in some time to work through this project before you ask ME to put in a bunch of time going over and above the detailed information already available (some of which might already be obvious to you already).

So how about this: put in the time to try to get something working.  When you get stuck, I'll try my best to help.  At the end of the day, this thread will be a guide to "a lot of people out there who are wanting to do this modification".  We'll both be helping them out, all two or three of them.

Deal or no deal?

Offline CLGuy1542

  • Member
  • *
  • Posts: 25
Re: Vantage Vue Linksys Router Server
« Reply #18 on: August 22, 2012, 09:14:20 PM »
I'm sorry if I offended you as I had no intention of doing so.

So you're telling me that all I need to do is:

1) enable stty on my router and implement the script

stty -F /dev/ttyS1 0:0:cbe:0:3:1c:7f:15:1:0:0:0:11:13:1a:0:12:f:17:16:4:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0


2) Add this script to the cron tab

*/5 * * * * /root/davissnd.sh > /dev/null


3) And add this script to the  /etc/rc.local:

stty -F /dev/ttyS1 0:0:cbe:0:3:1c:7f:15:1:0:0:0:11:13:1a:0:12:f:17:16:4:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
lua /root/davisrcv.lua &


4) And upload the premade and edited lua file to my router

Is that it?  Or did I mix something up?

Offline dalecoy

  • Forecaster
  • *****
  • Posts: 6448
    • Lee's Summit, MO
Re: Vantage Vue Linksys Router Server
« Reply #19 on: August 22, 2012, 09:54:47 PM »
Of course there is just a bit of hardware work, too.

I believe that DeKay is essentially saying "Do something, and then ask for help if it doesn't work".

Offline CLGuy1542

  • Member
  • *
  • Posts: 25
Re: Vantage Vue Linksys Router Server
« Reply #20 on: August 22, 2012, 09:56:43 PM »
Well the only hardware work is a little soldering on the router and pinning out the Vantage Vue Console through DeKay's blog....i believe

Offline dalecoy

  • Forecaster
  • *****
  • Posts: 6448
    • Lee's Summit, MO
Re: Vantage Vue Linksys Router Server
« Reply #21 on: August 22, 2012, 10:50:08 PM »
Well the only hardware work is a little soldering on the router and pinning out the Vantage Vue Console through DeKay's blog....i believe

Yes, that's correct. 

I believe that DeKay is essentially saying "Do something, and then ask for help if it doesn't work".

Offline DeKay

  • Forecaster
  • *****
  • Posts: 399
    • Mad Scientist Labs
Re: Vantage Vue Linksys Router Server
« Reply #22 on: August 22, 2012, 11:43:34 PM »
I believe that DeKay is essentially saying "Do something, and then ask for help if it doesn't work".

Exactly.

I'm sorry if I offended you as I had no intention of doing so.

So you're telling me that all I need to do is:

Actually, if you read what I said, I didn't tell you to do any of this.  I just asked you to try to figure it out for yourself and you went and did exactly this.  That makes all the difference.   Gold star.

1) enable stty on my router and implement the script

stty -F /dev/ttyS1 0:0:cbe:0:3:1c:7f:15:1:0:0:0:11:13:1a:0:12:f:17:16:4:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0

First off: stty is a command like "dir" that might or might not be built into openwrt by default.  It wasn't for him when he did it, but maybe it is incorporated by default now.  I don't know.  If it is (try "stty -F /dev/ttyS1 -a" from the router command line).  If that works, you are well on your way.  If not, you either have to recompile the firmware to enable it (not for the faint of heart), use a different firmware that does have it built-in (look into dd-wrt or tomato by shibby), or stick with openwrt and do the sdcard mod and add it in using optware.  This is left as an exercise for the reader, but is a fun hack and well documented on the net.

Second off: this gets done in 3) below so you don't have to do this from the command line because it will be forgotten when the router reboots anyway.  But it doesn't hurt to do as a check.  Run that command, do a "stty -F /dev/ttyS1 -a" and confirm that port 1 is configured as he shows in his blog.

2) Add this script to the cron tab

*/5 * * * * /root/davissnd.sh > /dev/null

It is more accurate to say that /etc/crontab is a text file, and you are adding this line to the file.  See here.

3) And add this script to the  /etc/rc.local:

stty -F /dev/ttyS1 0:0:cbe:0:3:1c:7f:15:1:0:0:0:11:13:1a:0:12:f:17:16:4:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
lua /root/davisrcv.lua &

Again, /etc/rc.local is a text file, and you are adding the two lines above into the file.  Getting the idea?  Linux uses plain text files to configure tons of stuff.

4) And upload the premade and edited lua file to my router

Is that it?  Or did I mix something up?


That is basically it.  But you'll hit ten different roadblocks on the way when you actually try to do it for real, and you'll learn ten different things as you work to solve each of them first before asking for help.

And here is a bonus bit of info since you did your homework.  On my V3 WRT54G, serial port 1 is on pins 3 and 5.  You'll also need to hook into ground on either pin 9 or 10.  You should check your router version since Linksys might (or might not) have changed the pinouts on various versions.  The dd-wrt wiki is really good for capturing the different hardware versions.

Edit: Corrected pins for router serial port 1.

Offline CLGuy1542

  • Member
  • *
  • Posts: 25
Re: Vantage Vue Linksys Router Server
« Reply #23 on: August 23, 2012, 03:49:53 PM »
Ok so you were right.... I have good news and bad news....  I found that it was very easy to install stty in Openwrt through their GUI.  Openwrt had segmented out their coreutils package so that you could pick and choose what you wanted.

I used ssh to get into the router through the program Putty.  I got all logged in and set the root password and everything.  When i type in stty, i get a response telling me what the baud is, etc.  Infact, I was even able to change the baud rate to 19200.  However, when I type in stty -F /dev/ttyS1 -a I get the response of "no such file or folder found"  I should also add that I currently don't have the Vantage Vue hooked up to my router yet.  I don't know if that would make a difference....

When i explore around a little more and try to access "/dev/" i get a permission denied response.  When i try to access "/dev/ttyS1 -a" or anything with ttyS1, 0, or * i get the error no such file or folder found.  

Any ideas of whats going on?  Do I need to have serial drivers installed or something?  I don't know why I wouldn't have the folder available.  I cant even access "/dev/ " to see what is in there.  Any ideas?
« Last Edit: August 23, 2012, 03:56:13 PM by morter01 »

Offline CLGuy1542

  • Member
  • *
  • Posts: 25
Re: Vantage Vue Linksys Router Server
« Reply #24 on: August 23, 2012, 06:03:31 PM »
Correction.  I believe I have figured it out.  Apparently my router likes its serial ports to be called tts/1 or tts/0.....not ttyS01 or ttyS00.  Strange but I think i got it converted. 

Now I just need to connect up the console.  Just to clarify with the wiring....

the receiving line of the router goes into the transmitting line of the console and vice versa correct?

 

anything