ESP32_Airplane_Banner

Place your projects here
Post Reply
User avatar
PeterN
Posts: 403
Joined: Mon Feb 08, 2021 7:56 pm
Location: Krefeld, Germany
Has thanked: 193 times
Been thanked: 225 times
Contact:

ESP32_Airplane_Banner

Post by PeterN »

If someone thinks I like clocks of all kinds ... he might be right :-)

A project with a dot matrix clock of CiccioCB for the ESP8266 with a MAX7219 display inspired me a little.
So I went back to my late childhood, spent a couple of hours gluing a model airplane together ... added some soldering work ... and ended up with this:

Image

The banner shows the time and some local online weather information from openweather.org and sits on a thin steel rod around which the second wire for the power supply runs.

I used an ESP32 for this - an ESP8266 will do the job as well.

Image

Image

The wiring should be clearly visible in the photo - but not so obvious: PIN23 is connected to the data (in) of the FIRST rightmost module.

Here is my ANNEX32-Code for my setup with ESP32 and 8*8x8-DotMatrix-modules:

Code: [Local Link Removed for Guests]

' BANNER-CLOCK-AND-LOCAL-WEATHER-INFO
'
'   ANNEX > V1.4 @ ESP32 or ESP8266
'   and a MAX7219 dot matrix module as a banner display
'
'   Toggles between time and weather information
'   8*(MAX7219-8x8-dot-matrix-displays)
'
'   Do not forget to set the time_zone/DST string at the config page 
'   e.g.for AMSTERDAM/BERLIN: CET-1CEST,M3.5.0,M10.5.0/3  
' DB9JG@me.com 03/2021

VERSION$    = "1.2"
GOSUB       INIT_GET_INET_WEATHER
onWgetAsync MAKE_WEATHER_STRING

GOSUB       INIT_DISPLAY
GOSUB       SHOW_IP

'set the 1st timer to display starting with time info
TO_BE_SHOWN$ = "TIME"
GOSUB       SET_TIMER_FOR_WEATHER_OR_TIME

'set 2nd timer to get weather info and display it each 60 seconds
TIMER1 60000, GET_INET_WEATHER
WAIT
end
'#########################################################################
'#########################################################################

SET_TIMER_FOR_WEATHER_OR_TIME:
'=========================================================================
if TO_BE_SHOWN$ = "WEATHER" then
  'Set fast refresh rate for one run of the scrolling weather message
  TIMER0 70, SHOW_WEATHER_RUNNING_TEXT
else
  'refresh the not scrolling time only once per second
  TIMER0 1000, SHOW_TIME
endif
RETURN
'#########################################################################

SHOW_TIME:
'=========================================================================
MAXSCROLL.PRINT " " + left$(TIME$, 8) + " "
MAXSCROLL.SHOW 60, BRIGHTNESS
RETURN
'#########################################################################

SHOW_WEATHER_RUNNING_TEXT:
'=========================================================================
'SHOWS THE COMPLETE WEATHER-STRING SCROLLING and switches then back to SHOW_TIME
MAXSCROLL.SCROLL BRIGHTNESS
MAXSCROLL.TEXT " " + left$(TIME$, 8) + " Uhr " + WEATHER$ 
SCROLL_COUNT = SCROLL_COUNT + 1
if SCROLL_COUNT <= ((len(WEATHER$)+20)*7) then
  TO_BE_SHOWN$ = "WEATHER"
else
  'Back to SHOW_TIME if weather message has been scrolled complete
  SCROLL_COUNT = 0
  TO_BE_SHOWN$ = "TIME"
  GOSUB SET_TIMER_FOR_WEATHER_OR_TIME
endif
RETURN
'#########################################################################

GET_INET_WEATHER:
'=========================================================================
wgetasync("api.openweathermap.org/data/2.5/weather?q=" + town$ + "&lang=" + language$ + "&units=" + Units$ + "&appid=" + Openweather_ID$, 80)
TO_BE_SHOWN$ = "WEATHER"
GOSUB SET_TIMER_FOR_WEATHER_OR_TIME
RETURN
'#########################################################################

MAKE_WEATHER_STRING:
'=========================================================================
a$       = WGETRESULT$
WEATHER$ = ""
WEATHER$ = WEATHER$  + json$(a$, "weather.temp") + chr$(248) + "C  "
WEATHER$ = WEATHER$  + json$(a$, "weather.pressure")+ "hPa  "  
WEATHER$ = WEATHER$  + json$(a$, "weather.humidity") + "% " 
WEATHER$ = WEATHER$  + json$(a$, "weather.description")
WEATHER$ = WEATHER$  + " in "+ TOWN$ +"             "
'convert some characters
WEATHER$ = REPLACE$(WEATHER$, "é", chr$(130))
WEATHER$ = REPLACE$(WEATHER$, "è", chr$(138))
WEATHER$ = REPLACE$(WEATHER$, "à", chr$(133))
WEATHER$ = REPLACE$(WEATHER$, "ö", "oe")
WEATHER$ = REPLACE$(WEATHER$, "Ö", "Oe")
WEATHER$ = REPLACE$(WEATHER$, "ü", "ue")
WEATHER$ = REPLACE$(WEATHER$, "Ü", "Ue")
WEATHER$ = REPLACE$(WEATHER$, "ä", "ae")
WEATHER$ = REPLACE$(WEATHER$, "Ä", "Ae")
WEATHER$ = REPLACE$(WEATHER$, "ß", "ss")
RETURN
'#########################################################################

