Giter Site home page Giter Site logo

kodera2t / esp32_oled_webradio Goto Github PK

View Code? Open in Web Editor NEW
242.0 45.0 68.0 22.91 MB

OLED display support is added to ESP32 MP3 web radio/bluetotooth speaker code by MrBuddyCasino's. Now webradio station switching is supported (implemented by n24bass)

Makefile 23.22% C 32.26% C++ 43.55% Objective-C 0.96%
oled esp32 webradio

esp32_oled_webradio's Introduction

I cannot take any responsibility of the operation on the board, https://github.com/LilyGO/TTGO-TM-ESP32 since I did not make it and also I don't know its circuit. Please do not ask me its support but directly ask "LilyGo" for your support.

Modified for multi URL support by n24bass (merged several new functions, URL scrolling!)

For the boards with ESP32-PICO-D4, please swap control switch from GPIO16 to GPIO0, since GPIO16 in PICO-D4 is used for internal SPI Flash RAM connection (pre-occupied). Swap can be done in components/controls/controls.c

Add web interface. You can add (up to 10), change or remove URL of the internet radio station.

GET /  - list stations
GET /P - change to previous station
GET /N - change to next station
GET /0..9 - select station
GET /0..9+URL - set station URL
GET /0..-URL - remove station URL

Push 'GPIO-16' (chaned from 'boot') switch to change next station.

It starts up only web interface when GPIO-16 is keeped low level at boot time.


Modified for OLED display support by kodera2t

Please use latest esp-idf environment (envorinment just before will make lots error)

original code (w/o OLED) is https://github.com/MrBuddyCasino/ESP32_MP3_Decoder

OLED display mode for WiFi Radio/Bluetooth spaker will be set by menuconfig (select BT speaker or Wifi radio)

Bluetooth device name is defined in bt_config.h in include file folder. (default: "hogehoge_mont")


Wiring is same as original, as ESP pin - I2S signal

----------------------
GPIO25/DAC1   - LRCK
GPIO26/DAC2   - BCLK
GPIO22        - DATA

and GPIO25/26 are fixed but GPIO22 can be re-arranged as you wish. (defined in components/audio_renderer.c)

I2C OLED is connected, as ESP pin - I2C signal

----------------------
GPIO14   - SCL
GPIO13   - SDA

,which defined in app_main.c Please change as you wish...

More details can be found in the original author's explanation at https://github.com/MrBuddyCasino/ESP32_MP3_Decoder

esp32_oled_webradio's People

Contributors

kodera2t avatar n24bass avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp32_oled_webradio's Issues

deprecated function?

Encountered this when compiling for Bluetooth Speaker Mode.
error: implicit declaration of function 'esp_a2d_register_data_callback' [-Werror=implicit-function-declaration]
esp_a2d_register_data_callback(bt_app_a2d_data_cb);
^

By referring to MrBuddyCasino, it has already been changed. I guess this is not updated, is it?

Please re-upload this project after "make clean"

There are some object file in this repository which driving compile error if there is no make clean command was done.

There is no problem to compile with latest esp-idf, but make clean command is needed before compile due to object file in this repository.

WS2812.c code

An esp-idf update has broken this code so that the output no longer works

The following needs to change:

add
#include <driver/rmt.h>

and change
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[gpioNum], 2);
gpio_matrix_out(gpioNum, RMT_SIG_OUT0_IDX + RMTCHANNEL, 0, 0);
gpio_set_direction(gpioNum, GPIO_MODE_OUTPUT);**

to

rmt_set_pin((rmt_channel_t)RMTCHANNEL, RMT_MODE_TX, (gpio_num_t)gpioNum);

static IP + DNS

thanks for great work with webradio.
To speed up startup time i tried to set static ip + dns.
with static there were no problems but i failed in DNS.

#define DEVICE_DNS "8.8.8.8"
ip_addr_t dnsserver;
inet_pton(AF_INET, DEVICE_DNS, &dnsserver);
dns_setserver(0, &dnsserver);

esp32 reboots because of DNS resolution fail

New product 2

Found a product that is great for ESP32 development and final product as well. Check this out, https://hackaday.io/project/26267-m5stack. It is always available in Aliexpress and Banggood. It has built-in Audio amplifier, LCD TFT, plenty of GPIOs- almost all available for user's access, battery included and last but not least, 3 buttons. IMO, this is the most suitable board for all ESP32 applications and prototyping. Most importantly, it has got all the drivers and supports you can get from GitHub and a company to contact for support.

About SSD1306_Buffer Size

Hello.
I found this code in app_main.c
When without CONFIG_SSD1306_6432, the TFT resolution looks 128x64

#ifdef CONFIG_SSD1306_6432
#define XOFFSET 31
#define YOFFSET 32
#define WIDTH 64
#define HEIGHT 32
#else
#define WIDTH 128
#define HEIGHT 64
#define XOFFSET 0
#define YOFFSET 0
#endif

I found this code in ssd1306.h
TFT buffer looks 132x64.

/* SSD1306 settings */
/* SSD1306 width in pixels */
#ifndef SSD1306_WIDTH
#define SSD1306_WIDTH            132 ----> 128??
#endif
/* SSD1306 LCD height in pixels */
#ifndef SSD1306_HEIGHT
#define SSD1306_HEIGHT           64
#endif

Why is SSD1306_WIDTH 132? ?

In BT mode, it reboot repeatedly in terms of 5~6 second with latest esp-idf

