mailto: blog -at- heyrick -dot- eu

Cold

It went down to -5.8°C this morning. It was odd, it hovered around -2 for much of the night, and then nosedived down to nearly -6 as the sun came up.

By 11am, it was a balmier -1°C. I went for a walk up the lane and back (about a kilometre) and then sat outside as it was almost warm in the sun. The postman thought that was funny.

A walk in the sun.
A walk in the sun.

Later on, as the temperature dropped in mid-afternoon, fog grew to make a less pleasant day.

The gloom.
The gloom.

It's 9pm and heading towards -3°C. AccuWeather reckons it'll hit minus five. Brrr...

 

Working on Rick's Net Radio

I decided today to make a few modifications to my ESP32 based (streaming) Net Radio.

I've shelved plans for using a ring buffer as it wasn't working, and the compiler is too damn slow to take time to work out why. Apart from occasional glitches when WiFi is busy, it plays quite well. Better than the app on my phone, I ought to point out. ☺

Apart from tidying up a few things (volume in steps of 5 with the max being 100), I am adding in serial control. This will work in two different ways. The first is a simple control and report interface like this:

Rick's NetRadio is initialising...
(version 0.05 built at 21:00:23 on Jan  8 2021)


Connected to Heart 80s

Controls: [P]revious/[N]ext station, [L]ouder/[Q]uieter, [M]ute,
          show [A]ll stations, [0]-[9] direct station choice,
          [S]etup (playing stops), [C]opyright, or [R]eset device.

Currently playing "Sledgehammer" by Peter Gabriel.


Available stations:
  0 - Heart 80s (http://media-ice.musicradio.com/Heart80s)
  1 - Eagle 96.4FM (http://streaming.ukrd.com/eagle.mp3)
  2 - Classic FM (http://media-ice.musicradio.com/ClassicFM)
  3 - Retro Hits Canada (http://149.56.183.178:8300/stream)
  4 - BBC Radio 4 FM (http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4fm_mf_p)
  5 - Alouette (http://broadcast.infomaniak.net/alouette-high.mp3)
  6 - JPopsuki Radio! (http://jpopsuki.fm:8000/stream)
  7 - Birdsong FM (http://streaming.radio.co/s5c5da6a36/listen)
  8 - Gothique13 (http://66.55.145.43:7037/)
  9 - PPNR02 (http://streamingV2.shoutcast.com/PPNR02)

Changing to PPNR02.

Connected to PPNR02

Controls: [P]revious/[N]ext station, [L]ouder/[Q]uieter, [M]ute,
          show [A]ll stations, [0]-[9] direct station choice,
          [S]etup (playing stops), [C]opyright, or [R]eset device.

Currently playing "Jumalten Aika" by Moonsorrow.
The volume is now 90.
The volume is now 95.
Currently playing "Gladiator" by Operatika.
Currently playing "TargetSpot" by Targetspot.
Currently playing "Calliopeia" by Stream Of Passion.
Currently playing "Desire Part II - Forsaken" by Wildpath.
Currently playing "Shadowmaker" by Apocalyptica.
Currently playing "Burden Of Divinity" by Visions of Atlantis.
Currently playing "Silver Moonlight" by Within Temptation.

What is going on here is that my NetRadio started, and tuned into Heart 80s (the first listed station). Which was playing Peter Gabriel's Sledgehammer, as any 80s station must at least once a day.

I then press A to ask for a list of stations. PPN Radio is the ninth station, so I press 9 and it tunes to PPN Radio (called "PPNR02" as that's the stream name). It begins to play Jumalten Aika.
I press L twice to bump the volume up to 95% (it is directly connected to my speakers, and can drive them without needing to use the battery powered amplifier, but it does need the sound cranked up).
Several things play after that. The one called "TargetSpot" is "don't drink and drive" advertising.

As I write this, more songs are playing, and they're duly being listed. Note, by the way, that this pulls the title and artist information directly from the Icy metadata. The information shown on the LCD is clipped to 16 characters maximum (as that's the width of a line of the LCD).

 

While it is nice to have serial control to be able to change channels and such without touching the device, this was mostly just a "throw it in".
What I plan to do is to have the serial interface, combined with the onboard NVRAM, be used for setting up the radio. This will allow the following things to be stored:

  • WiFi AP SSID and password.
  • Radio station names and URLs (space for ten stations).
  • The current volume (saved when changed).
  • The currently selected station (saved whan changed).

This will alleviate the need to burn the firmware with all of this hardcoded. If the device starts up without a WiFi AP configured, it will show this on the LCD:

Serial setup.
Set me up!
Alternating with a display saying it's 115200 baud at 8N1, and that you should press Enter to begin (that's just to ensure we're all using the correct serial data format).

From there, you'd choose options to set everything up, which will be stored in NVRAM. Nothing needs to be hardcoded any more.

Of course, a selection of channels will be provided by default - Heart 80s, Classic FM, BBC Radio 4, Gothique13, and PPN I would imagine. Something like that. You can, of course, change this.

The radio will also remember, most likely, its last configured volume and station to resume with those settings when it is next powered up. Also useful as resets (due to losing WiFi or whatever) will carry on playing the chosen station, rather than reverting to the first in the list.

 

 

Your comments:

Please note that while I check this page every so often, I am not able to control what users write; therefore I disclaim all liability for unpleasant and/or infringing and/or defamatory material. Undesired content will be removed as soon as it is noticed. By leaving a comment, you agree not to post material that is illegal or in bad taste, and you should be aware that the time and your IP address are both recorded, should it be necessary to find out who you are. Oh, and don't bother trying to inline HTML. I'm not that stupid! ☺ ADDING COMMENTS DOES NOT WORK IF READING TRANSLATED VERSIONS.
 
You can now follow comment additions with the comment RSS feed. This is distinct from the b.log RSS feed, so you can subscribe to one or both as you wish.

Rick, 9th January 2021, 23:06
Only spent a little while working on the code today, but I've added some code to remember the current volume and currently selected station, so it'll turn on with the same settings as were used previously. That alone is a pretty useful change!
Rick, 11th January 2021, 20:24
It's coming along nicely. Serial port control, and can now set up the WiFi via serial port. No need for the embedded AP name and password any more... 

Add a comment (v0.11) [help?] . . . try the comment feed!
Your name
Your email (optional)
Validation Are you real? Please type 17252 backwards.
Your comment
French flagSpanish flagJapanese flag
Calendar
«   January 2021   »
MonTueWedThuFriSatSun
    12
456910
111213141617
181920212223
252729

(Felicity? Marte? Find out!)

Last 5 entries

List all b.log entries

Return to the site index

Geekery
 
Alphabetical:

Search

Search Rick's b.log!

PS: Don't try to be clever.
It's a simple substring match.

Etc...

Last read at 08:52 on 2024/10/16.

QR code


Valid HTML 4.01 Transitional
Valid CSS
Valid RSS 2.0

 

© 2021 Rick Murray
This web page is licenced for your personal, private, non-commercial use only. No automated processing by advertising systems is permitted.
RIPA notice: No consent is given for interception of page transmission.

 

Have you noticed the watermarks on pictures?
Next entry - 2021/01/15
Return to top of page