Navigation

    M5Stack Community

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

    inasawa

    @inasawa

    0
    Reputation
    10
    Posts
    1085
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    inasawa Follow

    Posts made by inasawa

    • RE: Blynk in UIFlow

      Thank you, @IAMLIUBO
      I have confirmed that it works fine with MicroPython generated from Blynk Blockly.

      posted in UIFlow
      I
      inasawa
    • RE: M1 mac support?

      No driver needs to be installed on the M1 Mac. M5Stack Core2 connected to M1Macmini will look like this without a driver: I was able to burn UIFlow with M5Burner by specifying the device.

      % ls /dev/cu.usbserial-*
      /dev/cu.usbserial-XXXXXXXX
      
      posted in SOFTWARE
      I
      inasawa
    • RE: UIFlow doesn't start on new Core2

      After struggling for a while, I had this Core2 replaced at the shop where I bought it as an initial defect.
      I'm not sure, but it seems that the display mechanism in Arduino and the display mechanism in UIFlow are different, and even if Factory Test works normally, it may not work properly in UIFlow.

      posted in Core 2
      I
      inasawa
    • RE: UIFlow doesn't start on new Core2

      It seems that it was a short-lived joy. Revert to a black screen, distorted screen, or an upside-down screen.
      I tried v1.7.1.1, v1.7.1, v1.7.0, v1.6.6 and they are all the same and have a black screen.
      It's HW problem?

      0_1611197748884_IMG_5968.jpeg 0_1611195351484_IMG_5964.jpeg 0_1611195361024_IMG_5965.jpeg 0_1611195373828_IMG_5966.png

      Also, even in this situation with UIFlow is running, if I burn factory test firmware, it will work normally.

      0_1611197773876_IMG_5967.jpeg

      posted in Core 2
      I
      inasawa
    • RE: UIFlow doesn't start on new Core2

      I don't know what happened. Core2 that has not been displayed with UIFlow for 2 days since I bought it, suddenly, yes suddenly, when I reset Core2, something was displayed, and every time I reset it, the display was distorted or displayed upside down. After several resets, the display is now showing normally.

      I feel that there is an unstable part in the display-related HW. Firmware is UIFlow_Core2-v1.7.1.1-core2.bin.

      0_1611195881356_IMG_5962.jpeg

      posted in Core 2
      I
      inasawa
    • RE: UIFlow doesn't start on new Core2

      Since UIFlow display nothing on the screen, I tried the test with the ILI9341 library for MicroPython I found.
      https://github.com/tuupola/micropython-ili934x/blob/master/ili934x.py

      I copied the above library to Core2 and ran the following code from the serial console.

      import ili934x
      from machine import Pin, SPI
      spi = SPI(miso=Pin(38), mosi=Pin(23, Pin.OUT), sck=Pin(18, Pin.OUT))
      display = ili934x.ILI9341(spi, cs=Pin(5), dc=Pin(15), rst=Pin(4))
      display.fill(ili934x.color565(0xff, 0x11, 0x22))
      display.pixel(120, 160, 0)
      display.print('1234567890 ABCDEFGHIJKLMNOPQRSTUVWXYZ')
           :     :     :
      display.print('1234567890 ABCDEFGHIJKLMNOPQRSTUVWXYZ')
      

      As a result, the characters are displayed as shown in the image below.
      I'm not sure what this means, but can it help analyze the problem?

      0_1611195918774_IMG_5954.jpeg

      posted in Core 2
      I
      inasawa
    • RE: UIFlow doesn't start on new Core2

      It seems to be the same situation as the Core 2 I bought yesterday.
      Core2FactoryTest and draw_by_touch work fine, but UIFlow_Core2 v1.7.1.1-core2 (I also tried v1.7.0 / v1.7.1) doesn't work.

      However, it seems running with black screen. I tried connect to Core2 from UIFlow Cloud and run the program. print() can print text to the serial console, but M5Label will show nothing on the Core2 screen. just black screen.

      I tried burn with low baudrate (115200), but nothing changed

      posted in Core 2
      I
      inasawa
    • RE: Blynk in UIFlow

      I think this BLE Blynk library is similar to the one used in UIFlow.
      https://github.com/vshymanskyy/blynk-library-python/blob/master/examples/hardware/PyCom_BLE.py

      There was a problem with a continuous call to blynk.virtual_write. blynk.virtual_write calls _write in class BlynkBLE, _write concatenates the data and sends the data when run() is called. The following code is part of class BlynkBLE.

          def _write(self, data):
              self.bout += data
      
          def run(self):
              self.process()
              while len(self.bout):
                  data = self.bout[:20]
                  self.bout = self.bout[20:]
                  print('<', data)
                  self.tx.value(data)
      

      If you call multiple blynk.virtual_write() in a row as follows, data1 and data2 will be concatenated, and when run() is called, the concatenated data will be sent.

      blynk.virtual_write(1, data1)
      blynk.virtual_write(2, data2)
      

      In this case, the iOS Blynk app was unable to get the second data. Therefore, I added the call "blynk._blynk.run()" immediately after blynk.virtual_write as shown below.

      blynk.virtual_write(1, data1)
      blynk._blynk.run()
      blynk.virtual_write(2, data2)
      blynk._blynk.run()
      
      posted in UIFlow
      I
      inasawa
    • RE: Blynk in UIFlow

      In UIFlow 1.7.1/1.7.2, there seems to be an inconsistency between Blockly (generated Python code) and the Blynk library. The following is the created Blockly code.

      0_1613054214517_スクリーンショット 2021-02-11 23.08.04.png

      And the following is the generated Python code for M5Stack Core2.

      from m5stack import *
      from m5stack_ui import *
      from uiflow import *
      from ble import blynk
      
      screen = M5Screen()
      screen.clean_screen()
      screen.set_screen_bg_color(0xFFFFFF)
      
      vr = None
      count = None
      vw = None
      value = None
      
      def blynk_write():
        global vr, count, vw, value
        print('connected')
      
        pass
      
      def blynk_write():
        global vr, count, vw, value
        print('disconnected')
      
        pass
      
      def blynk_write(*args):
        global vr, count, vw, value
        vr = args[0]
        count = count + 1
        print([vr, count])
        blynk.virtual_write(int(vr), count)
      
        pass
      
      def blynk_write(*args):
        global vr, count, vw, value
        vw, value = args[0], args[1]
        print([vw, value])
      
        pass
      
      blynk.init('Blynk Test', '...token...', blynk.BLE)
      blynk.handle_event(blynk_write, 'connected')
      blynk.handle_event(blynk_write, 'disconnected')
      blynk.handle_event(blynk_write, 'write v*')
      blynk.handle_event(blynk_write, 'read v*')
      count = 0
      

      I have modified as follows.

      • make the event function name unique
      • change the order of the arguments in blynk.handle_event

      Then, it's works.

      from m5stack import *
      from m5stack_ui import *
      from uiflow import *
      from ble import blynk
      
      screen = M5Screen()
      screen.clean_screen()
      screen.set_screen_bg_color(0xFFFFFF)
      
      vr = None
      count = None
      vw = None
      value = None
      
      def blynk_connected():
        global vr, count, vw, value
        print('connected')
      
        pass
      
      def blynk_disconnected():
        global vr, count, vw, value
        print('disconnected')
      
        pass
      
      def blynk_read(*args):
        global vr, count, vw, value
        vr = args[0]
        count = count + 1
        print([vr, count])
        blynk.virtual_write(int(vr), count)
      
        pass
      
      def blynk_write(*args):
        global vr, count, vw, value
        vw, value = args[0], args[1]
        print([vw, value])
      
        pass
      
      blynk.init('Blynk Test', 'wbZdMJ8V1QCuYdePAqrlmt4iizSAX1j7', blynk.BLE)
      blynk.blynkBLE.ble.config(gap_name='Blynk Test')
      blynk.handle_event('connected',    blynk_connected)
      blynk.handle_event('disconnected', blynk_disconnected)
      blynk.handle_event('write v*',     blynk_write)
      blynk.handle_event('read v*',      blynk_read)
      count = 0
      
      posted in UIFlow
      I
      inasawa
    • RE: Bluetooth over Core2

      Official MicroPython examples may help you.
      https://github.com/micropython/micropython/blob/master/examples/bluetooth/ble_temperature_central.py
      Need to change a little

      from ble_advertising import decode_services, decode_name
      ->from ble.ble_advertising import decode_services, decode_name

      and if you run from UIFlow, __name__ is not "__main__" but "flow.m5cloud"
      remove if __name__ == "__main__": and just call demo()

      if event == _IRQ_SCAN_RESULT: is where receive advertisement data

      Another thing to note is the current UIFlow (v1.7.1) MicroPython cannot perform active scan. On some devices, the advertisement data does not contain the required data (name, etc.) but is included in the scan data which require active scan.

      posted in UIFlow
      I
      inasawa