M5paper interface panel

That’s the new normal behavior. Before, there were all drawn in buffer before the buffer was pushed to the screen. Now they’re pushed on screen one by one. And system information is displayed before drawing button. From a user experience this may seem slower, but the drawing routines are the same and there is no much performance difference.

Icons were 48 pixels png with a x2 zoom factor. I switched to 96px icon with no zoom. You have to upload filesystem with new the 96px icons.

The item type of the button must be “Switch”.
To check this, open http://<OPENHAB_HOST>:8080/rest/sitemaps/m5panel with Firefox and check item\type of the relevant button :
image

Could you please post serial monitor output when you touch a button ?

I’ll upload the new filesystem soon and try again.

My sitemap has always been set as a Switch type (on switchable items of course), so not sure what’s wrong there:

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

OK, spiffs filesystem updated and icons are looking correct again.

Touch display still not working.

Please post your serial monitor output when you touch a button.
It should look like this :

DEBUG (function loop): Widget touched: 3
DEBUG (function loop): Touched values: AqaraPlug01Power, ON
DEBUG (function loop): POST values: AqaraPlug01Power, ON
[D][HTTPClient.cpp:276] beginInternal(): host: nas.pawelko.local port: 8080 url: /rest/items/AqaraPlug01Power
[D][HTTPClient.cpp:1025] connect():  connected to nas.pawelko.local:8080
[D][HTTPClient.cpp:1158] handleHeaderResponse(): code: 200
DEBUG (function parseSubscriptionData): Data Widget (subscription)
Update Item 3 label=Lampe state=OFF
Draw stats (ms): title=7 icon=302 bottom=2 canvas=141
DEBUG (function loop): Widget touched: 2
DEBUG (function loop): Touched values: Bedroom_LampSw, OFF
DEBUG (function loop): POST values: Bedroom_LampSw, OFF
[D][HTTPClient.cpp:276] beginInternal(): host: 192.168.xxx.xxx port: 8xxx url: /rest/items/Bedroom_LampSw
[D][HTTPClient.cpp:1025] connect():  connected to 192.168.xxx.xxx:8xxx
[D][HTTPClient.cpp:1158] handleHeaderResponse(): code: 415
DEBUG (function parseSubscriptionData): Subscription Alive

EDIT: Http response code 415 is “Unsupported Media Type”, OH3 openhab.log confirms this:

2021-01-30 18:40:04.725 [ERROR] [rg.apache.cxf.jaxrs.utils.JAXRSUtils] - No message body reader has been found for class java.lang.String, ContentType: application/octet-stream
2021-01-30 18:40:04.726 [WARN ] [s.impl.WebApplicationExceptionMapper] - javax.ws.rs.WebApplicationException: HTTP 415 Unsupported Media Type
        at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(JAXRSUtils.java:1382)
        at org.apache.cxf.jaxrs.utils.JAXRSUtils.processRequestBodyParameter(JAXRSUtils.java:877)
        at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:822)
        at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:214)
        at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:78)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
        at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267)
        at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
        at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:216)
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:301)
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:220)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:276)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:852)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:544)
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:536)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1581)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1307)
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:482)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1549)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1204)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
        at org.eclipse.jetty.server.Server.handle(Server.java:494)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:374)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:268)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
        at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:367)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918)
        at java.base/java.lang.Thread.run(Thread.java:834)

Found this post on Unsuported Media Type errors, not sure if it’s helpful for you or not.

It’s useful. I’m testing on openHAB 2.5 and incompatibility with OH3 was a possible cause.
I just added the headers, but not tested on OH3.

1 Like

Yeah, I’m on 3.0.1, I’ll try it again now and get back.

Sorry to say I’m getting the same result, http 415 errors in serial monitor and logs.

Got it, have to swap these two lines around, “begin” before “addHeader”.

From:

    httpPost.addHeader(F("Content-Type"),F("text/plain"));
    httpPost.begin(restUrl + "/items/" + itemName);

