This is the code:
Code: Select all
def play_folder_track(folder_id, track_id, level):
uos.dupterm(None, 1)
uart = UART(0, 9600)
uart.write(cmd.set_volume(level))
sleep(.02) #delay 20 mS to allow 9600 data to be transmitted
uart.write(cmd.play_folder_track(folder_id, track_id))
sleep(.02) #delay 20 mS to allow 9600 data to be transmitted
uos.dupterm(UART(0, 115200), 1)
As long as the TX line from the MP3 module is connected to the RX line of the ESP8266 (as it must be) the REPL does not work. It would appear that UART0 does not ignore the RX line even when it is servicing REPL. I am using an analogue switch chip (4016) to isolate the TX and RX lines of the MP3 module. The TX part works fine but I have to do some programming to respond to the data on the RX line. So my query is before I embark on this route is there a simpler solution? I can see that a couple of 4016 chips could provide a ESP board with a switchable serial interface that could prove useful for some projects.