M5paper interface panel

Just uploaded the latest and the fonts are way too big, even though I made these changes in main.cpp nothing changed:

//#define FONT_SIZE_LABEL         32 //30
//#define FONT_SIZE_STATUS_CENTER 48
//#define FONT_SIZE_STATUS_BOTTOM 32
#define FONT_SIZE_LABEL         14 //30
#define FONT_SIZE_STATUS_CENTER 20
#define FONT_SIZE_STATUS_BOTTOM 14

Here is the sitemap I’m using, it corresponds with the same entries used for basicui, it’s called m5panel.sitemap in the normal sitemap directory:

sitemap m5panel label="m5panel" {
        Switch  item=sonoff_s26_0       label="Fuji Printer"            icon="power-socket-eu"
        Switch  item=sonoff_s26_1       label="Bedside Plug"            icon="power-socket-eu"
        Switch  item=Bedroom_LampSw     label="Bedroom Lamp"            icon="light"
        Switch  item=Bedroom_LightSw    label="Bedroom Light"           icon="light"
        Text    item=inTemp             label="Inside Temp [%s °C]"     icon="temperature"
        Text    item=inHum              label="Inside Humidity [%s %%]" icon="temperature"
}

Also the WiFi.config is slightly wrong:

/* Uncomment for static IP
    IPAddress ip(192,168,0,xxx);    // Node Static IP
    IPAddress gateway(192,168,0,xxx); // Network Gateway (usually Router IP)
    IPAddress subnet(255,255,255,0);  // Subnet Mask
    IPAddress dns1(xxx,xxx,xxx,xxx);    // DNS1 IP
    IPAddress dns2(xxx,xxx,xxx,xxx);    // DNS2 IP
    WiFi.config(staticIP, subnet, gateway, dns);
*/
    IPAddress ip(xxx.xxx.xxx.xxx);    // Node Static IP
    IPAddress gateway(xxx.xxx.xxx.xxx); // Network Gateway (usually Router IP)
    IPAddress subnet(255,255,255,0);  // Subnet Mask
    IPAddress dns1(xxx,xxx.xxx,xxx);    // DNS1 IP
    IPAddress dns2(xxx.xxx.xxx.xxx);    // DNS2 IP
    WiFi.config(ip, gateway, subnet, dns1, dns2);

Hope this is helpful information for you @cyrilpawelko .

EDIT: oh, and the icons aren’t showing up.

Hello @rastus_rob

I’ve corrected this line.

Icons and the new font are read from spiffs.
You have to build and upload the filesystem from platformio menu.
In this case, it’s reverting to the default (and ugly) font.
I’ll also add some check code for this.

Thanks for your feedback.
I’m currently working on a more complete iconset.

1 Like

I’ve just uploaded a more complete icon set

1 Like

I’m using PlatformIO through Atom editor, I can’t see a way to build/upload the filesystem, what am I missing?

I found a method from the command line by changing to root directory of project, then run “pio run -t uploadfs”. Works fine, spent over an hour looking for it in the UI, still couldn’t find it there.

So it’s working for you ?
What about the new design and icons ?

1 Like

Yes it’s working well though I do have to restart OH3 for sitemap changes to take effect, kind of strange, changes to the BasicUI sitemap are reflected automatically without a restart. Maybe something to do with the REST api.

Looking good, the icons are really building up, you must’ve been busy, very much appreciated.

I just changed to font to a more readable one.
Could you please upload a photo ?

Now I’m going to work on code refactoring to have something more modern that could easily be extended, and then on dynamic updates.
So there will not have visual changes soon.

Here’s my latest look, though I’m still using the old font ‘GenSenRounded-R.ttf’, haven’t caught up with the font change yet.

OK, got one with the new font now, it is much clearer. Can I change the size in ‘main.cpp’? Some of the labels are starting to stray outside the button. Oh yeah, noticed they all align left now, nice touch.

PS: sorry about the skewed images, I line it up on the mobile phone camera and it looks right, but never comes out properly.

Of course, but I didn’t check if all sizes are supported.
Check the messages on the serial console, there should be an error in this case.

Yes, I plan to add some information on the right : time, uptime, and probably buttons and/or tabs for page navigation …

1 Like

It scales well, here are my current settings (original sizes commented):

//#define FONT_SIZE_LABEL         32 //30
//#define FONT_SIZE_STATUS_CENTER 56
//#define FONT_SIZE_STATUS_BOTTOM 32
#define FONT_SIZE_LABEL         26
#define FONT_SIZE_STATUS_CENTER 46
#define FONT_SIZE_STATUS_BOTTOM 36

I tried the BOTTOM font larger but then it starts to clip the button frame.

Thanks for your feedback.
Our needs are not the same, so the font size should definitely be user-configurable.

Here’s my actual setup :

Anybody else tried it ? Every feedback is welcome

2 Likes

Like the little sysinfo panel in the bottom right, very handy.

Hi everyone,

m5panel now supports dynamic updates : items and sitemaps changes are instantly updated.
Next objective : touch support :slight_smile:

2 Likes

Tried both versions from yesterday, the first ver was slow to initialize the buttons, the second ver seemed quicker but still a lag was happening. This is just the first rendering of the buttons, after that the item state updates were quite snappy, very impressive, great work @cyrilpawelko.

Yes, it’s due to font not being cached at the beginning. That’s also it’s faster after a few seconds.
I should also try to cache icons…

BTW : touch support is here !
You can now control switch items (switch, light, …) by touching them.

2 Likes

No, I know of the font caching, it’s not that. I’m used to waiting for the font to cache, but the buttons would then pop up at the same time. I meant the buttons were slowly appearing one by one, not together like in the past.

Can’t wait to try out the touch, as soon as I get time I’ll try it.

A few things about latest sources Cyril:

  • the buttons are still loading one at a time, slowly
  • the icons have become much smaller and off centre
  • touch panel operation not working


PS: sorry for poor image.