Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:20 11 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Can anyone help must have E100 ?

Author Message
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 09:07pm 06 Apr 2018
Copy link to clipboard 
Print this post

Has anyone got an Explore100 and an Esp8266 and an SSD1963 display?
I'd like to send a couple of people the code I have for the weather station and see if they can help with the "forecast" for the next 5 days section

If you don't have an ESP8266 I have 3 here that I can send to people but you'd have to be in the UK ideally otherwise posting it wouldn't be feasible

I'm using ESPBasic with the Esp8266 and I'll send you the code for that as well as the Micromite

I've go the weather station working great and I've "almost" got the forecast for the next 5 days working
I've got the ESP sending the correct data and I've "almost" got the Micromite parsing it properly
The issue I have I'm sending 2 sets of strings from the ESP and depending on what the 1st character is decides which subroutine it goes to

The parsing of the 1st character works, and the sending it to the correct sub works but only works sometimes and I can't figure out why

Hopefully with at least 2 sets of brains working it can be solved but I've spent the past week continually working on it and I'm stumped and could do with a 2nd set of eyes
 
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 05:00am 07 Apr 2018
Copy link to clipboard 
Print this post

Hi
Yip i can help I have all the required bits

Regards
Jman
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1116
Posted: 10:42am 07 Apr 2018
Copy link to clipboard 
Print this post

Lewis,

I would be happy to help also - I have all the kit needed. I do not have any experience with ESP Basic however.

Cheers,
Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 02:39pm 07 Apr 2018
Copy link to clipboard 
Print this post

Thanks Gerry, Doug and Jman

I've enclosed the files in the Zip below 2018-04-08_002628_Weather_.zip

The files are

All the Weather icons and Pictures needed – they have to be put on the SD Card (only the background for the compass, Temp and weather icons)

IF you want to use the UP/Down Arrows on the pressure display you’ll have to load the "various_symbols font" in the Embedded Fonts folder in the MM firmware zip
I put that in the Library as Font 8

WeatherDisplay2018 Mk2.bas is the working Weather Station with no forecast facility

WeatherDisplay2018 Mk2.02.bas is the above BUT I’ve also included the code to Parse the forecast for the next 5 days and I’ve also included code for a 2nd page on the display to display the 5 days
Forecast

Page2.bas is the 5 day forecast on it’s own – at the moment it just draws the boxes to put the forecast for each day in but you will be able to see my idea when you run it


I have a DHT22 on my board and I’ve included the code for a DS18B20 In the weather code as well – just comment out what you don’t want

I’ve labelled almost every line of code – hopefully it’s self-explanatory


As to ESPBasic

The Flasher for it can be got HERE

Flashing instructions are HERE


It's really simple to use
What I have done is once it Flashed I connected it to my router with a static IP address



Just put your WIFI Name and password in and the IP address you want to use (no changes to the router needed)

Remember to tick RUN default.bas at startup and after you click run the 1st time, any time you reboot it will run automatically

Programming it with the code I have
Just log into whatever IP address you gave it, click on EDIT
and copy and paste the code in there then click SAVE then RUN
it's that simple

The only thing anyone wanting to use it will have to do is get an API key is sign up to Openweathermap API HERE

Once you have your API key just place it in the code in the places where I've said "Put API key HERE"

Also change id=2651357 on each of the line to your local city

You'll find your local city code HERE

EDIT - the line in the ESP CODE that says
[code]let query = "api.openweathermap.org/data/2.5/uvi?lat=53.439&lon=-2.106&appid=PUT-APP-ID-HERE"[/code]

Change the LAT and LON to your latitude and Longtitude

Any questions just shoot them at me

Either on here or message or ask me for my email address
Edited by lew247 2018-04-09
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 02:53pm 07 Apr 2018
Copy link to clipboard 
Print this post

I have no idea what I've done wrong today but it was mixing up the field arrays

I've now fixed it - can you please use the attached codes for both MM and ESP

