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.



  • Can you pm me your real name as I would like to credit you in my book for all the hard work on M5Blynk



  • Very cool! Can't wait to try it out!



  • I just noticed the Blynk developers released a new version 0.2.0 of blynk-library-python on git hub. I seems to have some additional advanced features like

    • debug logging
    • custom server
    • changing heartbeat
    • connected/disconnected events
    • generic virtual pin events
    • BlynkTimer

    I have not tried this out yet, but plan to in the next week or so. In case you wanted to try the older version of the library, here is the commit:
    https://github.com/vshymanskyy/blynk-library-python/commit/4cbf641fade72a11e797436a8656ebf28f239801



  • @world101 I managed to build a private server on Saturday but having auto startup issues.
    I’ve tried the guide but still have to manually start the server



  • @ajb2k3 said in Blynk on M5Stack via uiFlow and block-maker:

    @world101 I managed to build a private server on Saturday but having auto startup issues.
    I’ve tried the guide but still have to manually start the server

    What platform did you build the local server on (Linux, RPi, etc)?



  • @world101 RPI 2B



  • @ajb2k3

    Try the following:

    edit the crontab

    pi@raspberrypi:~ $ crontab -e
    no crontab for pi - using an empty one

    Select an editor. To change later, run 'select-editor'.

    1. /bin/ed
    2. /bin/nano <---- easiest
    3. /usr/bin/vim.tiny

    Choose 1-3 [2]: 2
    Go to the end of the file and add the following command. Do not forget to modify the path to match your installation directory.

    @reboot java -jar /home/pi/server-0.23.0.jar -dataFolder /home/pi/Blynk &

    Source: https://diyprojects.io/blynk-how-to-install-a-private-local-server-on-raspberry-pi-3-unlimited-energy-test-wemos-dht22/#.XGvrGqROmEc



  • That’s the one I followed and still not auto loading. Will have another go tonight



  • @world101 Got everything working using UiFlow V1.2!


Log in to reply
 

Looks like your connection to M5Stack Community was lost, please wait while we try to reconnect.