Help/Guidance With Weather Display Project

I wanting to display a few weather values to a TFT or OLED display from my home weather station. I've been googling this for a week not finding any answers.

My weather station produces a CSV text file every 30 seconds of weather values to my local NAS. Using a browser, 192.168.1.50/weather/realtime.txt will produce this string on the screen.

I'm trying to figure out how, using a Adafruit Feather (esp8266) I can display 3 or 4 weather values to a small attached TFT or preferably a OLED? My coding abilities are limited (cut and paste) but I'm beginning to understand how code works and in the past have edited existing code to meet my goal. The problem with this goal is I can't find anything close.

I've found lots of cloud base weather services using an API but I want to display my weather station data. Not from somewhere 100 miles away.

Find a web client example for your ESP and point it at your NAS. To start with, just echo what you receive to serial. Once that is working, try to parse out some useful values for the displ.

I've tried this before and get the errors listed below:

connecting to 192.168.1.97
Requesting URL: /192.168.1.97/weather/realtime.txt
HTTP/1.1 404 Not Found
Date: Sun, 30 Jan 2022 14:38:03 GMT
Server: Apache/2.4.25 (Raspbian)
Content-Length: 311
Connection: close
Content-Type: text/html; charset=iso-8859-1

404 Not Found

Not Found

The requested URL /192.168.1.97/weather/realtime.txt was not found on this server.


Apache/2.4.25 (Raspbian) Server at 192.168.1.97 Port 80

Why 97? Your earlier post has the NAS at 50.

I made a mistake on my initial post.

Post your code. I suspect though that you should be requesting without the IP, because it has been specified earlier in the code as the target server.

Thanks!! I removed the IP and just left /weather/realtime.txt as the string url and now pulling the text file in monitor.

Now can you help me with how to parse the data for display? I only want 3 or 4 values out of the 58 available.

Here's what is pulled:

Content-Type: text/plain

30/01/22 09:24:53 18.9 66 9.4 12.0 12.0 320 0.00 0.00 30.091 NW 3 mph F in in 123.0 +0.024 0.00 0.00 0.00 71.8 31 6.3 +0.4 26.8 00:00 16.4 07:36 19.0 04:48 25.0 04:49 30.091 09:24 29.893 00:01 3.0.0 3036 18.0 18.9 11.2 0.0 0.000 0 322 0.00 2 1 0 NW 2157 ft 6.3 0.0 241 0

closing connection

Strtok is a useful tool for parsing string data.

Before you get started though, consider making the weather station emit another, simpler file that just has the items you want.

A "browser" is an HTTP/Web client. Using whatever HTTP Client library is suitable for your hardware, request the page contents. Once you get the response from the server you can use the data however you like.

After selecting Tools->Board: Adafruit Feather (or whatever), check File->Examples for a Web Client or HTTP Client example.

wildbill, I was able to create a template file that reduced the 58 weather parameters down to only 4. Now to figure out how to send the serial print to display print. Thanks for your help.

"you can use the data however you like" :laughing:
This is my first attempt at pulling data from another device and displaying it on a OLED. Very, very much a newbie here.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.