To:

    httpPost.begin(restUrl + "/items/" + itemName);
    httpPost.addHeader(F("Content-Type"),F("text/plain"));

This is now my serial monitor output:

DEBUG (function loop): Widget touched: 2
DEBUG (function loop): Touched values: Bedroom_LampSw, OFF
DEBUG (function loop): POST values: Bedroom_LampSw, OFF
[D][HTTPClient.cpp:276] beginInternal(): host: 192.168.xxx.xxx port: 8xxx url: /rest/items/Bedroom_LampSw
[D][HTTPClient.cpp:1025] connect():  connected to 192.168.xxx.xxx:xxx
[D][HTTPClient.cpp:1158] handleHeaderResponse(): code: 200
DEBUG (function parseSubscriptionData): Data Widget (subscription)
Update Item 2 label=Bedroom Lamp state=ON
Draw stats (ms): title=8 icon=309 bottom=2 canvas=61
DEBUG (function parseSubscriptionData): Data Widget (subscription)
Update Item 2 label=Bedroom Lamp state=OFF
Draw stats (ms): title=8 icon=65 bottom=2 canvas=373

1 Like

I’ve corrected the code, thanks.
Touch is now working for you ?

Yes, it’s working great, cheers.

LittleFS addition is fantastic Cyril, much, much faster to load, well done.

Cyril, I don’t understand latest GH commit. Clear widgets if less than 6, does that mean we have to have 6 widgets on each screen? And does widgets = buttons?

@rastus_rob : yes widgets = buttons.
It’s simply a fix for the case you have less “widgets” (or “buttons”) when you update your sitemap (for example if you comment an item). In this particular case, the last widgets was still displayed. Now it’s correctly cleared.

1 Like

That sounds logical, I will try it tonight, thanks for the explanation.

Tried latest version, timezone is showing UTC(GMT), how to set it to local time/timezone?

EDIT: I tried settings in “/etc/openhab/services/runtime.cfg” by adding:

org.openhab.i18n:timezone=Australia/Lindeman

but it made no difference.

Also enable the “EXTRA_JAVA_OPTS” in “/etc/default/openhab”:

EXTRA_JAVA_OPTS="-Duser.timezone=Australia/Lindeman"

It gets the timezone from openhab configuration.

In paperui :

You need to restart m5panel afterwards.
You should see in serial monitor :

WiFi connected
IP address:
192.168.x.x
DEBUG (function httpRequest): HTTP request to http://nas.pawelko.local:8080/rest/services/org.eclipse.smarthome.i18n/config
[D][HTTPClient.cpp:276] beginInternal(): host: nas.pawelko.local port: 8080 url: /rest/services/org.eclipse.smarthome.i18n/config
[D][HTTPClient.cpp:1025] connect():  connected to nas.pawelko.local:8080
[D][HTTPClient.cpp:1158] handleHeaderResponse(): code: 200
....
DEBUG (function httpRequest): HTTP request done
DEBUG (function setTimeZone): OpenHAB timezone= Europe/Paris

Openhab 3 doesn’t have PaperUI. And I never use a UI to configure my openhab setup anyway, always use text based config files.

In openhab.log it says the timezone is configured:

2021-02-05 16:55:08.488 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'Australia/Lindeman'.

See what might be the problem from serial monitor:

DEBUG (function httpRequest): HTTP request to http://192.168.0.10:8383/rest/services/org.eclipse.smarthome.i18n/config
[D][HTTPClient.cpp:276] beginInternal(): host: 192.168.xxx.xxx port: xxxx url: /rest/services/org.eclipse.smarthome.i18n/config

OH3 doesn’t use the “org.eclipse.smarthome” namespace any more, it’s now “org.openhab”

I’ve added the old format to /etc/openhab/services/runtime.cfg now, will restart and see what happens.

OK thanks for the feedback.
I have to turn on my test OH3 and see what really happens.