fowlerk / ESP8266-Color-Weather-Station-v8

Enhanced ESP8266 Color Weather Station w/ On-Demand Configuration
GNU General Public License v3.0
29 stars 5 forks source link

Rotating the Screen #9

Open PurelyAbrasive opened 6 years ago

PurelyAbrasive commented 6 years ago

How would you go about rotating the screen from portrait to landscape?

fowlerk commented 6 years ago

Unfortunately this would involve quite a bit of reformatting work, as the current screen layout is packed with information, and each element is quite precisely positioned based on a portrait orientation. In addition to issuing the command for rotating the screen orientation, every screen element would need to be carefully repositioned.

BTW, this version is quite dated now...the version in this repository has MANY improvements: https://github.com/fowlerk/ESP8266-Color-Weather-Station-v11d. A little more involved to get it going, but I’ve included a quick start guide.

Additionally, I’ve been working for months on a version that supports the touch-screen version of the 240x320 LCD. It’s working quite well and includes even more enhancements, but I’ve not yet posted it. If you’re interested let me know and I’ll try to get it uploaded sometime in the near future.

PurelyAbrasive commented 6 years ago

I have an Adafruit 480x320 TFT that I am wanting to adapt this to and I have already downloaded the v11d version and got it going on the screen is just smaller :)

fowlerk commented 6 years ago

Awesome...glad you found it. AFAIK it’s not advertised much anywhere and not many have stumbled across it. Re: a landscape version...the idea had crossed my mind before, just have had too many other enhancements to make with the existing version and limited time to work on it.

PurelyAbrasive commented 6 years ago

Question have you had any issues with the WifiManager? I am having an issue where when the ESP is in AP mode and I connect to it with my iPhone it will maintain a connection to the wifi until the config portal is started and then it disconnects from my phone. I have tried it on a couple of different iPhones.

fowlerk commented 6 years ago

On occasion, yes. I don’t know that this is related to WiFiManager per se, or if this is symptomatic of behavior of the ESP itself. There are some idiosyncrasies in the way the ESP automatically switches WiFi channels while scanning for APs under certain circumstances resulting in disconnection of existing clients that I believe may be related to this issue. There may even be some setting(s) that could prevent this from occurring in the Weather Station code, but I’ve not spent time trying to track it down, as it only happens sporadically with me and I don’t often use the configuration mode once my station is set up. I don’t try connecting from an iPhone, but frequently use an iPad, and this works pretty reliably most of the time. I have also seen this behavior when the ESP WiFi signal is weak (when my client device is too far away from the ESP).

Info from the Espressif SDK Programming Guide... https://cloud.githubusercontent.com/assets/974709/11223541/c629a832-8d70-11e5-8ba5-02f1e03a1735.png

Perhaps a combination of setting auto connect off, disconnecting existing WiFi connections, explicitly setting softAP mode, and maybe even WiI channel default prior to initiating the WiFiManager portal may help? Would require some testing to verify this...I have changed the current version of the code a bit, but just to disconnect from WiFI prior to initiating the portal...don’t know if that helps here.

In the interim, If you haven’t tried powering off the ESP and retrying, you might see if that affects your results. Also, if you’re not aware, there is another fork of the WiFiManager that I’ve used occasionally from Ken Taylor that works a little differently, but is otherwise very compatible with the API calls. It maintains the configuration portal AP until explicitly shut down, rather than exiting when parameters are saved. You might give it a whirl to see if your results vary.

PurelyAbrasive commented 6 years ago

I am sorry for all the questions but. I see where you have included some code for a DHT to be connected but I don't see in the code where the data is being displayed. Am I messing something? Thanks again for your help. I may have another fork of the V11 but using a 480x340 screen.

fowlerk commented 6 years ago

No worries about the questions...I’m glad that there is interest. RE: the DHT code...this was in Daniel Eichorn’s (squix78) original code, and since I wasn’t using an external DHT I didn’t include any display routines. I did leave the code in though in case someone wanted to re-implement this in the future.

Which display are you using? I’ve bought several larger displays up to 3.2” over the course of development, all are 240x320 though, with the newer ones including the XPT2046 touch controller.

I would say that the current code has MANY improvements over the 11d version, but does implement the touch-screen. If you’re doing significant changes to the code, you may consider using it as a starting point rather than 11d. Let me know if you’re interested and I’ll try to get it posted.

PurelyAbrasive commented 6 years ago

The screen I am using is an Adafruit 3.5" TFT display to be attached to an Adafruit Huzzah. Below is the link and I would love to see the new code with touch controls.

Screen: 3.5"TFT

Huzzah: Feather Huzzah

fowlerk commented 6 years ago

Sorry for the delay in getting the new version posted; I wanted to provide some additional info with an updated README and this took a bit of time. Here's the link to the new version FYI... https://github.com/fowlerk/ESP8266-Color-Weather-Station-Touchscreen-v15

Dancopy commented 5 years ago

Unfortunately this would involve quite a bit of reformatting work, as the current screen layout is packed with information, and each element is quite precisely positioned based on a portrait orientation. In addition to issuing the command for rotating the screen orientation, every screen element would need to be carefully repositioned.

BTW, this version is quite dated now...the version in this repository has MANY improvements: https://github.com/fowlerk/ESP8266-Color-Weather-Station-v11d. A little more involved to get it going, but I’ve included a quick start guide.

Additionally, I’ve been working for months on a version that supports the touch-screen version of the 240x320 LCD. It’s working quite well and includes even more enhancements, but I’ve not yet posted it. If you’re interested let me know and I’ll try to get it uploaded sometime in the near future.

Hi fowlerk, Could you please provide here the new 'touch-screen' version or, suddenly, a more up-to-date version? Also, do you have anything for 3.5 inch 480*320 screens ILI9488 (I have this screen but no Touch)?

PS. Another thing: Weather Underground no longer provides free API Keys. Am I right? Any solution? Thanks

fowlerk commented 5 years ago

@Dancopy ... sorry for the delayed response. This version of my code is quite old now and I consider it deprecated, that is, I’ve not updated this version in quite some time. As you noted, Weather Underground no longer provides free API keys. Squix78 (ThingPulse) created a new version based on OpenWeatherMap as the provider last year, and I’ve merged his efforts with some of my features / enhancements here: https://github.com/fowlerk/ESP8266-Color-Weather-Station-v17

I’m also continuing to tweak this version, though I’ve not posted any of my development versions in a while. I’ve made significant improvements in the error handling for failed data update attempts, and added a new library to pull moonrise / setting times, phase, etc., as this is no longer provided with the new OpenWeatherMap data source. This data is provided by the US Naval Astronomical Observatory.

The bad news is that the OWM data is MUCH pared down from what WU provides, and I’ve found it to not be particularly reliable. So, much of the nice features I’d incorporated in my earlier touch-screen versions were removed (e.g., weather alerts, daily detailed forecasts). I’m in the process of developing some new libraries based on the US NOAA weather data to replace OWM, but still have quite a bit of work to do on it. This won’t be particularly helpful if you’re not in areas covered by NOAA though.

Still, the current OWM version is better than nothing, so feel free to give it a try. More details on the data and some of my bug fixes to ThingPulse’s code is included in the README on the link provided above.

Dancopy commented 5 years ago

Hi fowlerk, Excellent project and, by the way: laborious! Now the WU has left something to be desired, but we can not do anything, can we? But, I'll try out your new v17 version which, sure, looks great. Thank you very much,

Daniel Fernandes