Weather Station Code

Here is the code I used for the weather station that connects the wifi network, then to a mysql database to save data. I think most of it is self explanatory, change a few passwords and login details as well as the database and table names and it should be good to go.

sprintf(INSERT_SQL,”INSERT INTO weatherstation.SensorData VALUES ( ”, now(), now(), ‘%d’, ‘%d’, ‘%d’, ‘%d’, ‘%d’ )”,temp, humidity, pressure, heatindex, dewpoint);

This line might look a bit odd, 8 elements but only 5 variables, the first table element is a primary key that auto increments, the next 2, now() inserts the server data and server time followed by the 5 variables. These need to be in that exact order when you create the database table.



On Second Thoughts

After some tinkering and some testing i found out what the culprit was, it was the Barometric pressure sensor that went tits up and was causing the code to crash and reset the micro. The RTC clock also went belly up as well, well it still tells the time, but its the wrong time and for the life of me, i cannot get it to reset. On top of all that, its only been 7 weeks or there abouts outside and the chinesium oxide is taking over everything.

So, a total rebuild is the order of the day and lots and lots of conformal coating to try and mitigate the corrosion problems. One positive is that the solar charging system and batteries are in really good order. 7 weeks outdoors and the battery voltage was 4.17v so I cannot complain at that.

I do not have a spare pressure sensor so its going to be a few weeks to get parts out of china to fix it. In the mean time, the code is working at least and that is something.


It DIED :(

So I connected to the weather station the other day to be greeted with SD Card not detected. Poo, is about all I think about that. I am not sure yet if it was the card that died, or if it was the card reader that died. So I figure that its time to make some hard decisions and do what I probably should have done in the beginning and that was use a MYSQL database and just send the data across the home network or across the interwebs to my webserver that hosts this blog. Which kind of sucks because I have been putting off having to learn SQL or PHP for a long time.

So off to google to do some google foo and I find that there is a nice MYSQL library that takes care of all the drudgery, which is good as it will save me a lot of work.

First step was to jump on the webserver and make a new database and a table to save the data to. Job Done!

Next up was to write some code to connect to my home network and then connect to the database. Job Done!

Fire it up and it connects to the network and the database and sends the data just fine. Now all i have to do is pull the weather station down, bring it inside and upload the now modified code as well as fix the problem i was having with the rain sensor. It kind of sucks that I have lost all or most of the Febuary data, but it is what it is and I should never have relied on an SD card to do the job long term. Less moving part, less things to go wrong, oh well, i know for next time.


Fun With FT8 on 40m

Welcome to Dr Sheldon Coopers Fun with FT8. So i fired up FT8 last night for some receiving fun to see whats doing and certainly heard a lot of places. It looks like FT8 is the new black with many people using it. 51 countries heard and many more stations especially out of Japan. All in all, it was a bit of fun to see what I can here on my dipole. Flicked over to 15m now to see if there is anyone about.


WSPR on 15m

Bottom of the cycle, bands will be dead they say. Well, perhaps not as dead as one expects. Little openings are there all throughout the day and in my case, VK2 was open most of the day. Bands are dead of course, not because there is no propagation, but because there is no one home to work. It is what it is and this WSPR thing is pretty cool. I did not learn anything i did not already know, USA in the mornings and Asia in the evenings. And a few other bits and bobs along the way.

I did have one interesting thing happen, a broken decode where I got no call sign but did get a grid square, I am not confident this is actually accurate, but if it is, then the station i was copying was in Egypt, someways south of Cairo. It would be cool if this was actually the case, but I won’t be holding my breath LOL.






In a moment of boredom i thought i would have a play with WSPR. Be very very quiet, we are hunting signals. Obviously my license does not allow me to TX with this mode, but nothing is stopping me from Rxing till I have had my fill and that is just what i am doing. I have to admit, its a bit like watching paint dry, but if you walk away and watch tv and then come back 30mins later you might notice a change or two to the list in the software HAHAHA. Anyway, its radio and it fullfills that you need to do some radio this week itch. I might give that FT8 thing a crack tomorrow and see what it is all about too.

And after letting it run for 12 hours:


A Giant Lightning Rod

So with the new mast being as giant aluminum lightning rod, I thought it might be prudent to take the coax out of the radio while the thunder and lightnings was very very frighting, Galileo Figaro.  But I am kind of concerned having the connector so close to my mouse hand. If i did get a strike, i would not want to be sitting at the computer HIHI.


Antenna is Done

So i got the dipole up now in its final position. The coax is now clamped to the mast so there is no flapping about in the breeze. The ends are up at their finished height. All up we have 7.6m apex and about 3m at the ends. Seems to be working ok, rx is certainly up.


SWR is as good as it is going to get and much broader banded than the old shortened dipole.

Photo bombed by Buster the Boxer. This is some fancy engenerding going on here. There is a 6ft star dropper 2ft in the ground right up the masts clacker providing the main support, the 2nd star dropper is screwed to the retaining wall and some big automotive clamps tying the 2 together. No idea what the safe working limit on all these things are LOL, but it did not move much during the big storm we had go thought last night. So i think it should be ok.


WWFF 352

This one has been a long time coming. Its alot harder for us in vk4 to work the southern stations in VK3 and VK5 where most of the action is, so getting here with only 10w and a crappy dipole is a pretty good effort.


New Dipole and Mast

Today i pulled down the old antenna and mast and put up a new and improved version of each. The old shortened 40m dipole was only ever meant to be a temporary solution that stayed in place for 3 years. So it was time to bring her down and put it to rest.

I bought a flag pole cause it seemed like a quick and simple way of putting up a new dipole and a balun because i want to be one of those balun guys who has to tell you what kind of balun he is using even though its kind of not important to the conversation but the word balun gives the air of technical know how and ability especially when you say its a 9 to 1 balun which is really an unun or as I call them 9:1 onions, because endfails will make you cry, but I digress. <– this is called sarcasm to anyone who is going to get hurt feelings over their antenna of choice, don’t email me call your local politician and complain to them.

Erected the flagpole and hoisted up the balun and new dipole cut for 40m on the flag raising rope, saluting while humming the national anthem and got the ends up in a temporary fashion to check the long or short of it with the analyzer, when the wife gets home from work. She comes out the back, looks at the new flag pole and remarks, Oh great, its storm season and you go and erect a dirty great big lightning attracter. Chuckles to herself and leaves me to antennaring like i know what i am doing. And if my Pythagoras is correct, when i put the ends up about 4m in the air, i should have 50mm to spare. The joy of living on a postage stamp block in the city.