Ardiuno/esp TFT mqtt display

well the 7" screen came in - the driver for it has some nice functionality, if but a little broken here and there i have to sort that out… but here a preliminary view of the it… the company sort of misinformed me on the compatibility towards esp… but it works fine with a ardiuno based board … but no a real issue as i can use a esptoy and plug it directly in the power out put of the arduino board 5V rail to handle the mqtt and pass it too the arduino. but to compensate I bought a couple wemos D3s (which is a mega board and esp8266 combined together …) but for now I just tandem the mega and esp for now as shown until the wemos d3 arrive … Once I sort ot the driver and current graphing issues I will post driver and sketch for graphing mqtt streams and that driver and sketch should be good for all RA8875 screens which should be by the end of this week I hope –

.

okay for those who may want it a unified sketch to drive RA8875 ( 4" - 9" screens) to draw graphs based on MQTT inputs. you can draw horizontal & Vertical bars, Graphs , radial meters and Pie charts. it can handle up to 20 mqtt inputs though I have commented out them you just have to enable the topic names that you want to use… it still needs a little more work on the radial Meter to display a bit more gracefully on large number changes, and the pie chart miss reads for some reason when using 3 inputs I have to sort that out. but first I need to build another emontx shield to monitor the Diverter as all my other CT’s are in use I was using a fixed number for testing for now…

( stuck the LCD and Arduino(& esp) in an old digital picture display)

sketches can be found at Github – GitHub - krywenko/RA8875_graphing: Graphing Mqtt with RA8875 Screen

okay good luck have fun

update - the pie chart works fine now for multiple inputs - (my mistake was i was dividing my value by zero- whereas i should of being dividing zero by my value )

2 Likes

looks great! thanks for sharing the code too!

Your welcome- always found it a bit perturbing that people would post their stuff, displaying it functionality but refuse to share the code to make it easier and better going forward. that the the point of opensource it speeds up development much faster then just doing it on your own… and hence why I am always willing to share my code

3 Likes

okay i believe this should be the final update to this RA8875 touch screen. every thing working well. i have not encountered any bugging out in the last few days of running - I incorporated weather under ground into it for the forecast module . i also enabled the touch screen. and where the radial meter exist or should exist there is a hidden screen button. just touch the screen and it will bring up your next set of radial meter – the new sketch s for touch and weather is found on the above github link… there should be enough examples with in the sketches that one should be able to build whatever graphical interface they would like

okay good luck have fun…

1 Like

was not planning to update this so soon, but it is cold and windy outside so i updated for Two way communication . multiple displays windows and multiple graph options. now divided into 3 quadrants the top bar for meter and informational display - 6 panel option, left hand quadrant for information and MQTT switch control ( ie thermostatic control)- 4 panels option . And Right hand Quadrant for graphing differing inputs, ie solar/grid production comparison, outside temperature, solar and Diverter usage. also 4 different panels


for example the displayed Thermostat if you touch the left hand side of the meter the temperature goes down if you touch the right hand side the temperature goes up they will send a command via mqtt to the thermostatic relay and when the thermostatic relay response to the sent string the green number will display the change in preset temperature

the other one is displaying the forecast weather if you touch the far right hand side of the top bar it diaplays the weather forecast for the day
If I knew if wunderground alerts worked in my area I would add in an automatic weather warning screen… but when I call for it I get blank info so i am not certain it works in my area

to change left hand side display touch the bottom of the screen to display other optional screens
to change the right hand side touch the right hand side near the bottom to display it optional screens

now thinking I should of got the 9’’ display as i want to build it into my wall to be a whole house display center for all information

see github for sketches for 2way communication options :slight_smile:

okay good luck have fun

1 Like

I thought maybe some would be interested of it in action, as i got my wemos R3 and set it up to monitor divert usage and heat pump and couple other devices… my all in one sketch for diversion and grid monitoring work pretty well as you can see from the video as it keep it well within an average of 20 watts or less it will hit a little above 20 watts but you have more under 20 then over 20 … ( it using a bubble search to determine the proper pwm , to bad I can not set the UNo to drive it at 13 mhz then it would be even more accurate as i found out with the ESp driving a SSR at 13mhz pwm you can achieve very good accuracy on 60hz grid … though you can use divisions of 13 but it not nearly as accurate as 13 mhz itself )

1 Like

if anyone interested
I updated my RA8875 energy monitor display. it still does the same as before but I added in extra functionality

Displays information directly from my weewx compatible device ie: Acurite 7in1 via MQTT sends from weewx

Display information from Mycroft AI remote info screen and EVCAN alert-Skilll

DSC05295

1 Like

I should of mentioned while it does use the Canadian EVCAN for Canadain weather alert updates on mycroft AI … you could use my metro Alert skill for European weather alerts on mycroft AI and send the warning to the screen in any European Language

