Navigation

    M5Stack Community

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

    Posts made by notdodgy

    • RE: Core Third Party Blocks - make available on Fire

      @glp Thanks, I will check that out.

      It does work if I change the device type to a core, even though it is downloading to a fire.

      Given that it just sends text instructions via a Wi-Fi network connection, it should be portable to any M5Stack controller.

      Ideally UIFlow would let you simply import/include various 3rd party libraries as needed.

      posted in Features Wish List
      N
      notdodgy
    • Core Third Party Blocks - make available on Fire

      I have a Fire and was trying out controlling a Tello Drone.

      The third-party block for Tello is available in M5Flow for core but not fire.

      If I configure my fire as a core then the code downloads and works.
      This set of blocks is a library that works over a wifi connection, so should work on any controller.

      Please can you add the 3rd party blocks available to core to the fire (and core2?)

      posted in Features Wish List
      N
      notdodgy
    • Access to HTTP Headers?

      I am using a Atom Matrix.
      My aim is to query a YouTube Channel to see if it is live or not. The Display on the Atom will used to give a simple status display.
      According to the article I found on getting the live stream status, the length of the live header is half the length of the not live header.

      My problem is as soon as I try and read the HTTP response with Get Data, it fails, though the response code is 200, which suggests success.

      I realise I may be doing something wrong.
      It may be the response is too big for the device to process?
      The url returns a lot, including video streams, in a normal browser.

      Is there a way to just get the returned headers?
      Or get the length of the returned data?

      Example Code:
      0_1634495247367_617f7a08-6981-451f-afb6-d3495a83094d-image.png

      posted in Features Wish List
      N
      notdodgy
    • RE: UIFlow - Trimming Strings

      @iamliubo said in UIFlow - Trimming Strings:

      Hi @notdodgy ,
      We will add this block:
      0_1630901532509_b47fbc8d-7771-4720-8455-dfaad19ad7f2-image.png

      Hello -

      Tried this new trim version and it works fine.
      Guessed correctly that I needed to use "[ ]" as the trim characters in the first part.

      No need for me to use a custom trim function.

      Thanks

      posted in Features Wish List
      N
      notdodgy
    • RE: Tip and a minor Bug

      @m5stack The link was in the Flow UI.

      The User Manual Button under the Create and Open file buttons.

      0_1631207603743_a81b87d5-280f-4917-9126-89214e32ad3c-image.png

      posted in Custom Blocks
      N
      notdodgy
    • RE: UIFlow - Trimming Strings

      @robalstona Thanks for your suggestion.

      The Custom block builder creates the code and the code used in block shown above does work.

      I opted to have the block and the name of the variable the same.
      The variable name appears on the block so effectively names the block.
      (If you don't have a variable as input, you can use a label, having both looked confusing and doubled the height of the block ).

      posted in Features Wish List
      N
      notdodgy
    • Tip and a minor Bug

      Created a custom block. Added it to my code and it works.

      Closed the page and re-opened my program but it is incomplete.
      Loading stops when it reaches the custom block

      What it means is the custom block file needs to be loaded before loading your program file.

      I suggest this is added to the help here: https://docs.m5stack.com/en/uiflow/blockly_custom?id=using-program-block

      The User Manager link in the custom block section goes to a dead link: https://docs.m5stack.com/en/related_documents/blockly_custom

      It should go to https://docs.m5stack.com/en/uiflow/blockly_custom

      posted in Custom Blocks
      N
      notdodgy
    • RE: UIFlow - Trimming Strings

      I had tried that in a custom block but it didn't work.
      Thanks for confirming the syntax.
      I spotted that I had misread the custom block syntax rules and had included extra quotes.

      I now have a working custom block that simply removes the first and last characters.

      I have an input called Trimmer

      The code section has ${Trimmer}[1:-1]

      0_1631143765864_d8bb067c-1d3b-4c4c-8b83-272d56a88d4c-image.png

      posted in Features Wish List
      N
      notdodgy
    • RE: UIFlow - Trimming Strings

      @robalstona said in UIFlow - Trimming Strings:

      @notdodgy, show me example input string, and write what exactly you need "extract" from this json string. Show me what string you except as output according to example input string. It is a some kind of homework?. I don't know why you make so many character substitutions in the text.

      in python code you could use this construction:

      out_str = in_str.replace('[', '').replace(']', '').replace...
      

      but i dont tested yet how long may be replace chain.

      Hello. It's a simple problem but the work around is not.
      This is a fairly large chunk of data which is json encoded.
      It's provided from a server API which I cannot change.
      It's from the servers that control my Car home charger.
      I am creating a remote monitor as a simple visual display. I can also use it to do basic start/stop actions.

      It contains a number of [ and ] and spaces in the body which I need to keep unchanged.

      My simple problem is it has an additional "[" at the start and a "]" at the end.
      This extra pair of [ and ] stop "loads json" from working.

      I only need to lose the first and last characters of the received data, while keeping the rest unchanged.
      In other programming languages it would be a substr(data,1,(strlen(data)-2)) or string[1:-1] .

      posted in Features Wish List
      N
      notdodgy
    • RE: UIFlow - Trimming Strings

      @robalstona said in UIFlow - Trimming Strings:

      @notdodgy there is also replace block. It has a three arguments:
      first is text to replace in your case [
      second is a replacing text, in your case leave blank.
      and third is your text or variable containing it.

      That is what I used but to only remove the first and last characters takes a number of search and replaces.

      0_1630946120197_284d54f5-f2fb-46b4-a7ba-a192657c827f-image.png

      posted in Features Wish List
      N
      notdodgy
    • RE: UIFlow - Trimming Strings

      That is good to hear.

      I started looking at a custom block but could find the right Python command.

      string[n:n] does not work.

      posted in Features Wish List
      N
      notdodgy
    • UIFlow - Trimming Strings

      I had an issue with processing json data that would not parse because it had a [ at the start and a ] at the the end.
      There is no easy way to remove these characters.

      There is a trim spaces block.
      What would be good would be a version of this block that trims ANY characters from the ends of a string. It would also act as a substr option.

      My clunky work around was:

      • Replace all spaces with a couple of ££ characters.
      • Replace all the [ with spaces.
      • Use the trim spaces block
      • Replace all spaces with [
      • Replace all the ] with spaces.
      • Use the trim spaces block
      • Replace all spaces with ]
      • Replace all the ££s with a space.

      Working out what the problem was took a while, but it took longer to find a way to make it work.

      posted in Features Wish List
      N
      notdodgy
    • RE: Where Best to buy in the UK

      Thanks - will check them out.

      posted in General
      N
      notdodgy
    • Where Best to buy in the UK

      I bought a M5Stack Stick C from Amazon.

      (The other M5Stack items seem hard to find or expensive).

      Ordering through the M5Stack site looks like it will incur international postage and get vat added which from experience incurs extra fees from the post service.
      (They charge more for collecting vat than the cost of the vat).

      Can anyone recommend where is best to buy in the UK?

      posted in General
      N
      notdodgy