When using it "AS IS" Please use the WeatherDisplay2018 Mk2.1.bas AND the ESPCODE.TXT in the ESP8266


When you want to play with the Forecast code Please use Weaather-Forecast.bas and ESPCODE-Forecast.txt in the ESP8266


You'll notice I've changed the number of field arrays and adding the word "one" and "two" to the data being send from the ESP8266

This is so the MM can seperate the 2 lines of code and parse them correctly

2018-04-08_030137_NewWeather.zip

Here's how it looks now

The "Weather tomorrow" box could be used as the forecast button





Ideally when it's finished I'd like to have a logger that will shows graphs of the weather over the past week/month/year and writes to the serial flash chip on the back of the LCD display rather than using the SD Card

I did try changing the pictures to ascii.ppm format so they would run from the serial flash but I couldn't get the pictures converted so they would work.

The reason I'd like to do this last bit is because occasionally I get "SD Card Not Found" when it goes to update the weather icon and also because the SD card sticks out of the bottom of the display and it's going to be a right PITA to get some kind of case for it

EDIT: Updated the Zip file as it had an error in the code*
I also just noticed the pressure for tomorrow has 3 digits, no idea how that happened because I've set it at 2 decimal placesEdited by lew247 2018-04-09
 
MikeO
Senior Member

Joined: 11/09/2011
Location: Australia
Posts: 275
Posted: 02:57am 08 Apr 2018
Copy link to clipboard 
Print this post

If anyone who is planning to help Lew with this, has any problems with the ESP8266 and ESPbasic I would be very happy to help. I am very familiar with ESPbasic and pointed Lew in this direction initially but I am sure his code is very home grown by now

Mike


Codenquilts
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 07:59am 08 Apr 2018
Copy link to clipboard 
Print this post

Mike, the code is the simplest ever, it could be done on the MM and the ESP use any language or code
The reason I went with ESPBasic is the same as yourself I believe, it's so simple to use and very much like MM Basic
And it already has the facility to parse Openweathermap forecasts built in

The code I use is basically

let query = let query = "api.openweathermap.org/data/2.5/forecast/daily?id=2651357&units=metric&appid=PUT-APP-ID-HERE" 'get the forecast
let ret = readopenweather(query,2) 'Which day you want to parse
let press1 = json(ret,"pressure") 'which section of that day you want to pick to send to the MM


Without using EspBasic the MM would have to tell the ESP to get the forecast and then work out which day it wanted and then parse the days - it's much simpler using EspBasic as we have to use the ESP8266 anyway

Also the string that's sent is too long for the MM as it's more than 255 characters

 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 1044
Posted: 12:15pm 08 Apr 2018
Copy link to clipboard 
Print this post

Hi Lewis,
A question about the API Key. Are you using a free one? If so have you any issues with repeating the queries so often. The site says you should only query every 10 minutes on the free one or it will lock you out for 1 hr then 24 hours if you persist.

GerryEdited by disco4now 2018-04-09
F4 H7FotSF4xGT
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 08:30pm 08 Apr 2018
Copy link to clipboard 
Print this post

It's the free one Gerry
I've been using it for many months with no issues
I did check the maximum number of queries per hour and even every 15 seconds it's way below it

Once it's all sorted it can be changed to 20 or 60 mins or however long till someone wants it updated

It's only every 15 seconds at the moment to aid troubleshooting
 
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 07:43pm 09 Apr 2018
Copy link to clipboard 
Print this post

Hi
@Mike

I am seeing the below from the ESP8266 this is after seeing the expected data is this normal ?

0 winsock Disconnected!
0 winsock connected 192.168.0.36


Regards
JmanEdited by jman 2018-04-11
 
MikeO
Senior Member

Joined: 11/09/2011
Location: Australia
Posts: 275
Posted: 11:20am 10 Apr 2018
Copy link to clipboard 
Print this post

The believe the socket does not cope well with large amount of data unfortunately and it drops the socket then resets. I have tried the code and experienced the same. I may get the chance to do a few more tests tomorrow.

Mike
Codenquilts
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025