Hello Stephen,

Which one is yours? :slight_smile:
https://www.buydisplay.com/catalogsearch/result/?q=RA8875+

I use a wemos mega r3 to drive it

oh and by the way my evcan/metro weather skills do not particularly need mycroft AI to operate they work as a simple background program running every 10 minutes getting weather data and publishing them to the screen that can run from any pi device

Hi,

if I purchase the two boards above and I publish the MQTT feeds from my EmonPi will it work with the setup code you have kindly published (with some tiny mods maybe)

Thanks

John

yes no problem
either edit what your emonpi publishes or edit mqtt_esp8266_2Way_com_AI_WEEWX_ENERGY_monitor.ino to look for how ever you want to publish your info - it basically just looking for single inputs but you could modify to parse json string but for json strings i find it easier just to make a translator that watches mqtt and when the json is published it translates and then publishes the data in single mqtt data points. that way if the json string changes format it easier to change the bash script on the pi then changing esp translation

it has alot of pages but if you are only interested primary display as shown above just edit -( I also disabled the touch in the sketch I uploaded just enable if you want all the other screens and graphs)

String input1 = "/energy/invert";
String input2 = "weather/outTemp_C";
String input3 = "weather/outHumidity";
String input4 = "/wind"; ##  is my invereter input  as it was made backwards compatible 
String input5 = "/grid"; 
String input6 = "/energy/divert";
.
.
.
#weemw
String input37 = "weather/barometer_mbar";
String input38 = "weather/dewpoint_C";
String input39 = "weather/heatindex_C";
String input40 = "weather/windchill_C";
String input41 = "weather/humidex_C";
String input42 = "weather/pressure_mbar";
String input43 = "weather/windSpeed_kph";
#mycroft and evcan/metro skill
String input44 = "/ai/time";
String input45 = "/ai/offlight";
String input46 = "/ai/onlight";
String input47 = "/ai/station";
String input48 = "/ai/artist";
String input49 = "/ai/song";
String input50 = "/ai/clear";

Thanks, will give it a go :slight_smile:

John

@stephen

I now have all the parts and managed (by fluke I suspect) to get the wemos mega r3 to connect to my WiFi as a test. I then tried to use your Meter_ring_1_espmqtt-test.ino This connects OK to my WiFi but nothing is displayed on the screen. I suspect I am doing something wrong. There is a set of DIP switches on the wemos board and I have no idea how I should set them. does the script get uploaded to the ESP8266 bit (this is what I did to test the WiFi) or does it get uploaded to the 2560 side? As you can tell I am totally new to this type of programming, though I have done other types. If it is not too much trouble could you give me an idiots set of instructions to get this to work. The reason I used the above ino was that it looked the way I wanted and did not have the weather bit which I did not really want :slight_smile: I am using a 12V feed into the wemos board I assume that is all that is needed it can supply 2A . At the moment I get nothing on the screen, it does not even look like it is lighting up Thanks for any help

John

which lcd are you using ra8875 or the smaller ILI9341

the ino you mentioned is for the smaller ILI9341. But I assumed from the previous post you were referring to RA8875
RA8875 libary - should be configured properly for the board type
ra8875.zip (435.1 KB)

if using RA8875 I would just try one of the sample sketches first… loaded it to the mega to see if it works with your board and if it does then progress farther otherwise you might have to change some setting for your board ( but I do not think so the ra8875 has changeable setting other then the touch screen-- but the ILI9341 does if using this board )

ra8875
there are two sketches one for the mega and one for the esp
esp set jumper 5,6,7 to on flash the rest off , then flash the uno set jumper 3,4 to on and the rest off… once done set 1,2 to on and the rest off…
here an example of how to flash the wemos r3
the sketch you mention is connected directly to an esp no wemos r3 required ( but i used mostly wemos r2 it is purely an esp board compared to the mega/esp board of the wemos r3 )

this is the sketches for the RA8875

Stephen,

Thanks for your help, was just the little bit of info that I needed. Have now managed to get it all working, though still tinkering to get it just the way I wanted. For anyone else trying to connect to the MQTT service on the EmonPi you need to alter the connection parameters to include the username and password for the service. Just got to find a nice case now :slight_smile:

John

1 Like

Glad you got it working and when you are done all your tinkering , I would be curious in seeing the end display. ( and if you want post the ino’s so others can take advantage from your experience )

for me as a display case i used an old digital picture frame that it fit into nicely

Have finally got to the point where I have the display working as close as I want for now :slight_smile:
I am sure that I will still do some more tinkering but it is OK for now.
I face created a repository if anyone else wants to use what I have done feel free

John

1 Like

Finally got round to dropping by my friend who is a wiz with wood and we made a great box to house the display :slight_smile:

John