Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. lbuque
    • Continue chat with lbuque
    • Start new chat with lbuque
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups
    Save
    Saving

    lbuque

    @lbuque

    2
    Reputation
    10
    Posts
    339
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    lbuque Follow

    Posts made by lbuque

    • RE: Battery follow up in UI Flow2

      @csierra67 Python's API, blockl does not yet exist.

      import M5
      
      # Battery percentage
      M5.Power.getBatteryLevel()
      
      # set Charge Current
      M5.Power.setChargeCurrent()
      
      posted in UiFlow 2.0
      lbuque
    • RE: How can I specify a pair of SSID and PASSWORD with the WLAN STA connect block?

      @kotobuki 0_1699581290928_4d2fb044-3508-4d55-95f4-775381b2dea9-image.png After init, wifi sta needs to be activated.

      posted in UiFlow 2.0
      lbuque
    • RE: M5Dial mising nfc machine module...

      @mumin50 Yes, this feature is coming soon.

      posted in UiFlow 2.0
      lbuque
    • RE: Imu.getAccel() returns gyro values ???

      @Nestor89 It has been fixed.

      posted in UiFlow 2.0
      lbuque
    • RE: ADC Module not working in UIflow2 - [fixed]

      @smatlok @ajb2k3 There is an ADC class in the unit module, which is the abstract class of the ADC unit, and it conflicts with the class name of machine.ADC. It will be fixed in the next version.

      posted in UiFlow 2.0
      lbuque
    • RE: Bouncing Ball project Confusion.

      0_1691720861301_f2c9ee59-3979-43c4-bf3a-b859e1ebd82e-image.png

      posted in UiFlow 2.0
      lbuque
    • RE: function returning accel values of MPU6886 is buggy x and Z values are alwas identical

      @Nestor89 Thanks, you're right, it's a bug.

      posted in UiFlow 2.0
      lbuque
    • RE: How to scale with display.drawJpg?

      @HappyUser 0_1688716312291_95f5de28-9f95-4e3e-933b-5e031b1c1cd1-image.png

      posted in Modules
      lbuque
    • RE: Label Plus

      At present, the timing query is implemented through the soft timer, and only the last timer may take effect.

      posted in UiFlow 2.0
      lbuque
    • RE: Can't subscribe to MQTT topic

      @Oskars

      version: Alpha-17

      0_1687146705149_962d9af4-e8c5-4fd8-97bb-ee12201bde39-image.png

      import os, sys, io
      import M5
      from M5 import *
      from umqtt import *
      
      
      label0 = None
      label2 = None
      label1 = None
      label3 = None
      mqtt_client = None
      
      
      def mqtt_testtopic_event(data):
        global label0, label2, label1, label3, mqtt_client
        label0.setText(str(((str('Topic:') + str((data[0]))))))
        label1.setText(str(((data[1]).decode())))
      
      
      def mqtt_testtopic1_event(data):
        global label0, label2, label1, label3, mqtt_client
        label2.setText(str(((str('Topic:') + str((data[0]))))))
        label3.setText(str(((data[1]).decode())))
      
      
      def setup():
        global label0, label2, label1, label3, mqtt_client
      
        M5.begin()
        label0 = Widgets.Label("Text", 4, 3, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)
        label2 = Widgets.Label("Text", 4, 55, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)
        label1 = Widgets.Label("Text", 4, 29, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)
        label3 = Widgets.Label("Text", 3, 81, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)
      
        mqtt_client = MQTTClient('umqtt_client', '192.168.2.50', port=1883, user='m5stack', password='m5stack', keepalive=0)
        mqtt_client.connect(clean_session=True)
        mqtt_client.subscribe('testtopic', mqtt_testtopic_event, qos=0)
        mqtt_client.subscribe('testtopic1', mqtt_testtopic1_event, qos=0)
        label0.setFont(Widgets.FONTS.DejaVu12)
        label1.setFont(Widgets.FONTS.DejaVu12)
        label2.setFont(Widgets.FONTS.DejaVu12)
        label3.setFont(Widgets.FONTS.DejaVu12)
      
      
      def loop():
        global label0, label2, label1, label3, mqtt_client
        M5.update()
        mqtt_client.wait_msg()
      
      
      if __name__ == '__main__':
        try:
          setup()
          while True:
            loop()
        except (Exception, KeyboardInterrupt) as e:
          try:
            from utility import print_error_msg
            print_error_msg(e)
          except ImportError:
            print("please update to latest firmware")
      
      

      test_mqtt.m5f2

      {"version":"V2.0","type":"atoms3","components":[{"name":"screen","type":"screen","layer":0,"screenId":"","screenName":"","id":"__atoms3_screen","createTime":1681463262614,"x":0,"y":0,"width":280,"height":280,"backgroundColor":"#000","size":0},{"name":"label0","type":"label","layer":1,"screenId":"builtin","screenName":"","id":"v^k&_0&lzY#a-pVu","createTime":1681787932237,"x":4,"y":3,"color":"#ffffff","backgroundColor":"#222222","text":"Text","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0},{"name":"label1","type":"label","layer":2,"screenId":"builtin","screenName":"","id":"lg-u6bmP&KAb-BFg","createTime":1681787940036,"x":4,"y":29,"color":"#ffffff","backgroundColor":"#222222","text":"Text","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0},{"name":"label2","type":"label","layer":1,"screenId":"builtin","screenName":"","id":"m+Am3fMqYyQ$+VEm","createTime":1681788301006,"x":4,"y":55,"color":"#ffffff","backgroundColor":"#222222","text":"Text","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"width":37,"height":20},{"name":"label3","type":"label","layer":2,"screenId":"builtin","screenName":"","id":"fj^rW#mTo@K0dL5r","createTime":1681788303358,"x":3,"y":81,"color":"#ffffff","backgroundColor":"#222222","text":"Text","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"width":37,"height":20}],"resources":[{"software":["mqtt"]}],"units":[],"hats":[],"i2cs":[],"blockly":"<block type=\"basic_on_loop\" id=\"loop_block\" deletable=\"false\" x=\"490\" y=\"70\"><mutation isUpdate=\"true\"></mutation><field name=\"UPDATEOP\">true</field><statement name=\"FUNC\"><block type=\"system_m5_update\" id=\"system_m5_update\"><next><block type=\"mqtt_wait_msg\" id=\"T1rVj/Q%g){|@a=eic@f\"></block></next></block></statement></block><block type=\"basic_on_setup\" id=\"setup_block\" deletable=\"false\" x=\"130\" y=\"110\"><mutation isBegin=\"true\"></mutation><field name=\"UPDATEOP\">true</field><statement name=\"FUNC\"><block type=\"system_m5_begin\" id=\"system_m5_begin\"><next><block type=\"mqtt_set_client\" id=\"g+(|o=#m4jpn7OLPkw)J\"><value name=\"ID\"><shadow type=\"text\" id=\"?[M!b8*f#bx*SpMXH!!5\"><field name=\"TEXT\">umqtt_client</field></shadow></value><value name=\"SERVER\"><shadow type=\"text\" id=\"oNzSR(TF-,inxj~YS2}#\"><field name=\"TEXT\">192.168.2.76</field></shadow></value><value name=\"PORT\"><shadow type=\"math_number\" id=\"e~GXuZ!~qfASA;IYe3f=\"><mutation max=\"Infinity\" min=\"-Infinity\" precision=\"0\"></mutation><field name=\"NUM\">1883</field></shadow></value><value name=\"USER\"><shadow type=\"text\" id=\"3PbUi]|zTswyRzP*h=Zm\"><field name=\"TEXT\">m5stack</field></shadow></value><value name=\"PASSWORD\"><shadow type=\"text\" id=\"d.(iU%~um%@j5=N8C!9:\"><field name=\"TEXT\">m5stack</field></shadow></value><value name=\"KEEPALIVE\"><shadow type=\"math_slider\" id=\"4lCv3Yqkt^hJHwEHH,R)\"><mutation max=\"65535\" min=\"0\" step=\"1\" precision=\"1\"></mutation><field name=\"NUM\">0</field></shadow></value><next><block type=\"mqtt_connect\" id=\"N$GCr?UqrYp~!@[yZfZ~\"><field name=\"CLEAN\">True</field><next><block type=\"label_set_font\" id=\"sBjX6,JwP2hIWbkZU]#L\"><field name=\"NAME\">label0</field><field name=\"FONT\">Widgets.FONTS.DejaVu12</field><next><block type=\"label_set_font\" id=\"l{(uGTFfhsb)s(6iS/hU\"><field name=\"NAME\">label1</field><field name=\"FONT\">Widgets.FONTS.DejaVu12</field><next><block type=\"label_set_font\" id=\"Rn6r~[cLiSQf+]nM8sTq\"><field name=\"NAME\">label2</field><field name=\"FONT\">Widgets.FONTS.DejaVu12</field><next><block type=\"label_set_font\" id=\"oaK+AUCEaQtl@kR^|jP;\"><field name=\"NAME\">label3</field><field name=\"FONT\">Widgets.FONTS.DejaVu12</field></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type=\"mqtt_subscribe\" id=\"w7Ov@_:I,|/99:[91gQ+\" x=\"90\" y=\"570\"><value name=\"MSG\"><shadow type=\"text\" id=\"5+0D;yAI;M9Kab.KdV([\"><field name=\"TEXT\">testtopic</field></shadow></value><statement name=\"FUNC\"><block type=\"label_set_text\" id=\"qN{uc|lEU4,^0u_YYo@7\"><field name=\"NAME\">label0</field><value name=\"TEXT\"><shadow type=\"text\" id=\"5~k^hoGX6L}naX9o!pt=\"><field name=\"TEXT\">Label</field></shadow><block type=\"text_add_str\" id=\"tAsN]8zdz!{wa]J5fQRj\"><value name=\"VALUE1\"><shadow type=\"text\" id=\"NTGIBKM?0;M)9Q$?/F/E\"><field name=\"TEXT\">Topic:</field></shadow></value><value name=\"VALUE2\"><block type=\"mqtt_get_topic\" id=\"O)j9sIdBDlw?k(Y4#E{]\"></block></value></block></value><next><block type=\"label_set_text\" id=\"AIj|L5*V}(Na=i~]!Wr{\"><field name=\"NAME\">label1</field><value name=\"TEXT\"><shadow type=\"text\" id=\"9gNvISVfV@]35[tz`S6-\" disabled=\"true\"><field name=\"TEXT\">Label</field></shadow><block type=\"text_decode_str\" id=\"}[Ilzb9o=Qd12AOz*Q/k\"><value name=\"VALUE\"><block type=\"mqtt_get_msg\" id=\"p48aW7MN4QcC/]H_RqLv\"></block></value></block></value></block></next></block></statement></block><block type=\"mqtt_subscribe\" id=\":g;Bc#f6bCJv3D=P,C24\" x=\"690\" y=\"550\"><value name=\"MSG\"><shadow type=\"text\" id=\"p!BP(rRWfzb8%w2;)|Z/\"><field name=\"TEXT\">testtopic1</field></shadow></value><statement name=\"FUNC\"><block type=\"label_set_text\" id=\"+{@FB5tyv:a,[(0)S^?^\"><field name=\"NAME\">label2</field><value name=\"TEXT\"><shadow type=\"text\" id=\"5~k^hoGX6L}naX9o!pt=\"><field name=\"TEXT\">Label</field></shadow><block type=\"text_add_str\" id=\"MOXaUlFRx59,!q}DPD;6\"><value name=\"VALUE1\"><shadow type=\"text\" id=\"ABnF09VK)vlEkGQ|B9P*\"><field name=\"TEXT\">Topic:</field></shadow></value><value name=\"VALUE2\"><block type=\"mqtt_get_topic\" id=\"3w2H7IRX7ZEIXgo$ZPFE\"></block></value></block></value><next><block type=\"label_set_text\" id=\"sAd`+qhCgZXd{Kt,+h$r\"><field name=\"NAME\">label3</field><value name=\"TEXT\"><shadow type=\"text\" id=\"9gNvISVfV@]35[tz`S6-\" disabled=\"true\"><field name=\"TEXT\">Label</field></shadow><block type=\"text_decode_str\" id=\"(3lEfMbcJYt7tw_fl=%3\"><value name=\"VALUE\"><block type=\"mqtt_get_msg\" id=\"YAAO(q1I]VjM1vGhYh2R\"></block></value></block></value></block></next></block></statement></block>","screen":[{"simulationName":"Built-in","type":"builtin","width":128,"height":128,"scale":1.3,"screenName":"","blockId":"","id":"builtin","createTime":1681463262611}]}
      
      posted in UiFlow 2.0
      lbuque