|
Forum Index : Microcontroller and PC projects : VS1053 & PICO Questions
| Author | Message | ||||
| OA47 Guru Joined: 11/04/2012 Location: AustraliaPosts: 1041 |
I have finally found time to have a play with the VS1053 module and the PicoW. I have the code written by Peter working ok but I cannot get the code written by Tassie Jim to work. I would like to listen to some local content and have tried to enter Jims strings into Peters code and Peters string into Jims code but I think I have a lack of understanding on how these streams are addressed as I have had no success. Any help much appreciated OA47 |
||||
TassyJim![]() Guru Joined: 07/08/2011 Location: AustraliaPosts: 6490 |
I don't have a webmite and VS1053 set up but: My code SUB listen url$ LOCAL q$, a$, strm$, k% IF UCASE$(LEFT$(url$,7)) = "HTTP://" THEN url$ = MID$(url$,8) r% = 0 : w% = 0 k% = INSTR(url$,"/") a$ = LEFT$(url$,k%-1) strm$ = MID$(url$,k%) PRINT a$ PRINT strm$ q$="GET " INC q$, strm$ INC q$," HTTP/1.1\r\n" INC q$,"Host: " INC q$,a$ INC q$,"\r\nConnection: close\r\n\r\n" PLAY STREAM buff%(), r%, w% WEB OPEN TCP STREAM a$,80 WEB TCP CLIENT STREAM q$, buff%(), r%, w% END SUB Peters code ' create the request for the radio site (ClassicFM) Dim a$="ice-the.musicradio.com" Dim q$="GET " Inc q$,"/ClassicFMMP3" Inc q$," HTTP/1.1\r\n" Inc q$,"Host: " Inc q$,a$ Inc q$,"\r\nConnection: close\r\n\r\n" using an example from my code, url$ = "live-radio02.mediahubaustralia.com/JAZW/mp3/" in Peters code a$ is the url$ up to the first '/' the rest of the url$ is the stream (where Peter has "/ClassicFMMP3") moddified Peters code Dim a$="live-radio02.mediahubaustralia.com" Dim q$="GET " Inc q$,"/JAZW/mp3/" Inc q$," HTTP/1.1\r\n" Inc q$,"Host: " Inc q$,a$ Inc q$,"\r\nConnection: close\r\n\r\n" Getting the spaces correct is important. Jim https://www.thebackshed.com/forum/ViewTopic.php?TID=16391&P=3#217896 VK7JH MMedit |
||||
| OA47 Guru Joined: 11/04/2012 Location: AustraliaPosts: 1041 |
Jim, thankyou for your reply. Here is a snippet of the code I am using: 'Code updated for the latest version RC15 syntax just posted Option escape Option explicit Option default none ' create the request for the radio site (ClassicFM) Dim a$="live-radio02.mediahubaustralia.com" Dim q$="GET " Inc q$,"/JAZW/mp3/" 'Dim a$="ice-the.musicradio.com" 'Dim q$="GET " 'Inc q$,"/ClassicFMMP3" Inc q$," HTTP/1.1\r\n" Inc q$,"Host: " Inc q$,a$ Inc q$,"\r\nConnection: close\r\n\r\n" I am only changing 3 lines of code (Rem'd out the original of Peters) Peters url working but ABC not working. OA47 |
||||
| OA47 Guru Joined: 11/04/2012 Location: AustraliaPosts: 1041 |
Jim, I have just found the list of urls for Global Streaming in the UK and other addresses work fine. I am thinking the issue is with the mediahubaustralia urls not functioning. Is there a subscription needed to access these? OA47 |
||||
TassyJim![]() Guru Joined: 07/08/2011 Location: AustraliaPosts: 6490 |
Try pasting this link into your browser HTTP://live-radio02.mediahubaustralia.com/JAZW/mp3/ It works for me Jim VK7JH MMedit |
||||
| OA47 Guru Joined: 11/04/2012 Location: AustraliaPosts: 1041 |
Jim, I agree the link does work in the browser. NO Audio Connected a$=live-radio02.mediahubaustralia.com q$=GET /JAZW/mp3/ HTTP/1.1 Host: live-radio02.mediahubaustralia.com OK Audio Connected a$=ice-the.musicradio.com q$=GET /ClassicFMMP3 HTTP/1.1 Host: ice-the.musicradio.com Is there a chance that the length of the string (q$) is too long when put behind the WEB TCP Client Stream command? I have tried with and without the SLANT following the /mp3. OA47 |
||||
| Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 5753 |
Maybe the MP3 itself is not compatible with the VS1053 module (bitrate?). The pico only transfers data to the VS1053. Or the site is HTTPS in stead of HTTP. Volhout Edited 2026-03-09 18:25 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11030 |
The streaming support in the VS1053 is quite primitive. There are lots of internet radio stations that it can't receive. For example the BBC uses HLS/DASH which isn't supported. ClassicFM uses the older HTTP streaming with AAC at 48 kbps which is supported. You can use various directories to filter which stations are compatible (AACMix, Internet‑Radio.com etc.) |
||||
TassyJim![]() Guru Joined: 07/08/2011 Location: AustraliaPosts: 6490 |
The stream DID work with the webmite and VS1053 2 years ago when I posted the code. I can't test it for the next few days. Jim VK7JH MMedit |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |