Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Weatherstation
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM Project Blog
View previous topic :: View next topic  
Author Message
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Mon Aug 03, 2015 5:02 pm    Post subject: Weatherstation Reply with quote



32 degrees Celsius today at Tilburg / Netherlands. Here is the proof Very Happy

The information is fetched by a Nodemcu and weatherinformation is send to the serialin1 port of an Arduino Mega 2560 with an ILI9327-display.

Nodemcu:

Where can you find the code for the nodemcu weatherstation

https://github.com/squix78/esp8266-projects/tree/master/arduino-ide/weather-station-v2

We ripped the OLED-code from the Nodemcu software. Just used the info that comes from the serial port at 115200 baud

Brief: there is a plug-in for the recent Arduino-IDE (version 1.6.4) that can be used to program the Nodemcu

You can use Generic ESP8266 modues, Nodemcu and Olimex MOD-WIFI-8266
At the preferences you can add this link and use the board manager to add the NodeMCU and ESP8266 boards.

http://arduino.esp8266.com/package_esp8266com_index.json

==

Weatherinfo:

API-key you can get it at
www.forecast.io
at the bottom
Forecast API

1000 calls are allowed for free. In the Nodemcu software every 10 minutes a call is made to get new weatherinfo.
Thats is 6 times an hour, 6 x 24 = 144 times in 24 hour.

Do a test, just the nodemcu. If everything is alright you will get this information from the Nodemcu

Code:
Requesting URL: /rest/weather?apiKey=<here your API-key>&lat=51.50&lon=5.00&units=auto

HTTP/1.1 200 OKDate: Mon, 03 Aug 2015 13:49:37 GMT
Server: Apache/2.2.29 (FreeBSD) DAV/2 mod_ssl/2.2.29 OpenSSL/1.0.2c mod_hcgi/0.9.5
X-Powered-By: PHP/5.4.42
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html

11c

CURRENT_TEMP=32
CURRENT_HUMIDITY=41
CURRENT_ICON=clear-day
CURRENT_SUMMARY=Clear
MAX_TEMP_TODAY=32
MIN_TEMP_TODAY=15
ICON_TODAY=partly-cloudy-night
SUMMARY_TODAY=Partly cloudy overnight.
MAX_TEMP_TOMORROW=21
ICON_TOMORROW=rain
MIN_TEMP_TOMORROW=14
SUMMARY_TODAY=Rain until afternoon.

0

closing connection
 

==

Bascom-AVR:

In the ZIP-file the main program, two include files and files for optional AVR-DOS.
The hardware is from CE - Chinese Electronics. It is an Arduino Mega 2560 with an ILI9327 display. 400 x 240 pixels.

Also in the zip-file BGC-icons and the source of these icons (BMP).

Here a picture of the complete hardware:



Have fun
Ben Zijlstra
Theo Kleijn

BTW it is version 0.99 because we haven't seen all weatherconditions yet. Perhaps we have to adapt the program a bit later on.
Back to top
View user's profile Visit poster's website
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 1161
Location: France

france.gif
PostPosted: Mon Aug 03, 2015 5:54 pm    Post subject: Reply with quote

hello Ben,

well I lost ! you send yours before me, but my approach is very different !
My project is nearly finish the weather station needs some modifications (very few )
And then I have to translate it in english !

but now 15 days of vacation !
Back to top
View user's profile Visit poster's website
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Mon Aug 03, 2015 6:07 pm    Post subject: gauges... Reply with quote

Very nice. Would like to see the code for the gauges.

Have a nice holiday
Ben Zijlstra
Back to top
View user's profile Visit poster's website
aphawk

Bascom Member



Joined: 23 Jan 2010
Posts: 168
Location: Brazil

brazil.gif
PostPosted: Tue Aug 04, 2015 3:44 am    Post subject: Reply with quote

Ben,

Very nice project !

This API is very interesting, and the ESP8266 make our programs be very small.

In fact, I'm using one ESP8266 to make an remote Power Off / delay 10 seconds / Power On again , to reset my cable modem that hangs sometimes and are located in other room, I use my Ipad in my Wi-Fi to make this .

Thank you again for share this new project !


Duval,

Your Gauges are very nice too, what display you are using ?

Paulo
Back to top
View user's profile
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 1161
Location: France

france.gif
PostPosted: Tue Aug 04, 2015 8:12 am    Post subject: Reply with quote

to Ben
No thanks,
my weather station is a part of a great project that will unveil in september... secret!
Wink Smile Laughing
jp
Back to top
View user's profile Visit poster's website
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 1161
Location: France

france.gif
PostPosted: Tue Aug 04, 2015 8:21 am    Post subject: Reply with quote

to Paulo

I use Draw8 to draw the screen I will explain all in september (see my previous post to Ben)
Would you please follow this link, http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=12505 for the display and let me see thanks again to H.Kipnic for his job.
JP

Wink
Back to top
View user's profile Visit poster's website
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 1161
Location: France

france.gif
PostPosted: Tue Aug 04, 2015 8:34 am    Post subject: Reply with quote

To Ben again ! you know I'm a clown !
yes I would like to share my program but it is not completely finish I have to clean, to translate, please wait september !
Back to top
View user's profile Visit poster's website
aphawk

Bascom Member



Joined: 23 Jan 2010
Posts: 168
Location: Brazil

brazil.gif
PostPosted: Sun Aug 09, 2015 3:09 am    Post subject: Reply with quote

Duval,

Well, I like surprises !!!!!

Waiting for September !

Paulo
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5916
Location: Holland

blank.gif
PostPosted: Tue Aug 18, 2015 10:15 am    Post subject: Reply with quote

Hello Ben & Theo.

Good to see your summer project Very Happy
You guys always have cool projects. Thanks for sharing your project.

_________________
Mark
Back to top
View user's profile Visit poster's website
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Sun Sep 06, 2015 3:00 pm    Post subject: Weatherstation with reset Nodemcu Reply with quote

Weatherstation is running very well but I would like to harden the code a bit.
Now the code is running with optimal conditions, in reach of an Access Point.

But what if there is an internet connection problem?

Have added a timer/counter that is running for 8 minutes en through Portb.4 of the Arduino Mega sends a reset to the Nodemcu.

This is a small piece of electronics between the Arduino Mega and the Nodemcu



Have fun
Ben Zijlstra


Last edited by bzijlstra on Tue Jan 05, 2016 8:32 pm; edited 1 time in total
Back to top
View user's profile Visit poster's website
Evert :-)

Bascom Expert



Joined: 18 Feb 2005
Posts: 2156

netherlands.gif
PostPosted: Sun Sep 06, 2015 4:28 pm    Post subject: Reply with quote

Hi Ben,

Nice project.
It would be nice if you can also reset the weather from rain to sunshine. Very Happy
Look outside and you know what I mean.

_________________
www.evertdekker.com Bascom code vault
Back to top
View user's profile Visit poster's website
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Sun Sep 06, 2015 5:44 pm    Post subject: Will do.. Reply with quote

Will add that option:

Code:
Call replace_rain_in_sunshine()


Give me a few days..

Have fun
Ben Zijlstra
Back to top
View user's profile Visit poster's website
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Mon Jan 18, 2016 10:15 pm    Post subject: Update weatherstation Reply with quote

In the weatherstation published before, there was some kind of proxy/parser for the www.forecast.io information.
Not all the weather-information from www.forecast.io was passed on to the user. A Dutch company made a new proxy/parser with more information

This is passed to the user:

Code:
CURRENT_DATETIME=2016-01-14 16:16:46
CURRENT_TEMP=5.07
CURRENT_ICON=partly-cloudy-day
CURRENT_SUMMARY=Licht bewolkt
CURRENT_OZONE=339.46
CURRENT_WINDSPEED=4.37
CURRENT_WINDBEARING=234
CURRENT_HUMIDITY=80.0
CURRENT_DEWPOINT=1.92
CURRENT_PREC_TYPE=rain
CURRENT_PREC_INTENS=8.89
CURRENT_PREC_PROB=13.0
CURRENT_TEMP_APPARENT=1.74
CURRENT_PRESSURE=1002.86
CURRENT_CLOUDCOVER=31.0


And using a new HX8357c display, with the driver from HKipnik, a lot of information is put on the 480x320 display.


Photo: Nour Alchazli


Photo: Nour Alchazli

Will put the software online soon...

Have fun
Ben Zijlstra
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5916
Location: Holland

blank.gif
PostPosted: Tue Jan 19, 2016 3:50 pm    Post subject: Reply with quote

looks great Ben. Looking forward to the update.
_________________
Mark
Back to top
View user's profile Visit poster's website
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Fri Jan 22, 2016 5:13 pm    Post subject: Update Reply with quote

Lets call it Weatherstation 3.0

Same hardware, just replace the ili9327 400x240 display with an HX8357B or C display. The Bascom-AVR-code is written for the HX8357C (480x320 pixels).

The nodemcu should point to another provider. Instead of a proxy/parser server in Switserland, the nodemcu must point to a proxy/parser in Holland.

We will be using a free service, there is an extended service with forecast for a week, moonphase and all kind of extra options, details later on.

You should have a API-key as mentioned before from www.forecast.io

The code for the nodemcu:

Weatherstation.ino
WeatherClient.cpp
WeatherClient.h

You will find it in the ZIP-file

If the nodemcu gets the weatherinfo you will see this on the serial port. You can test this function without the Arduino:

Quote:
CURRENT_DATETIME=2016-01-20 15:33:56
CURRENT_TEMP=3.96
CURRENT_ICON=partly-cloudy-day
CURRENT_SUMMARY=Mostly Cloudy
CURRENT_OZONE=394.96
CURRENT_WINDSPEED=4.11
CURRENT_WINDBEARING=250
CURRENT_HUMIDITY=86.0
CURRENT_DEWPOINT=1.76
CURRENT_PREC_INTENS=0.0
CURRENT_PREC_PROB=0.0
CURRENT_TEMP_APPARENT=0.51
CURRENT_PRESSURE=1018.94
CURRENT_CLOUDCOVER=65.0

closing connection


In the URI that is send to the proxy/parser you can put a &lang=option, or, when you ommit it, you will get the summary in Dutch.
&lang=en will put the summary in English.

Check
https://github.com/darkskyapp/forecast-io-translations/tree/master/lib/lang
for all possible languages.

In the zip-file also all Bascom-AVR files, images, drivers, fonts etc. The HX8357B/C display driver has been made by HKipnik.

The code is working, the nodemcu is been reset by the Arduino every 8 minutes. If you take the weatherstation away from the location and re-enter the location again, it will automatically attach again to the wireless network, and will try that every 8 minutes.

Some considerations:
Windbearing is now in degrees. Perhaps I will change that to N, S, W, E. Have to add these characters to digital20x32.font which now has only the 7-segment characters.

And have to check the length of the summary-text. Will do some small correction later on. Perhaps some text don't fit in the single line reservated now for the summary. BTW all English text and the translation to different languages can also be found at
https://github.com/darkskyapp/forecast-io-translations/tree/master/lib/lang You have to pick the languages you would like to use.

The plans now are to make a weatherstation with two locations, perhaps 'house' and 'boat'. And a bigger version on a 7 inch display.

Have fun
Ben Zijlstra
Theo Kleijn

Edit: something went wrong with the ZIP-file, so we uploaded a new one.
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM Project Blog All times are GMT + 1 Hour
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum