Navigation

    M5Stack Community

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

    Posts made by captbd

    • RE: Trouble passing decoded json to variable

      @ajb2k3 Found the answer after a long time down the rabbit hole. It was not possible for me with the current blockly code. Changing to the python window, however, and incorporating the ujson functions that were taught in the weather app tutorial on youTube, I was able to get it done.

      Just was not able to get it done with available blockly. Now, the issue is that my UI Flow program completely eradicated my fix every time I exit. It won't save the correct code because it was done in the python window.

      So, I can't recreate it easily.

      posted in News and Blog posts
      C
      captbd
    • RE: Trouble passing decoded json to variable

      @ajb2k3

      With this code I can get the data into the esp32.
      0_1653748693106_49007088-8126-4adf-9782-3ebfa8341471-Screen Shot 2022-05-28 at 7.35.37 AM.png Screen Shot 2022-05-28 at 7.35.37 AM.png

      I cannot, however, decode it into a variable. I know the get function has worked because I can lcd.print the data either as the raw_channel_stats variable or the decoded_channel_stats variable. Beyond that I am lost.

      posted in News and Blog posts
      C
      captbd
    • Trouble passing decoded json to variable

      Hello,

      I know I have the product of the http get command in the machine. I am able to lcd print the information from the variable that json has passed it to in get data. I also can lcd print the information from the variable that json loads it to. So, I know it is in the machine.

      I am having trouble getting the data into a variable which will print into a label. I have tried many iterations of what is suggested; none of what I have tried will work for me.

      Here is the data:

      {
      "kind": "youtube#channelListResponse",
      "etag": "ZWPSr7cMrsGoEEQ08azuShUDwZo",
      "pageInfo": {
      "totalResults": 1,
      "resultsPerPage": 5
      },
      "items": [
      {
      "kind": "youtube#channel",
      "etag": "lRmGa0iYmbwfpoT2xfLWeRNgEGI",
      "id": "UCGeW5FIXqU4bhyq70skLPxA",
      "statistics": {
      "viewCount": "10474",
      "subscriberCount": "240",
      "hiddenSubscriberCount": false,
      "videoCount": "23"
      }
      }
      ]
      }

      I want to have a variable pass the info to a label

      items:statistics:viewCount
      items:statistics:subscriberCount

      Can anyone help?

      Bill

      posted in News and Blog posts
      C
      captbd
    • Newbie trying json

      Re: Accessing decoded JSON array

      Almost there . . . I have followed the examples. I am not a stranger to coding, but only a couple college classes. I know the get function is successful; I can print the resulting data. I get a success code of 200. I cannot decode the string on the blockly/micropython device. It works on the esp32 through arduino. Maybe that is interferring in my head. Any way,

      0_1653451098944_3a767194-d763-40c6-9816-8085058d5256-Screen Shot 2022-05-24 at 8.56.44 PM.png Screen Shot 2022-05-24 at 8.56.44 PM.png
      Why does my output label say 'none' instead of the number in the json?

      Any help greatly appreciated.

      Bill

      posted in UIFlow
      C
      captbd