SHOW_IP:
'=========================================================================
WHILE wifi.status <> 3
  PAUSE 500
  PRINT "No Internet access"
WEND
OPTION.NTPSYNC
MAXSCROLL.PRINT  right$(WORD$(IP$,1),15)& "   "
MAXSCROLL.SHOW 79, BRIGHTNESS
FOR i = 1 to 140
  MAXSCROLL.OSCILLATE BRIGHTNESS
  PAUSE 60
NEXT i
PAUSE 2000
RETURN
'#########################################################################

INIT_DISPLAY:
'=========================================================================
BRIGHTNESS   = 0
MAXSCROLL.SETUP 8, 15
MAXSCROLL.PRINT "LET's GO!"
MAXSCROLL.SHOW 64, BRIGHTNESS
PAUSE 1500
RETURN
'#########################################################################

INIT_GET_INET_WEATHER:
'=========================================================================
' >>>>>>>>>>>>>>>>>>>>> INSERT YOUR PERSONAL API-ID HERE<<<<<<<<<<<<<<<<<<<<<<
Openweather_ID$ = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
Town$           = "Krefeld,DE"
Language$       = "de"
Units$          = "metric"
WEATHER$        = ""
RETURN
'#########################################################################


Image

Should I ever suffer from boredom, I install a subminiature electric motor in the front of the aircraft so that the propeller can then get some pulse-width-modulated fuel from the ESP32 :-)
Last edited by PeterN on Mon Mar 15, 2021 12:19 pm, edited 1 time in total.
Zim
Posts: 296
Joined: Mon Feb 08, 2021 9:15 pm
Has thanked: 277 times
Been thanked: 131 times

Re: ESP32_Airplane_Banner

Post by Zim »

Another awesome project PeterN. Thanks for sharing!!!

Zim
Helmut_number_one
Posts: 122
Joined: Fri Dec 09, 2022 10:03 am
Has thanked: 54 times
Been thanked: 14 times

Re: ESP32_Airplane_Banner

Post by Helmut_number_one »

Hallo Peter,
ich habe Dein Projekt etwas umgeschrieben um die Daten eines Hoymiles Wechselrichtermit OpenDTU damit zu zeigen.
Kann mir jemand einen Tipp geben wie der ESP das Programm als Autostart ausführt?
Und noch 'ne dumme Frage ->Wo speichert der Editor die Daten ab?
https://youtu.be/lNdc_paJrcw
Hello Peter,
I rewritten your project a little bit to show the data of a Hoymile with OpenDTU inverter.
Can someone give me a tip , how the ESP runs the program as an autostart?
Where does the editor save the data?
Best regards, Helmut
Last edited by Helmut_number_one on Thu Oct 19, 2023 11:05 am, edited 1 time in total.
User avatar
PeterN
Posts: 403
Joined: Mon Feb 08, 2021 7:56 pm
Location: Krefeld, Germany
Has thanked: 193 times
Been thanked: 225 times
Contact:

Re: ESP32_Airplane_Banner

Post by PeterN »

Hallo Helmut

freut mich, dass der Code zu etwas nützlich ist:-)
Das autostart-Programm kannst du auf der /config Seite des Annex32 einstellen

I'm glad that the code is useful for something:-)
You can set the autostart program on the /config page of the Annex32
User avatar
PeterN
Posts: 403
Joined: Mon Feb 08, 2021 7:56 pm
Location: Krefeld, Germany
Has thanked: 193 times
Been thanked: 225 times
Contact:

Re: ESP32_Airplane_Banner

Post by PeterN »

sorry, I forgot to answer the second question.
Der Code wird vom Editor , soviel ich weiss, zunächst nur im Browser-cache gehalten und erst im Modul abgespeichert, wenn man das manuell startet. Das kann manchmal problematisch sein, weil im Cache noch etwas anderes steht als auf dem Modul
Erst das Einlesen eines bestehenden Programms aus dem ESP garantiert "echte" Daten :-)

As far as I know, the editor initially only keeps the code in the browser cache and only saves it in the module when you start that manually. This can sometimes be problematic because there might be something else in the cache than on the module.
Only reading an existing program from the ESP memory guarantees "real" data :-)
User avatar
Electroguard
Posts: 946
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 310 times
Been thanked: 352 times

Re: ESP32_Airplane_Banner

Post by Electroguard »

When you Save your chosen filename to the device, include the root prefix symbol /.
You can triple-click the filename in the Editor file save window to select it and copy it to the pasteboard,
Then paste in the filename to the Config Autorun File window.
Remember to update any saved Editor filename changes to the Config Autorun field and Save them, else it will keep autorunning the original filename.
filesave.jpg
autorun.jpg
You do not have the required permissions to view the files attached to this post.
Post Reply