FINALLY SOS CLOSE
Updated read me with instructions and features
Check it out YAY
Excited to see what you guys think about it
Okok I swear this is the last one. It has to be ;-;
A little page that holds a summary of the past 30 days for all of the stations. High/low temperature, average temperature, average dew point, precipitation, average wind speed, and maximum wind gusts for each station. You can download the data as a csv. If you look a little below you can see where I am going with this…
Once a month (same time as the admin report) the monthly weather report summary is sent out to whoever signs up. (Whole other email model SQL table with its own CRUD in the admin settings). It also includes links to the website.
Now the registration has a toggle in the settings for the page to be on or off. If the env variable BOOTSTRAP_REGISTRATION=True then the page is unlocked for the next account (which will be a admin account)
Soooooooooooooo close to shipping.
The Map will now automatically zoom based the center of the points.
The place the data was being scraped from got changed so I had to update the logic.
Created another CRUD for another email list. This list will get a monthly email summarizing the weather for the past 30 days for each of the stations. I created the web page for it, but need to finish cleaning it up, allowing people to sign up for the service and make the emails send automaticcally.
The mobile version of the website did not look good. I spent a lot of time trying to fix it before I was able to get it to look like this!
I used ArcGIS’s JS to create a map tab that show cases all stations that have a latitude and longitude value. I am working on getting them on the first ever scrape but you can also edit them within the settings page. There is a link that takes you to the station page as well.
Created a toggle within the .env file. If on, the program will use the SQlite db and be able to run on VS Code for example. When it is off, it needs the PostGRESql db to function.
Docker is really infuriating lmao. Spent most of my time fixing tiny bugs.
Man this project has taught me how much I hate fusion 😭. But I had to learn it eventually right?
I added a 45 degree one inch feet to match with my keyboard. I also added small insert holes for me to put rubber feet (or more realistically hot glue).
I spent some time error checking and making the pcb production ready. I created my own footprint for the XAOI to get it to fit on my pcb. I wanted the USB to stick out to reduce the length of cable required to go in.
I started putting all of the files on GitHub, check it out! My Github
Hey guys!
I am using Docker for deployment of this system to make it easy for anyone who has a weather station or network of them to showcase and monitor their own data. Docker is a type of virtualization (similar to VMs but instead sharing the kernel) that is a lot less resource intensive and is used for deploying a lot of small projects as well as any type of home labbing work flow (hosting your own server etc.). (Yes I pulled that explanation from my last devlog lmao). I will have a tutorial in the ReadME.
Within the docker stack, there are several containers with different jobs and responsibilities:
Hosts the FastAPI webserver. It uses a endpoint (/health) to monitor the servers responses. It is hosted on port 8000 by default (configurable in the .env file). I would forward this through Nginx or a Cloudflare tunnel to host it under your own domain.
Runs the status and weather scrapers every 15 and 5 minutes (offset by two mins) respectively through a crontab file (scraper.crontab). It is run using Supercronic. The scraper waits for the web server as well. Flock is used to prevent two instances of a program.
PostgreSQL server that holds all of the data. Weather data, users, etc. All of the other containers wait till the DB is healthy to start.
A container created by Prodrigestivill to automate backups of Postgres databases. I have it configured to keep the last month and 14 days of backups. It saves all backups to the /opt/mesonet-backups folder.
I wrote scripts in order to test restoring backups (creates test table, restores using latest backup, and deletes it), create a manual backup, and restore the last backup.
Fairly similar to how emails are sent in the status-scraper, it obtains admin recpients from the web sever uses enviroment vairbales to send an email. It asks for subject and text using arguments in the terminal, so the user can send emails manually to admins as well.
Runs a couple of health based scripts on a Supercronic schedule. Monthly restore test (runs the restore test mentioned before) and a daily backup health (checks how old the backup is). Emails will be sent to admins if the restore fails or the backup is more than 26 hours old.
All the containers used volumes that continued even if the containers were deleted to be updated, the data (and the backups) are fine.
Hey guys! It has been a couple of days…
So I looked on my calendar a week ago and realized that Stardance was almost over, and thought “this is plenty of time”. Then a couple of days ago I really felt the pressure. I wanted to get this out before the program finished so I started on the final bits and deployment to turn this into a usable system.
If you don’t know what docker is, count your lucky stars. Just kidding, its very cool when it works. It is a type of virtualization (similar to VMs but instead sharing the kernal) that is a lot less resource intensive and is used for deploying a lot of small projects as well as any type of home labbing work flow (hosting your own server etc.). I have worked with docker with pre-built images and containers before and never really went into the DIY portion. This was my first intro into it and I had to do a lot of googling and the such. It was really frustrating and required quite a few head banging.
I did use AI sometimes (tried as little as I could) to get docker working. You can see me sometimes using it in my lapse recordings, but I tried to keep it closed as long as I could to stop me from using it :D.
I was told that hard coding my config values in a config file was a bad idea…and it makes sense. It took a bit, but once I setup environment variables, oh man did it get so much better. This also makes it a lot easier in docker to setup the container. Very happy about this.
I told this story a couple of weeks ago, but one of my friend’s dad found my repo and left a couple of issues on my page and these were my last two. I really gotta thank him for these ideas.
Hey guys, School started two weeks ago, so my posts will be a little delayed lol…
I originally hard coded my email lists for Reports, station-specific, admin, and global emails, but I wanted to unify them with the rest of the API. I spent a lot of time creating columns in SQL, endpoint CRUD, settings HTML page CRUD, as well as changing the scrapers to pull the lists and use them.
I added columns in SQL to add Hardware metadata for the stations. It can be seen in all dashboards (see photo)
I was thinking of creating a docker container for this setup to make deployment easier. Would that be something you guys would like to see? Let me know.
Hey hey hey, I know it has been like three months but I can explain…
Well to be honest, I do NOT like fusion. I hate geometry and by extension cad. This project is my first time ever doing it so it took a lot of youtube videos, advise, and procrastination to get here.
The case is pretty simple, it has the top piece with cutouts for the OLED, rotary encoder, keys, as well as holes for the LEDs to shine through. (I will fillet everything at the end) It also has holes for the heat inserts to melt into. The bottom case has the actual walls of the case, holes for the screws, standoffs for the pcb, as well as the USB C cutout.
This is definitely not my cup of tea, so please let me know if anyone has any ideas.
Whats up?
For those who don’t know, a “robots.txt” tells scrapers and any bots where they allowed to go on your website. I only allowed them to go on public html pages. However this is only a recommendation, the big guys can do whatever they want.
I had this error where any public accounts (or not admins) would get a error when logging in. I was searching for permissions with the wrong column in the database 😅.
I made sure there were no open routes and everything was secured.
This was pretty cool. At the end of ever page, I added this little footer with my name and a link to the github repo.
I added a new column to store station hardware info. This is mainly for what weather station model it is. Ex: Davis Vantage Pro2. I am working on making the update form in the settings page allow to update this info as well as more station info.
The project is almost done! (why do I feel like I will be saying that a lot…)
Today I saw interesting post on Facebook about a website someone my age built and I commented it on it asking if I could see the code cause I was curious if they used Flask, FastAPI, etc. I also posted my project and to my surprise, the poster is actually my friend’s dad (small world am I right) and he reviewed my code and left a few issues on it. He even downloaded it to update my requirements.txt. I then merged his request. Thank you for all of your help!
I spent all of today working on the readme, you can read it here. However here is a little sneak peak:
Hey! Here is what I have been up to…
This is a Admin only page (will pop up in nav bar when admin) that configures, deletes, creates, the main functionalities. This includes stations and users. After every function is run a error/success message will show with detailed intomation depending on the function.
I realized around 11 at night that I did something very dumb. All of the stations in the configs for the Weather and Status scrapers were hard coded values and were NOT synced with the current stations database. To combat this, I added a new column to the Stations database table. This column was called collect_active or something of the sort. I plan to migrate the delete function to turning off the collection. I then changed the scrapers to pull a new current list at every run and used that as their truth. I finished this around 3 AM last night 😭 .
If you guys have any other ideas, let me know!
Now that the main functionality of the site is finished, I started making HTML representations of all the methods I have predefined. This includes CRUD (create, read, update, and delete) functions for several pieces of the website. Here are the ones I started to make:
Everything uses HTLM forms and when they submit, they will return a pop up success or error message.
There are a couple of other features I forgot that I made (Such happens when coding at ungodly hours) but anyone can try out the website (if I am working on it at the same time) at https://sbb.krupamlab.com
Let’s jump into it!
For graphing, analysis, tests, and table pages, I created CSV downloads.
In the public dashboards, there is now a table at the bottom with all data from the current day. There are quick buttons to go forward and back a day as well as a day input and go button.
It is just a blank profile picture icon with your username next to it. It only shows when logged in. When clicked it sends you to the my-stations page.
If there are specific error details in the backend, they will be sent to the error page. Otherwise a generic 40X error will be show
Sup guys, here is what I have been up to…
Oh man this was pretty hard. I actually had writers block but for code. I just couldn’t think of a solution. I just sat there trying to think of how to implement the system. With enough brute force however and some breaks, I did manage to get it working.
This page allows the user to run scientific tests. These tests include Linear Regressions, ANOVAS, and T-Tests. Linear Regressions look for a relationship between variables. ANOVAS and T-tests determine if there a difference between groups of data (single variable).
The form will ask the user to choose a test, station, variable, unit, and time range, as well as test-specific inputs to run a test. Once the user submits the test, it will either return a graphical result (for the Linear Regression) or stats of the T-Test or ANOVA. The Tests will only make groups depending on the same time frame but different stations. (I only decided to do one for simplicity) This all works but I need to create the ability to download the csv of the data used for the tests.
When a test is chosen, test-specific inputs appear. (this happens for other forms such as graphing and analysis pages. I just forgot to mention it) The appeared inputs are then required (like the other default inputs like time, etc) but when a different test is choosen the required inputs are updated with the new ones. These include:
Linear Regression:
T-Test:
ANOVAS:
I went through all of the Forms that have inputs that switch and make them work nicely with the backend. I make inputs that switch be required and seen at the right time.
Oh Oh Boy have I had a lot of fun haha.
I started assembling my parts, more unboxing, but I also started testing individual components with the picos. I took the code I had created already and modified it in seperate files to only test one sensor at a time. I have had a jolly good time. I did most of my work over laspe so take a look! My Lapse Account
I was unable to get this on camera but I did most of y soldering for the MicroSD card. It was my first time but fairly simple, I just connected a few Dupont connectors into the holes in the board (for lack of a more technical term). I still have more soldering to do but I will try to get it on camera next time!
I have never used a microcontroller before so this was a crazy thing to try and learn. I spent a lot of time trying to mess around with libraries and find them on the internet.
The UPS that I have for the Pico has drivers and a program along it to collect battery info…but it only works on actual linux. It connects through I2C however, so I just reverse engineered it for the pico! I am still working on it however.
(I also spent like 2 hours trying to figure out my own diagram and plug the MicroSD card board in…)
This page is like the ultimate boss for me haha. I would like this page to contain linear regressions (LR), ANOVAS, and T-tests. These are scientific tests used to find statistical differences in data. (see the below screen shot for a better explanation of all of these tests. The user chooses a station, range mode, range, units, and the type of test. Then based on that test, a few options are given:
Choose 1 station but two time ranges (same variable)
Hey guys! Here is what I have been up to…
As well as a “last _ ____” system (relative range), I created a version that allows me to choose “Date Range.” Date Range allows you to choose between two dates. It sounds simple but was a lot harder to code 😅. As I wrote most of the code while being really sleep deprived, take a look over at @app.get("/graph/weather/{station_id}") on the project’s github page. (I recommend using ctrl + f to find it)
This page is pretty similar to the graphing page (see previous devlogs) where it uses a HTML form with query variables to create calculations. The user selects a weather station, variable, range mode (relative or date), inputs for that mode (hours/date, etc) and the units. Then the latest, minimum, maximum, mean, median, range, sample value (n value), and the overall trend (falling, steady, rising, insufficient data). The time will also be shown if applicable (latest value). You can then download a csv of all the data the calculations were derived from. Under that is another box showing the full time the data is collected from as well as the units
I still need to add a tab for more advanced analysis such as linear regressions, anovas, t-tests, etc.
If you guys have any more ideas, Let me know!!!