Changing Weather

https://httpd.apache.org/docs/2.4/vhosts/examples.html

take a look at running different sites on different ports :slight_smile:

1 Like

Just the info I needed! After a little bit of trial and error, I now have this:

in folder: /etc/apache2/sites-available/000-default.conf

Listen 80
Listen 800

<VirtualHost *:80>
     ServerAdmin webmaster@localhost
     DocumentRoot /var/www/webcore/
</VirtualHost>

<VirtualHost *:800>
     DocumentRoot /var/www/html/weewx/
</VirtualHost>

Now I can add different ports as they may come up.

Thanks

1 Like

The driver is coming along...

I've made the 'Unit' display switchable..
You can also select how many decimal places to use..

Still working on some of the attributes and currently, it only works if you installed weewx with โ€œimperialโ€ settings
I hope to be able to detect the metric settings and configure for them too
Iโ€™ll sort that out when Iโ€™m done getting all the data parsed

Andy

2 Likes

Apache has too many options. Which is great, but...

Apache will serve up dozens if not thousands of websites from a single instance. You follow the same basic method. Use a unique directory for each "site" and point to it in the config. You can then tell Apache at least three different ways to access that site. You can, as you're doing now, use the port # to distinguish one site from another. IP address is another way. You can add secondary addresses to your network config and then use port 80 on each individual IP address. Third, you can use hostnames, where you have one IP and one port but the distinguishing item is the hostname.

Imagine that the internal name of your home network is "example.com" You can have a DNS entry for WebCoRE.example.com and another DNS entry for WeeWX.example.com and they both point to the same IP.

Apache's config adds: "ServerName webcore.example.com" to your first VirtualHost block and "ServerName weewx.example.com" to your second (while also resetting to port 80)

I do not think you need to do this, but sometimes we see other's configs and wonder what is THAT? Do I need THAT in my config?

2 Likes

I got it running, but I had to remember to put sudo in front of the command line while I was testing it. Otherwise, you won't have permission to open up the listening ports.

Now I'm trying to remember how to install Bind on my Mac so I can trick my IP Observer into thinking my Mac is WU.

I spent the $19.99 at the Apple store for OSX Server App.

After that it was just the tedious part of building out the domain records.

yeah...I'm an apple developer so I got it for free. The drag is that it seems Apple is deprecating all it's server services so things seem to be going downhill (lol).

Is the ObserverIP looking for "www.wunderground.com" or some variation of that name.

So at this point, I have weewx and DNS working. The json tmpl is created. What am I missing (other than Andy's driver)? Do I need to setup a web server?

I'm surprised Apple can stand.. they shoot themselves in the foot so many times a year. And I'm an all Apple house. Going back to the Quadra 800 days.

Yeah. I've slowly started migrating away from Apple. I ended up putting echo dots in each room because the streaming was superior. I'm thinking that once the mini dies, I may go back to intel and load BSD on it. I've started using a Surface Pro with WIN10 at work and I'm totally shocked that I don't hate it. The handwriting recognition is so much better than Apple and I was a proud Newton owner. I think they are just headed down the software development and tablet/phone markets. Although truth be told, I miss my NeXT.

Back to the thread: I've found @JHoke writeup on the json and I'm creating that now.

Is it me or is this a LOT of work to get data from our PWS? There has to be an easier and more customer friendly way to get your PWS data into Hubitat.

I think, if you donโ€™t have the settings available in the observer, then you can telnet into the observer to change the destination
Iโ€™ll see if I can find where I saw the details

You could also do a redirection on your local dns server (if you have one)

Andy

On the Pi, I installed apache2 and set it to port 800 to deliver the json file

Andy

Have a look here...

Iโ€™m giving up on my Mac for this. Going to order an RPi 3. The weewx community in general will be able to provide more assistance if I run into trouble.

If you get a Pi then Iโ€™ll put up a working image you can boot from
Hoping to release the image and initial driver sometime tomorrow

Andy

1 Like

Wonderful! Thank Andy.

1 Like

Please let me know when you put up the working image. I can't believe how difficult Apple can make something that should be so easy!

1 Like

Ok. I finally got it working!!!!!! And yes Andy, I promise to test the PI image as soon as I get my USB keyboard.

Here were the gotchas for the Mac mini:

1). sudo pip install pysqlite needs the --user option. This is due to Apple's relentless distrust of it's users. There are certain directories where there is NO way to create any files or directories even if you are root. This really screwed me up as I couldn't get the sqlite database working correctly until I used this option.

2). I loaded the "Server" package from Apple so I could adjust the DNS and create a web server easily. Well......the DNS was fine. I turned on the web service and then completely forgot about it. Since it was listening on port 80 (actually there were 8 httpd processes), the weewx driver couldn't load as it wants to listen on port 80. So after finally turning off the web services in the server application AND rebooting, weewx loads just fine.

3). Changing the DNS entry in the ObserverIP (bridge) isn't enough. It also has to be rebooted.

So, if I figure I spent about 8-10 hours tripping over myself. That said, I am also the lug nut who forgot to order a usb keyboard to go with his Pi 3 so I suppose there is something to be said for Apple protecting itself.

Now I will take a break and put the straps on the water heater I've been putting off for a bit. Next up is trying to get apache working so that it won't crash into the weewx driver.

The mantra that got me through this was, "it's f#^king unix. It can't be this hard"

1 Like

Basic, beta weather driver available for weewx server to test if anyone is interested.

Send me a PM as I'm not fully releasing it until I think it's really ready (still needs a bit of a code cleanup and some additions.)
Currently no forecasting but that will come

Andy

You can add a secondary IP to your Mac and have a port 80 on each. Probably the simplest way to be certain not to step on.

System Preferences: Network: + : Interface: <pick, probably ethernet?> then fill it out.

Server: Websites: + : Fill it in, make sure no other existing is using "any". They all have to be explicit.

Now that is brilliant!! I'll give that a go after I reformat my Mac. I think it needs a good cleaning anyway and now that I've banged and bungled up the install, I should be able to put it back together pretty quickly.

For now I just ran "sudo python -m SimpleHTTPServer 800" in a terminal window from the public_html directory. It's a pretty down and dirty to get a quick web server up.