I'm using ESP32 ADB type_R EVB
Webradio is quite good but in BT mode, it reboot repeatedly in terms of 5~6 second.

I just followed your blog posted below link
https://hackaday.io/project/21321-esp32-monster-board/log/59598-how-to-start-bluetooth-i2s-audio

I tried to enlarge BT task stack size in menuconfig but it did not fix.
asdf

Could you reproduce this issue in your side?
If so, please review this!!

If i try to connect source device and playing music quickly then BT sound is he
ard until auto reboot.

Please refer to BT log.
OLED_BT_Crash_log.txt

Build error

My environment:

ESP-IDF version:v4.1-dev-369-g4dac7c7df

My operation:

rm sdkconfig
make clean
make menuconfig
make


CC build/audio_renderer/audio_renderer.o
/home/ESP32_OLED_webradio/components/audio_renderer/audio_renderer.c: In function 'render_samples':
/home/ESP32_OLED_webradio/components/audio_renderer/audio_renderer.c:90:13: error: implicit declaration of function 'i2s_write_bytes' [-Werror=implicit-function-declaration]
             i2s_write_bytes(renderer_instance->i2s_num, buf, len,
             ^
/home/ESP32_OLED_webradio/components/audio_renderer/audio_renderer.c:142:32: error: implicit declaration of function 'i2s_push_sample' [-Werror=implicit-function-declaration]
                 bytes_pushed = i2s_push_sample(renderer_instance->i2s_num,
                                ^
/home/ESP32_OLED_webradio/components/audio_renderer/audio_renderer.c: At top level:
cc1: warning: unrecognized command line option '-Wno-frame-address'

No rule to make target ... bta_dm_cfg.c

If I enable BT I get this error: no rule to make target /Users/kodera2t/esp/esp-idf/components/bt/bluedroid/bta/dm/bta_dm_cfg.c

If I disable BT it compiles normal.

Compile BLE Speaker mode failed

When set to Bluetooth Speaker mode. It failed the compilation.

make[1]: *** No rule to make target '/Users/kodera2t/esp/esp-idf/components/bt/bluedroid/bta/dm/bta_dm_api.c', needed by 'bluedroid/bta/dm/bta_dm_api.o'. Stop.
/home/esp32/esp/esp-idf/make/project.mk:450: recipe for target 'component-bt-build' failed
make: *** [component-bt-build] Error 2

factory size

I changed the size of the factory to 2M because the default one was too small with the new idf.

Name, Type, SubType, Offset, Size, Flags

Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild

nvs, data, nvs, 0x9000, 0x6000,
phy_init, data, phy, 0xf000, 0x1000,
factory, app, factory, 0x10000, 2M,

in partitions.csv custom partition.

How to change the volume?

Please tell me how to adjust the volume, in which files to adjust the signal level. I tried the audio_renderer.s file to play with the values
  short left = * (short *) ptr_l;
  short right = * (short *) ptr_r;
The volume changes only on MP3 streams, and the AAC does not change in any way.

Fonts ,

Hey Hello!
Is there any way that i can import my custom fonts? is there any tool or something to import my fonts?

Buffer underflow with Icy-MetaData: 1 with Dac-Audio

Hi,
Icy-MetaData works:
http.c
if(asprintf(&request, "%s%s%s%s%s%s", "GET ", url->path, " HTTP/1.0\r\nHost: ", url->host, "\r\n","Icy-MetaData: 1\r\n\r\n") < 0)

but
http://st01.dlf.de/dlf/01/128/mp3/stream.mp3 works only in Audio Output Mode -PDM .
Other Audio Output Modes (no PDM ) gets error
after 1 Minute "audio_player: Buffer fill " goes down from 98% and after 2 Minutes to 1-5% stable
.....mad_decoder: Buffer underflow, need ...

The same with MrBuddyCasino/ESP32_MP3_Decoder.
You dont need connect oled or Dac-Device to test it.

I hope other Users can reproduce it and give solutions.

I have tried a lot, example
When I stop the decoder-Output for 100millisecondes the
audio_player: Buffer fill 98%
and goes down after 1 Minutes .....

I have understand
Input-Raw-Data-http-frames are visible in parser ,
frame.c find mp3-Data
stream.c sream out Data to i2s

but I dont understand where I have to search.

The Input-Data makes trouble only when Audio Output Modes is no PDM , lookes like i2s problem ?
Input-Raw-Data needs more time fill fifo, is this right ?
But why Problems after exactly 1 Minute sudently , looks like overrun error ?

I hope some body have time are interestet or have a link how it works the decoding process
from Raw-Data-http-frames to i2s and which files in mad serve it .

I have tested
with http://st01.dlf.de/dlf/01/128/mp3/stream.mp3 buffer goes down after 1 Minute
with http://st01.dlf.de/dlf/01/64/mp3/stream.mp3 buffer goes down after 2 Minute

Thx
Reini

My config
ESP32D0WDQ6 (revision 0)
ES9023 Dac but this not important
Oled128x64

another bug?

When set to Bluetooth Speaker mode. It failed the compilation.

make[1]: *** No rule to make target '/Users/kodera2t/esp/ESP32_OLED_MP3_Decoder/components/bt_speaker/./bt_app_core.c', needed by 'bt_app_core.o'. Stop.
/home/esp32/esp/esp-idf/make/project.mk:450: recipe for target 'component-bt_speaker-build' failed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.