Navigation

    M5Stack Community

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

    Best posts made by world101

    • [UIFlow] Open source UIFlow

      Many have asked and therefore many will contribute.... please open source uiFlow so we (the community) can help fix bugs and add enhancements (new blocks).

      posted in Features Wish List
      world101
    • RE: M5stack original firmware (binary)

      I also flashed mine with micropython. To get it back to the factory program that came installed, I connected it to the Arduino IDE, selected Tools > Board: M5Stack-Core-ESP32. Next I opened: File > Examples > M5Stack > Basics > FactoryTest. Upload that to the m5stack and you should be back to the factory program.

      If you don't have the M5Stack custom libraries, you can install it from Sketch > Include Library > Manage Libraries... Type m5stack in the filter box, select the result, and install the latest version.

      posted in PRODUCTS
      world101
    • UiFlow needs https

      @m5stack please also configure http://flow.m5stack.com/ for https like you did for this community forum. Thanks!

      posted in UIFlow
      world101
    • RE: Arduino not parsing M5Stack package index

      I just wanted to update that I finally got it working.

      I uninstalled v4 of the Silicon Labs VCP driver (using the uninstaller.sh script from the zip file below). Then installed the latest driver from this file:
      https://www.silabs.com/documents/public/software/Mac_OSX_VCP_Driver.zip
      I did not install the legacy driver. I used "Silicon Labs VCP Driver.pkg" from the main directory of the zip file.

      Next, I had to do a fresh install of the Arduino IDE 1.8.5, then followed the same instructions here: https://github.com/m5stack/M5Stack/blob/master/docs/arduino-ide/mac.md

      After I restarted the Arduino IDE, I now saw the M5Stack-Core-ESP32 listed under the Tools > Boards > ESP32 Arduino menu. No need to do anything with the Boards Manager.

      posted in FAQS
      world101
    • RE: Turn Off Display

      If you have the m5stack with MPU-9250... it would be cool if you code the display to turn off after a certain time, then turn it back on once you pick up or move the m5stack. Anyone want to implement that?

      posted in FAQS
      world101
    • RE: M5Stack and Blynk

      After further digging for the error, I found the following which has the solution.

      https://github.com/m5stack/M5Stack/issues/32

      I modified the header file Arduino/libraries/M5Stack/src/utility/M5Timer.h as follows.

      //typedef std::function<void(void)> timer_callback;
      typedef void (*timer_callback)(void);
      typedef void (*timer_callback_p)(void *);
      

      It now builds successfully and connects to the blynk cloud :-)

      @m5stack FYI... please add this to fix on the next release.

      posted in PROJECTS
      world101
    • RE: Has anyone figured out a good way to update the display quickly?

      @m5dude

      Yep, or any combination of these defined colors

      TFT_BLACK
      TFT_NAVY
      TFT_DARKGREEN
      TFT_DARKCYAN
      TFT_MAROON
      TFT_PURPLE
      TFT_OLIVE
      TFT_LIGHTGREY
      TFT_DARKGREY
      TFT_BLUE
      TFT_GREEN
      TFT_CYAN
      TFT_RED
      TFT_MAGENTA
      TFT_YELLOW
      TFT_WHITE
      TFT_ORANGE
      TFT_GREENYELLOW
      TFT_PINK

      Or you can define your own color based on red, green, and blue values, like this:
      #define MY_CUSTOM_COLOR M5.Lcd.color565(83,54,120) /* uint16_t color565(uint8_t r, uint8_t g, uint8_t b), */

      posted in FAQS
      world101
    • RE: Setting the volume

      @dda 在 Setting the volume 中说:

      You're supposed to call M5.Speaker.update(); after that to update the value.

      Excellent and thanks! I was wondering the same thing.

      posted in FAQS
      world101
    • RE: Blynk on M5Stack via uiFlow and block-maker

      By the way, I haven't found a way to import existing m5b files into block-maker.m5stack.com, so here are the ones I created. Feel free to play around with them and even create some new ones! The official Blynk colors are here: http://docs.blynk.cc/#blynk-main-operations-change-widget-properties

      Blynk Init:
      0_1549395441904_blynk_init.png

      import BlynkLib
      BLYNK_AUTH = ${auth_token}
      blynk = BlynkLib.Blynk(BLYNK_AUTH)
      

      Blynk Run:
      0_1549395472566_blynk_run.png

      blynk.run()
      

      Uptime:
      0_1549395486257_uptime.png

      @blynk.VIRTUAL_READ(${pin})
      def v${pin}_read_handler():
          time_val = time.ticks_ms() // 1000
          blynk.virtual_write(${pin}, time_val)
          lcd.textClear(${x}, ${y}, '      ', lcd.${bg_color})
          lcd.print(time_val, ${x}, ${y}, lcd.${fg_color})
      

      Slider: (Note, this is slightly different than the tutorial above. I was experimenting with passing a variable into the block. Feel free to adjust it as needed)
      0_1549395507104_slider.png

      @blynk.VIRTUAL_WRITE(${pin})
      def v${pin}_write_handler(value):
          lcd.textClear(${x}, ${y}, '    ', lcd.${bg_color})
          ${variable} = '{}'.format(value).strip("['']")
          lcd.print(${variable}, ${x}, ${y}, lcd.${fg_color}, transparent=True, fixedwidth=True)
      

      Push Notification:
      0_1549395564695_push_notification.png

      @blynk.VIRTUAL_WRITE(${pin})
      def v${pin}_write_handler(value):
          if value:
              blynk.notify(${text})
      

      I'm really interested in how to link blocks together, like the m5stack team did for the MQTT blocks. But I'll start a new thread on that soon.

      posted in PROJECTS
      world101
    • Blynk on M5Stack via uiFlow and block-maker

      I've been playing around with block-maker.m5stack.com quite a bit the past few days. I managed to integrate the Blynk python library and a few of the examples from the Blynk github repo.

      Here is how I did it. I'm on a Mac, so sorry I don't have the equivalent instructions for a PC.

      • First you need to get the BlynkLib library on the M5Stack. Clone the repo to your computer (or just download the BlynkLib.py file from github.com)
        git clone https://github.com/vshymanskyy/blynk-library-python.git

      • You will also need ampy or another file transfer utility to copy BlynkLib.py to the M5Stack. Follow the instructions in this video.
        https://www.youtube.com/watch?v=rvP3GixWG1Y

      • Copy BlynkLib.py to the M5Stack and put it into the /flash/lib directory so it can be imported as a MicroPython module
        cd blynk-library-python
        ampy -p /dev/tty.SLAB_USBtoUART -b 115200 put BlynkLib.py /flash/lib/BlynkLib.py
        Note: if you use a local Blynk server like I do, you can edit line 216 of BlynkLib.py and change it to your local server IP and port. Don't forget to put the updated file on your m5stack with ampy. This is the line to edit:
        self.conn.connect(socket.getaddrinfo("blynk-cloud.com", 80)[0][4])

      • Using your browser, go to flow.m5stack.com. Open this *.m5b file that I made with block-maker.m5stack.com. It has the custom blocks that I created for Blynk.
        0_1549165831483_m5b.png

      • Open this Blynk flow by using the Open option in the upper right menu.
        0_1549165880925_open.png

      0_1549166312758_Screen Shot 2019-02-02 at 10.57.33 PM.png

      • Load the image Blynk_m5.jpg into the Resource Manager (upper right menu of uiFlow)
        0_1549166495019_res.png
        Note: you may need to reload the image on the UI
        0_1549166437652_reload.png

      Now it should look like this:
      0_1549165895462_blynk_flow.png

      • Open the Blynk app on your iOS or Android mobile device. Create a new project and give it a name (I called my project MicroPython). Obtain the auth token from the nut icon in the upper right corner.

      • Drag 4 widgets into the project view

      1. Value Display: set title to "Uptime (sec)", set pin to V0, and set Refresh Interval to 1 sec
      2. Horizontal or Vertical Slider: set pin to V1 and Decimals to #
      3. Button: set title "Push Notification", set pin to V2, set ON label to Sent and set OFF label to Send
      4. Notification: no settings necessary
        0_1549166060718_widgets.PNG
      • Press the Run icon (triangle in upper right corner of the Blynk app)
        0_1549166074839_run.PNG

      • Back on your browser, paste your auth token into the flow under the Blynk init block

      • Press the Run icon (triangle in upper right corner of the uiFlow page) and wait for the Blynk app to connect to the M5Stack. Optionally, you can Download the flow to your m5stack using the Download option in the upper right menu.

      Demo Use Cases:

      1. M5Stack uptime (in seconds) will be shown on the Blynk app and on the M5Stack LCD

      2. Change the Slider and the value will be updated on the M5Stack LCD

      3. Tap the Push Notification button and it should send a push notification to the Blynk app on your device with the text shown in the flow.
        0_1549166691733_IMG_0028.PNG

      Happy Blynking with your M5Stack! :-)

      posted in PROJECTS
      world101
    • RE: Blynk on M5Stack via uiFlow and block-maker

      @ajb2k3, @LastCaress

      Glad you all got it working. To access REPL, you can do this from the Mac Terminal with the M5Stack connected to a USB port.

      screen /dev/tty.SLAB_USBtoUART 115200

      You may not see anything at first, so you can press CTRL+C on the keyboard to drop you into the REPL prompt (>>>). From there, you can do your regular MicroPython commands. For example...

      >>> os.listdir()
      ['image_app', 'main.py', 'emoji', 'sys_lib', 'config.py', 'lib', 'res', 'flow.py', 'blocks', 'apps', 'debug.py', 'modeconfig.json', 'boot.py', 'img']
      >>> os.listdir('lib')
      ['servo.py', 'square.py', 'step_motor.py', 'm5_pin.py', 'm5bala.py', 'wave.mpy', 'lego_board.py', 'bmp280.mpy', 'dht12.mpy', 'mpu6050.py', 'chunk.mpy', 'pid.py', 'lego.py', 'BlynkLib.py']
      >>> import BlynkLib
      
          ___  __          __
         / _ )/ /_ _____  / /__
        / _  / / // / _ \/  '_/
       /____/_/\_, /_//_/_/\_\
              /___/ for Python v0.2.0
      
      >>> help()
      Welcome to LoBo MicroPython for the ESP32
      
      For online documentation please visit the Wiki pages:
      https://github.com/loboris/MicroPython_ESP32_psRAM_LoBo/wiki
      
      Based on official MicroPython, this port brings many new features:
      
       - support for two cores and 4MB SPIRAM (psRAM)
       - improved 'network' module
       - greatly improved thread support
       - support for 3 different internal file systems on top of ESP32 VFS
       - ESP32 native support for SD Card
       - built-in FTP & Telnet servers
       - support for OTA updates
       - many new and improved hardware access modules implemented in C
       and many more...
      
      Control commands:
        CTRL-A        -- on a blank line, enter raw REPL mode
        CTRL-B        -- on a blank line, enter normal REPL mode
        CTRL-C        -- interrupt a running program
        CTRL-D        -- on a blank line, do a soft reset of the board
        CTRL-E        -- on a blank line, enter paste mode
      
      For further help on a specific object, type help(obj)
      For a list of available modules, type help('modules')
      >>> help('modules')
      __main__          m5flow/m5mqtt     math              uerrno
      _thread           m5flow/m5stack    microWebSocket    uhashlib
      ak8963            m5flow/peripheral microWebSrv       uheapq
      array             m5flow/simple     microWebTemplate  uio
      binascii          m5flow/ubutton    micropython       ujson
      btree             m5flow/unit/adc   mpu6500           uos
      builtins          m5flow/unit/button                  mpu9250           upip
      cmath             m5flow/unit/color network           upip_utarfile
      collections       m5flow/unit/dac   os                upysh
      display           m5flow/unit/dual_button             pye               urandom
      errno             m5flow/unit/ext_io                  random            ure
      freesans20        m5flow/unit/ir    re                urequests
      functools         m5flow/unit/ncir  select            uselect
      gc                m5flow/unit/relay socket            usocket
      hashlib           m5flow/unit/rgb_  ssd1306           ussl
      heapq             m5flow/unit/tof   ssl               ustruct
      io                m5flow/units      struct            utime
      json              m5flow/utils      sys               utimeq
      logging           m5flow/wifichoose time              uzlib
      m5base            m5flow/wificonfig tpcalib           websocket
      m5flow/app_manage m5flow/wifisetup  ubinascii         writer
      m5flow/i2c_bus    m5ui              ucollections      ymodem
      m5flow/m5cloud    machine           uctypes           zlib
      Plus any modules on the filesystem
      >>> 
      
      

      etc...

      Or if you don't go into the REPL prompt, but still have the screen session connected, you can see the serial logs from the m5stack. Reboot the M5stack and you should see the Blynk start up, plus some other useful information (network connection, connection to M5cloud, etc.).

      To exit the screen session press CTRL+A then CTRL+\ then y.

      posted in PROJECTS
      world101
    • RE: MQTT and Ui.Flow help needed

      @f3rn4nd0d try changing the mqtt subscribe to username/feeds/parking but replace your username with the real one

      posted in UIFlow
      world101
    • RE: MQTT and Ui.Flow help needed

      This one worked for me in the past. The username and active_key can be found on the "View AIO Key" link on io.adafruit.com. Make sure you have a feed named "light" set up under Feeds.

      0_1554257381294_Screen Shot 2019-04-02 at 10.09.13 PM.png

      posted in UIFlow
      world101
    • RE: Good tutorials for items contained in kit

      The M5GO main program has examples for the sensors that it comes with. Use that as a quick test to see things working. Also, there are a growing number of examples on the menu of UIFlow.

      0_1555198865578_DEDCF176-C776-4BE3-90DC-2151EE122C87.jpeg

      1_1555198865579_E1699F14-91C8-4641-89BB-C3DA6CF05B31.png

      posted in M5GO
      world101
    • RE: [Solved]M5StickC firmware

      No need to “roll back.” The M5burner is only for UIFlow IDE. To use it with Arduino, just connect the USB from the m5stickC to your computer and upload any Arduino .ino sketch from the m5stickC examples. Follow the instructions from @salty_good above to load the correct libraries into Arduino before uploading.

      posted in M5 Stick/StickC
      world101
    • RE: [Solved]M5StickC firmware

      @arzaman said in M5StickC firmware:

      @world101 thank ,

      so the same bootloader works for arduino IDE and UIflow ? if so is awesome

      so what is the "original" FW that is pre-loaded?
      If I udenrstand well the UIflow V1.2.3 loads on ESP32 micro python so sounds strange to me that once you have loaded the UIFlow FW you can use also with arduino IDE (C++)

      anyway I will try

      D.

      No it’s one FW or the other. The original FW should be uiFlow (MicroPython), at least for the recent hardware. The older hardware cores (M5Stack black or grey) shipped with a factory test Arduino sketch. All the newer hardware should ship with the uiFlow firmware.

      Flashing the hardware with the Arduino IDE will overwrite the uiFlow firmware. To get it back to uiFlow (MicroPython), use m5burner.

      posted in M5 Stick/StickC
      world101
    • RE: [Solved]Schematics for M5StickC?

      @liushasha said in [Solved]Schematics for M5StickC?:

      Hi,
      M5StickC schematic is not permitted to be open source yet, maybe later. We have offered the block diagram on the back sticker of the device, include all components and pin layout. Do you think those info is enough ?

      Not quite enough info. The question I have (and others too from another thread), is there any clamping or level shifting circuit (5V down to 3.3V) between the Grove port and I/O pins (G0, G26, G36) to the ESP32? If not, an external device (sensor) could pass 5V back into the M5stickC via Grove or I/O pins and damage the ESP32.

      posted in M5 Stick/StickC
      world101
    • RE: M5Stack Gray reboots when USBC power removed

      Just found this on Twitter: https://mobile.twitter.com/lovyan03/status/1162512607279890434

      2200μFのコンデンサをM5Stackの3v3とGNDの間に入れてUSB挿抜テスト。ノーマルボトムでは成功、USB抜いてもリセットせずにそのまま動作しました。

      Using google translate:
      Insert a 2200μF capacitor between 3v3 of M5Stack and GND for USB insertion / extraction test. It succeeded in the normal bottom, and it worked as it was without resetting even if USB was removed.

      posted in General
      world101
    • RE: micropython flowlib missing sources

      @lukasmaximus

      Thanks, but I'm not sure that helps that much. I'm more interested in the new libs bundled with the current firmware based on Micropython v1.11. Can those be extracted as well? If not, since you work at M5Stack, can you talk to a colleague to obtain them? They must exist somewhere if they are included with the newer firmware, right?

      posted in Micropython
      world101
    • RE: Defective Axp M5StickC (orange edition)?

      @ck, if you care to open up the case (you might not want to), you could check the soldering on the Extendable Socket ("hat") at the top to see if the connections are solid.

      posted in M5 Stick/StickC
      world101