Python Forum
UART Serial Read & Write to MP3 Player Doesn't Work
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
UART Serial Read & Write to MP3 Player Doesn't Work
#8
Thanks Deanhystad,

You are correct that the board is expecting x/aa to start the command and a check sum byte to end it. Sorry you could not access the URL. I'll try to see what I can do about that.

There is some of this code that I do not understand being a beginner and all.

Just in attempting to learn, I ran your code and got errors. Something about not iterable. Error has something to do with for loops, in your case the 'while', I'm assuming. So I tested and that was not it.

Something to do with the '[]s'. I don't know how to fix.

Output:
$ sudo python3 SerialTest3.py Traceback (most recent call last): File "SerialTest3.py", line 31, in <module> play_track(ser, [2, 0, 4]) # Track info? File "SerialTest3.py", line 21, in play_track write_command(port, [7].extend(track_info)) File "SerialTest3.py", line 10, in write_command command = [170].extend(command) # Command packet starts with 0xAA TypeError: 'NoneType' object is not iterable
Reply


Messages In This Thread
RE: UART Serial Read & Write to MP3 Player Doesn't Work - by bill_z - Jul-12-2021, 07:07 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Delete file with read-only permission, but write permission to parent folder cubei 6 22,372 Jun-01-2024, 07:22 AM
Last Post: Eleanorreo
  Extending list doesn't work as expected mmhmjanssen 2 350 May-09-2024, 05:39 PM
Last Post: Pedroski55
  UART write binary code trix 3 477 Apr-28-2024, 04:57 PM
Last Post: deanhystad
  Last record in file doesn't write to newline gonksoup 3 592 Jan-22-2024, 12:56 PM
Last Post: deanhystad
  UART & I2C slow down a loop trix 4 771 Dec-28-2023, 05:14 PM
Last Post: trix
  python Read each xlsx file and write it into csv with pipe delimiter mg24 4 1,815 Nov-09-2023, 10:56 AM
Last Post: mg24
Question Special Characters read-write Prisonfeed 1 721 Sep-17-2023, 08:26 PM
Last Post: Gribouillis
  pyserial/serial "has no attribute 'Serial' " gowb0w 9 5,704 Aug-24-2023, 07:56 AM
Last Post: gowb0w
  Why doesn't calling a parent constructor work with arbitrary keyword arguments? PurposefulCoder 4 1,078 Jun-24-2023, 02:14 PM
Last Post: deanhystad
  How do I read and write a binary file in Python? blackears 6 8,138 Jun-06-2023, 06:37 PM
Last Post: rajeshgk

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020