M5ez, a complete interface builder system for the M5Stack as an Arduino library. Extremely easy to use.
-
@janseta Thanks...
Some things are on my list:
- an inactivity timeout to power down if not using it
- backlight setting
Both would be stored in flash and settable from a settings menu that also incorporates the Wifi menu, so create a new linkable "Settings" menu a level higher. I guess I can also include an NTP clock, I'll see..
-
You can use nvs wrapper "preferences" for storing values that must survive reboot and even flashing: https://github.com/espressif/arduino-esp32/tree/master/libraries/Preferences
Also Arduino-esp32 provide an integrated NTP library: https://github.com/espressif/arduino-esp32/tree/master/libraries/ESP32/examples/Time -
@calin Hi Calin. I already use Preferences in the new wifi code to store the SSIDs and passwords and a general flag whether autoconnect is on. Thanks for the NTP pointer...
-
Just got my m5
I am novice on programming and got it working!
awesome..Also love the example file with the systeminfo,
i hope to make a mqtt remote out of it and this should make it possible for me!Also got a question/request: it is possible to make the menu rotating? so last one down, will be the 1st one up?
offtopic
some how the quarter just falls here, something with old phone booths and dtmf beepers. lol -
I am novice on programming and got it working!
awesome..Cool! People like you are why I wrote it: programming needs to be easy and fun so more people get into it!
Also love the example file with the systeminfo,
i hope to make a mqtt remote out of it and this should make it possible for me!mqtt looks cool! If you're going to use the FACES keyboard, you will probably need
ez.textBox
, which I have on the drawing board. It will allow for both entry and display of longer texts.Also got a question/request: it is possible to make the menu rotating? so last one down, will be the 1st one up?
I am currently testing features where you can replace up/left at the beginning or right/down at the end with a button name and caption of your choosing. Combined with the two new reserved button names 'first' and 'last', you can do that as well as lots of other clever tricks. (Like exit back out of a menu very easily, or make 2-D seeming menus by having the main image menu be horizontal and submenus (text or image) be vertical. So that's coming...
offtopic
some how the quarter just falls here, something with old phone booths and dtmf beepers. lol:)
-
@r_255 I just added the feature that allows menu rotation to the repository.
upOnFirst
anddownOnLast
properties can replace those navigation buttons with whatever you want. In fact, the main menu in the demo app now rotates, so you can see how it's done there, or in the README documentation for details.Also: I changed around how
MAIN_DECLARED
works in the examples: it is now defined astrue
orfalse
meaning you can just use its value from code instead of needing variables or#ifndef
lines. -
Omg, you have been busy... :)
I am not going to use the keyboard, even it looks nice...I need stuff ( remote ) to be plain simple as i have to deal with people that hold the mouse upside down.
so 3 buttons is more than enough ;) for this purpose.i am off to github doing some exercises and read some code.
big thanks and a huge smile !
-
Just released 1.0.0 as I think it's pretty stable. Also I applied to have M5ez included in the Arduino library manager.
-
I just released version 1.1.0 of M5ez. It adds
ez.textBox
to display or edit longer word-wrapped texts.ez.msgBox
now wraps and justifies, so you don't have to figure out how much fits on a line. And there's a dark theme added to the themes directory. -
@rop
Rop,
Great work. Professional appearance.
Can you offer any guidelines for preparing jpg images as a C array?
I’ve tried various on-line and command line converters but no image appears.
Thanks -
@bobolink I haven't tried to convert any images myself, I have just taken the ones from Calin's code. I have been busy getting the new version out. I'll have a look at possibly creating a tool (or even an online tool) for this.
-
Just released: version 1.2.0 of M5ez.
-
It adds the
ezProgressBar
class to (you guessed it) show a progress bar while also offering all the word-wrapping niceties ofez.msgBox
. -
ez.update
lets you specify an https URL to download a new binary from. And this wouldn't be M5ez if all of that wasn't extremely easy. the/tools
directory of the repository has a shell script that people here might find handy even if they don't use M5ez. (But why on earth would you not use M5ez? :) ) -
The script,
get_cert
, takes an https URL as an argument. It will follow any redirects, output the resulting "effective URL", get the certificate chain, take the last cert from that, and make an include file that holds the root cert, ready to be used in your sketch. Below is an example.
your_prompt$ ./get_cert https://github.com/ropg/M5ez/blob/master/compiled_binaries/M5ez-demo.bin?raw=true The effective download URL (after resolving forwards) is: https://raw.githubusercontent.com/ropg/M5ez/master/compiled_binaries/M5ez-demo.bin The root certificate include file is saved as: raw_githubusercontent_com.h
- and then that file would contain:
// This is the root certificate include file for raw.githubusercontent.com // as obtained by the get_cert script on: Wed Aug 15 21:34:20 CEST 2018 // // // Certificate info: // issuer= /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA // notAfter=Oct 22 12:00:00 2028 GMT // const char* root_cert = \ "-----BEGIN CERTIFICATE-----\n" \ "MIIEsTCCA5mgAwIBAgIQBOH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Y6aHR0cDovL2NybDQuZGlnaWNlcnQuY29t\n" \ "L0RpZ2lDZXJ0SGlnaEFzc3VyYW5jZUVWUm9vdENBLmNybDA9BgNVHSAENjA0MDIG\n" \ "BFUdIAAwKjAoBggrBgEFBQcCARYcaHR0cHM6Ly93d3cuZGlnaWNlcnQuY29tL0NQ\n" \ "UzAdBgNVHQ4EFgQUUWj/kK8CB3U8zNllZGKiErhZcjswHwYDVR0jBBgwFoAUsT7D\n" \ "aQP4v0cB1JgmGggC72NkK8MwDQYJKoZIhvcNAQELBQADggEBABiKlYkD5m3fXPwd\n" \ "aOpKj4PWUS+Na0QWnqxj9dJubISZi6qBcYRb7TROsLd5kinMLYBq8I4g4Xmk/gNH\n" \ "E+r1hspZcX30BJZr01lYPf7TMSVcGDiEo+afgv2MW5gxTs14nhr9hctJqvIni5ly\n" \ "/D6q1UEL2tU2ob8cbkdJf17ZSHwD2f2LSaCYJkJA69aSEaRkCldUxPUd1gJea6zu\n" \ "xICaEnL6VpPX/78whQYwvwt/Tv9XBZ0k7YXDK/umdaisLRbvfXknsuvCnQsH6qqF\n" \ "0wGjIChBWUMo0oHjqvbsezt3tkBigAVBRQHvFwY+3sAzm2fTYS5yh+Rp/BIAV0Ae\n" \ "cPUeybQ=\n" \ "-----END CERTIFICATE-----\n";
Does that make life super ez or what?
If you want, please check out the project github as well as the step-by-step description of how to use
get_cert
andez.update
. The OTA functionality is shown in the project demo app downloading via https from github and everything is documented rather nicely if I may say so myself. :) -
-
@rop 在 M5ez, a complete interface builder system for the M5Stack as an Arduino library. Extremely easy to use. 中说:
@bobolink I haven't tried to convert any images myself, I have just taken the ones from Calin's code. I have been busy getting the new version out. I'll have a look at possibly creating a tool (or even an online tool) for this.
Open the file on HexWorkshop -> CTRL+A -> Edit -> Copy As -> C Source
Open the header file -> Paste :) -
@bobolink There is now an
include_file
script (here) in the/tools
directory of the M5ez repository. If you get it, make it executable withchmod a+x include_file
and run it with a file as an argument, like:your_prompt$ ./include_file settings.jpg Converting input file: settings.jpg Creating include file: settings_jpg.h
That include file then contains:
#pragma once // // Include this file to use settings.jpg (1087 bytes) in your sketch. // // File created on Thu Aug 16 11:39:50 CEST 2018 // Made by the include_file script that is part of // "M5ez: the easiest way to program on M5Stack." // https://github.com/ropg/M5ez // const char settings_jpg[] PROGMEM = { 0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00, 0xff, 0xe1, 0x00, 0x8c, 0x45, 0x78, 0x69, 0x66, [...] snip [...] 0x35, 0xf4, 0x0a, 0x6e, 0x75, 0x6b, 0x92, 0xab, 0xf6, 0x8b, 0x8d, 0x91, 0x79, 0x3e, 0x50, 0x8e, 0x30, 0xbb, 0x49, 0x90, 0x03, 0xff, 0xd9 };
Once this file is included, you can then provide the
settings_jpg
as the first argument toez.addItem
if you are adding an item to an image menu. -
@rop Thank you. I’ll check it out.
I think this is HexWorkshop mentioned above. .EXE for Windows. -
Avesom work @Rop .
Still waiting for NTC/RTC time issue... ;-) -
@janseta I am loosely thinking about adding:
- NTP time and also an inactivity power-off
- A settings menu with
- link to the wifi menu
- NTP on/off, which server(s) and sync interval
- clock display in header on/off
- display backlight brightness
- FACES keyboard support on/off
- Setting up the M5Stack peripherals (which GPIOs etc)
But everything I add adds code size. So there probably there will be a few more code blocks like the present
#ifndef M5EZ_WITHOUT_WIFI
to allow people to not compile what they do not need.But before I get to this I need to figure out why the
.setTimeout
method does not seem to affect the https transfers for the firmware because they timeout way too often.Everyone: please feel free to suggest new features or tell me what you think about the proposed ones above.
-
@rop Finally got around to trying the image converter script--works great. Thanks again.
I have a windows 7 machine for HexWorkshop but ...I need to center the image I'm using but I should be able to figure that out.
Also, new a version of your library showed up in the Arduino-IDE library check! Automagically.
-
@bobolink As to centering the images: I can put it anywhere, but have no easy way (that is without linking in a ton of code) to figure out how high or how wide a jpg is. I could provide an image offset in x and y, but that would probably make most sense if it was settable per image. You could always just center them in Photoshop / Gimp / etc...
-
Hi @Rop
I wonder if you could help me.
I am really looking forward to using M5ez but unfortunately I'm having problems compiling the examples and I'm getting persistent errors relating to any instance of println
This is a snippet of the error messages
Arduino: 1.8.5 (Mac OS X), Board: "M5Stack-Core-ESP32, QIO, 80MHz, Minimal SPIFFS (Large APPS with OTA), 921600, Debug"
In file included from /Users//Documents/Arduino/libraries/M5ez/examples/M5ez-demo/M5ez-demo.ino:2:0:
/Users//Documents/Arduino/libraries/M5ez/src/M5ez.h:42:27: error: 'TFT_TRANSPARENT' was not declared in this scope
#define PRINT_DEFAULT_COL TFT_TRANSPARENT
^
/Users//Documents/Arduino/libraries/M5ez/src/M5ez.h:117:104: note: in expansion of macro 'PRINT_DEFAULT_COL'
void print(String text, int16_t x = -1, int16_t y = -1, const GFXfont* font = NULL, uint16_t color = PRINT_DEFAULT_COL);
^
/Users//Documents/Arduino/libraries/M5ez/src/M5ez.h:42:27: error: 'TFT_TRANSPARENT' was not declared in this scope
#define PRINT_DEFAULT_COL TFT_TRANSPARENT
^
/Users//Documents/Arduino/libraries/M5ez/src/M5ez.h:118:106: note: in expansion of macro 'PRINT_DEFAULT_COL'
void println(String text, int16_t x = -1, int16_t y = -1, const GFXfont* font = NULL, uint16_t color = PRINT_DEFAULT_COL);
^
/Users//Documents/Arduino/libraries/M5ez/examples/M5ez-demo/M5ez-demo.ino: In function 'void submenu_more()':
M5ez-demo:51: error: call to 'void M5ez::println(String, int16_t, int16_t, const GFXfont*, uint16_t)' uses the default argument for parameter 5, which is not yet defined
ez.println("");
^
M5ez-demo:52: error: call to 'void M5ez::println(String, int16_t, int16_t, const GFXfont*, uint16_t)' uses the default argument for parameter 5, which is not yet defined
ez.println("ezMenu menu("Main menu");");
^
M5ez-demo:53: error: call to 'void M5ez::println(String, int16_t, int16_t, const GFXfont*, uint16_t)' uses the default argument for parameter 5, which is not yet defined
ez.println("menu.addItem("Option 1");");
^
M5ez-demo:54: error: call to 'void M5ez::println(String, int16_t, int16_t, const GFXfont*, uint16_t)' uses the default argument for parameter 5, which is not yet defined
ez.println("menu.addItem("Option 2");");
^
M5ez-demo:55: error: call to 'void M5ez::println(String, int16_t, int16_t, const GFXfont*, uint16_t)' uses the default argument for parameter 5, which is not yet defined
ez.println("menu.addItem("Option 3");");
^
M5ez-demo:56: error: call to 'void M5ez::println(String, int16_t, int16_t, const GFXfont*, uint16_t)' uses the default argument for parameter 5, which is not yet defined
ez.println("while ( menu.run() ) {");
^
M5ez-demo:57: error: call to 'void M5ez::println(String, int16_t, int16_t, const GFXfont*, uint16_t)' uses the default argument for parameter 5, which is not yet defined
ez.println(" if (menu.pick == 1) {");
^<<<<AND SO ON WITH THE OTHER PRINTLN CALLS >>>>>>
Looks like I'm missing something from my environment but any ideas?
Many thanks