M5paper interface panel

Well, no, it’s still rather messy and buggy.
I’ll publish some code soon…

Hi,

You’ll find a first basic-but-working release here :

Contributions welcome :slight_smile:

2 Likes

Great work @cyrilpawelko, will there be an example ‘defs.h’ file, and can it cater for Static IP Address?

Oops, I forgot defs.h :slight_smile: . It’s now uploaded.

For static IP, you can try WiFi.config(staticIP, subnet, gateway, dns); right after M5.begin();
I will test and add it to the code.

1 Like

Thanks, got it to build/upload and run fine.

I did have to make a few changes though, added StaticIP info just under includes in “main.cpp”:

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

Then for the WiFi.config line used:

   WiFi.config(ip, gateway, subnet, dns1, dns2);

There was a few slight problems though.

I couln’t use an SSL (HTTPS) connection to OH, only plain HTTP.

And some Labels are too long for the button, if the Label could be redefined in “defs.h” or could wrap somehow.

BTW: Would you prefer suggestions or problems here, or as issues on GitHub.

Thanks.
I plan to include WifiManager for configuration of network and other settings.

For the label / buttons configuration, I’m still looking for a clean way of doing.
I’d like to avoid another configuration menu while still allowing customization.
I’m considering to use a sitemap, but this still has to be tested.

And, yes, for bugs I prefer github issues.

1 Like

WifiManager wouldn’t work for me, my password is 63 characters long, upper and lower case, numbers and some symbols, so entering that manually would be a nightmare. But it’s easy to edit source anyway.

Using a custom Sitemap might be cool, I do all my OH config in text files anyway, so not a stretch.

No probs, will use GitHub issues to raise any bugs or feature comments/requests in future.

@rastus_rob
To be clear about github, it’s made for precise issues or requests.
You’re of course welcome to continue this thread for more open discussions.

1 Like

Hi everyone,

I’m making some progress.
I’ve struggled with Autoconnect, but was not satisfied. I’m sticking to manual network configuration for now.
There are, however, some improvements:

  • Nicer font with accents support
  • Buttons configuration is done trought a dedicated sitemap

I’m now working on icons.

Hello all very interesting development going on here. What kind of battery life are you getting out of this device? Or is the testing too intensive to really guess at that?

I tested several weeks ago, I had about 3 hours battery, without optimization.
I don’t plan to have it work on battery, since it should support dynamic updates and, indeed, always be connected to wifi (not to speak of touch support).

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.