🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Azure IoT Handle Example for Speaker play_cloud command?

    Scheduled Pinned Locked Moved General
    4 Posts 1 Posters 4.1k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • greenleafG Offline
      greenleaf
      last edited by

      Anyone know what to put here for the Payload? I want to play a sound with the play_cloud command.

      0_1659459296028_25cfae68-050e-4cb5-accf-b60e10c6a435-image.png

      0_1659459360602_76a791e2-edc8-485e-8b20-d679efeb946f-image.png

      1 Reply Last reply Reply Quote 0
      • greenleafG Offline
        greenleaf
        last edited by

        I added it to my model so you get a UI field in Azure now for pasting in the cloud wav file URL:

        0_1659462218561_0392d7a1-8896-4938-a626-f5ce3d22f44f-image.png

        The command gets to the device but it can't parse it for some reason, get a Data Format Invalid error.

        Traceback (most recent call last):
          File "libs/m5mqtt.py", line 101, in _msg_deal_task
          File "libs/m5mqtt.py", line 88, in update
          File "umqtt/robust.py", line 80, in check_msg
          File "umqtt/simple.py", line 271, in check_msg
          File "umqtt/simple.py", line 259, in wait_msg
          File "libs/m5mqtt.py", line 50, in _on_data
          File "IoTcloud/Azure.py", line 333, in direct_method_cb
          File "main.py", line 32, in azure_direct_Speaker_play_cloud
          File "hardware/speaker.py", line 135, in playCloudWAV
          File "hardware/speaker.py", line 82, in playWAV
        ValueError: Data Format is not valid
        
        1 Reply Last reply Reply Quote 0
        • greenleafG Offline
          greenleaf
          last edited by

          I also tested this with a local file but get a different error:

          OSError [Errno 2] ENOENT
          
          1 Reply Last reply Reply Quote 0
          • greenleafG Offline
            greenleaf
            last edited by

            In case anyone else has the same issue...the handler works if you hard-code the path to the Wav file

            0_1659467223749_c6876809-3335-4966-b617-200384690612-image.png

            but cloud path doesn't work with the same trick, it still gives the Data format is not valid error.

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post