Changing Weather

I installed Apache on the weewx RPi and set it to port 800
This is the port I’m using to collect data from (daily.json)
Maybe doing this would ease the webcore pain
(And I use ‘nano’ too :slight_smile:)

This is the output from my webserver:

{
"title":"Current Values",
"location":"South Hetton",
"time":"24/05/18 20:30:00",
"lat":"54° 47.88' N",
"lon":"001° 24.41' W",
"alt":"100 meters",
"hardware":"observer",
"uptime":"0 days, 8 hours, 1 minute",
"serverUptime":"0 days, 8 hours, 1 minute",
"weewxVersion":"3.8.0",
"stats": {
"current": {
"outTemp":"9.1°C",
"windchill":"9.1°C",
"heatIndex":"9.1°C",
"dewpoint":"8.4°C",
"humidity":"95%",
"insideHumidity":"53%",
"barometer":"1008.5 mbar",
"barometerTrendDelta":"3 hours",
"barometerTrendData":"-0.3 mbar",
"windSpeed":"0.3 m/s",
"windDir":"305°",
"windDirText":"NW",
"windGust":"1.1 m/s",
"windGustDir":" N/A",
"rainRate":"0.0 mm/hr",
"UV":"0.0",
"ET":"0.0 mm",
"solarRadiation":"0 W/m²",
"insideTemp":"19.0°C"
},
},
"almanac":{
"sun":{
"startCivilTwilight":"02:53:05",
"sunrise":"03:44:36",
"transit":"12:02:27",
"sunset":"20:21:19",
"endCivilTwilight":"21:13:14",
"azimuth":"311.6°",
"altitude":"-1.0°",
"rightAscension":"61.6°",
"declination":"20.9°",
"equinox":"23/09/18 01:54:09",
"solstice":"21/06/18 10:07:23"
},
"moon":{
"rise":"14:06:15",
"transit":"20:30:47",
"set":"02:21:15",
"azimuth":"179.8°",
"altitude":"35.5°",
"rightAscension":"188.7°",
"declination":"0.2°",
"fullMoon":"29/05/18 14:19:32",
"newMoon":"13/06/18 19:43:13",
"phase":"First quarter",
"fullness":"78%"
}
}
}

Driver taster...

Still ironing out the kinks and collecting all the data

1 Like

Curious...how did you set apache and/or weewx to port 800?

thanks

Weewx dumps its files into a folder..

I configured apache to use the same folder as it’s root then changed the port it listens on
The port is configured in a config file in the apache folder

Andy

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