Navigation

    M5Stack Community

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

    Josef

    @Josef

    1
    Reputation
    4
    Posts
    999
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Josef Follow

    Posts made by Josef

    • RE: Pure Micro Python without Ui-Flow on my M5Stack core2

      @favnec5 Here is another Micropython port for the Core2. Already thried that with my core2: https://github.com/thuehlinger/micropython-core2

      Another note: you do not need to use another firmware, you can use Micropython directly by just not using uiflow. See my repo https://github.com/hjgode/m5home within the lv dir: lv_test.py
      Be warned, the LV Binding is not very well documented and often only links to the C API.

      posted in Micropython
      J
      Josef
    • No national character support in M5Label (Micropython)?

      I have done a nice info panel using MQTT. As I am in Germany, I also get german umlauts (äöüßÄÖÜ) in MQTT payloads. But these will display without the umlauts in M5Label, so instead of 'fällt' I get 'fllt' or for 'bewölkt' I get 'bewlkt'.
      If I use rshell or similar to connect to the Core2, I can print umlauts in the Console (ie print('bewölkt')) and I verified the MQTT payload content prints correctly in the console. Just M5Label does not show the umlauts. The MQTT payload is encoded as utf-8.

      What is wrong?

      posted in Core 2
      J
      Josef
    • RE: [UiFlow] The ability to display multiple "screens" or "cards"

      @pumpkinetcher

      see https://github.com/hjgode/m5home main.py

      posted in Features Wish List
      J
      Josef
    • RE: [UiFlow] The ability to display multiple "screens" or "cards"

      @pumpkinetcher

      You can have multiple screens, for example in an array, and then switch the screens with screen.load_screen(screens[i])

      I use it like this

      screen = M5Screen()
      screen.clean_screen()
      screen.set_screen_bg_color(0xadefeb)
      screen.set_screen_brightness(60)
      #an array to store screens
      screens=[]

      now everything (M5Label etc) will be drawn on the current screen.
      I end the screen with
      screen0 = screen.get_act_screen()
      screens.append(screen0)

      then start a new screen with

      get a new screen

      screen1 = screen.get_new_screen()
      screen.load_screen(screen1)
      then end this screen and so on
      screen1 = screen.get_act_screen()
      screens.append(screen1)

      To switch the screen I use
      def getPrevScreen():
      global current_screen, screens
      lock_obj.acquire()
      print('getPrevScreen called')
      current_screen-=1
      if current_screen < 0 :
      current_screen=0
      else:
      screen.load_screen(screens[current_screen])
      lock_obj.release()
      pass
      def getNextScreen():
      global current_screen, screens
      lock_obj.acquire()
      print('getNextScreen called')
      current_screen+=1
      if current_screen > len(screens)-1 :
      current_screen=len(screens)-1
      else:
      screen.load_screen(screens[current_screen])
      lock_obj.release()
      pass
      these are called by
      def buttonA_wasPressed():

      global params

      do_beep()
      reset_idle_counter()
      print('ButtonA pressed')

      screen.clean_screen()

      screen.load_screen(screen0)

      screen.load_screen(screens[0])

      getPrevScreen()

      _thread.start_new_thread(getPrevScreen, ())
      pass
      btnA.wasPressed(buttonA_wasPressed)
      and
      def buttonC_wasPressed():
      do_beep()
      reset_idle_counter()
      print('ButtonC pressed')

      screen.clean_screen()

      screen.load_screen(screen2)

      getNextScreen()

      _thread.start_new_thread(getNextScreen, ())

      screen.clean_screen()

      screen.load_screen(screen1)

      screen.load_screen(screens[2])

      pass
      btnC.wasPressed(buttonC_wasPressed)

      The formatting here is terrible, as it reads # for markdown...

      I will put my code on github (hjgode) later on

      BTW: the UIFlow doc is a mess. They use // in fron of line for a python comment line (needs to be a # in front). And I am missing examples, examples....
      Still looking for a complete developer doc for the UIFlow micropython stuff. Some functions are named differently and some just do not work, if you try the micropython basic ones (like for example umqtt.simple, which just crashes as someone forget to implement socket.set_timeout)

      posted in Features Wish List
      J
      Josef