karawin / Ka-Radio32

esp32 version of Ka-Radio (https://github.com/karawin/Ka-Radio) by jp Cocatrix
517 stars 155 forks source link

heltec wifi32 kit #30

Closed nano111 closed 6 years ago

nano111 commented 6 years ago

Hi, I saw that the problem with oled display on this device was solved,but I can not make it work. I changed this pins in gpio.h

define PIN_I2C_SCL GPIO_NUM_15

define PIN_I2C_SDA GPIO_NUM_4

define PIN_I2C_RST GPIO_NUM_16 // or not used

What exactly to add or change in addonu8g2.c to make it work Exuces my ignorance,I am new in this :-) wher to tell software to use this oled? Thanks

nano111 commented 6 years ago

some update changed some gpio pin definitions in gpio.h and now I have a starting logo andwhen board connects to wifi nothing more.Tried llcd 0,lcd 1,lcd 4 here is my gpio.h

pragma once

ifndef __GPIO_H__

define __GPIO_H__

//-------------------------------// // Define GPIO used in KaRadio32 // //-------------------------------// // Compatible ESP32 ADB // https://www.tindie.com/products/microwavemont/esp32-audio-developing-board-esp32-adb/

// HSPI pins //-----------

define PIN_NUM_MISO GPIO_NUM_19 // Master Input, Slave Output

define PIN_NUM_MOSI GPIO_NUM_23 // Master Output, Slave Input Named Data or SDA or D1 for oled

define PIN_NUM_CLK GPIO_NUM_18 // Master clock Named SCL or SCK or D0 for oled

// status led if any. //------------------- //Set the right one with command sys.led // GPIO can be changed with command sys.ledgpio("x")

define GPIO_LED GPIO_NUM_35 // Flashing led or Playing led

// gpio of the vs1053 //-------------------

define PIN_NUM_XCS GPIO_NUM_32

define PIN_NUM_RST GPIO_NUM_12

define PIN_NUM_XDCS GPIO_NUM_33

define PIN_NUM_DREQ GPIO_NUM_34

// + HSPI pins

// Encoder knob //-------------

define PIN_ENC_A GPIO_NUM_16 // CLK

define PIN_ENC_B GPIO_NUM_17 // DT

define PIN_ENC_BTN GPIO_NUM_5 // SW

// I2C lcd (and rda5807 if lcd is i2c or LCD_NONE) //------------------------------------------------

define PIN_I2C_SCL GPIO_NUM_15

define PIN_I2C_SDA GPIO_NUM_4

define PIN_I2C_RST GPIO_NUM_16 // or not used

// I2C rda5807 (if lcd is spi) //----------------------------

define PIN_SI2C_SCL GPIO_NUM_14

define PIN_SI2C_SDA GPIO_NUM_27

// SPI lcd //--------- // HSPI pins +

define PIN_LCD_CS GPIO_NUM_13 //CS

define PIN_LCD_A0 GPIO_NUM_14 //A0 or D/C

define PIN_LCD_RST GPIO_NUM_2 //Reset RES RST or not used

// IR Signal //-----------

define PIN_IR_SIGNAL GPIO_NUM_21 // Remote IR source

// I2S DAC or PDM output //-----------------------

define PIN_I2S_LRCK GPIO_NUM_25 // or Channel1

define PIN_I2S_BCLK GPIO_NUM_26 // or channel2

define PIN_I2S_DATA GPIO_NUM_22

// to set a value: gpio_set_level(gpio_num_t gpio_num,value); // to read a value: int gpio_get_level(gpio_num_t gpio_num)

void gpio_output_conf(gpio_num_t gpio);

endif

nano111 commented 6 years ago

after OTA update ,display not working

pilnikov commented 6 years ago

The update will undo all your changes and load the original code. Updating the OTA download not your's code, but the original one. In the original code there are problems with the compatibility of I2C ports, which are used for FM radio (RDA5807, not available to the user). To test your display, try it first in Arduino with the library u8g2. Try not to change the connection table

nano111 commented 6 years ago

Ok, I can leave original build , but why does it nit work after initialization, it only shows kara logo, ip adresa, cinnected and then nothing,no station name etc... Thanks for your help Regards

Pozdrav Goran

On 23 Apr 2018, at 05:41, Alex Pilnikov notifications@github.com<mailto:notifications@github.com> wrote:

The update will undo all your changes and load the original code. Updating the OTA download not your's code, but the original one. In the original code there are problems with the compatibility of I2C ports, which are used for FM radio (RDA5807, not available to the user). To test your display, try it first in Arduino with the library u8g2. Try not to change the connection table

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/karawin/Ka-Radio32/issues/30#issuecomment-383445768, or mute the threadhttps://github.com/notifications/unsubscribe-auth/Ak09hnuWd6wepRudVXgORcraKx_bS9Q3ks5trU1OgaJpZM4Te19Z.

nano111 commented 6 years ago

I have checked my display again with arduino and it works. I think initialy problem was with gpio pin numbers, but now I am confused. Why would it work at startup and then not?? How can I take some kind of log to see what happens?

pilnikov commented 6 years ago

if your network does not work properly, how did you start the OTA upgrade? Just copy a part of log here. Like as text

nano111 commented 6 years ago

As I said you would have to be more specific,total newbee here :smile: Network is ok.Radio works,web interface works,only display is problem after startup. I can telnet to karadio.But i do not know how to see log from the startup of the radio. I am bad at programming can you tell me exact command for log,and what did you mean with "connection table".

pilnikov commented 6 years ago

make monitor in msys command window

pilnikov commented 6 years ago

GPIO config like as in karadio without changes

nano111 commented 6 years ago

rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0018,len:4 load:0x3fff001c,len:3052 load:0x40078000,len:0 load:0x40078000,len:12880 entry 0x4007851c I (54) main: starting app_main() I (54) main: RAM left: 172244 E (54) main: Running partition type 0 subtype 17 (offset 0x001d0000) I (84) main: Partition init done... D (194) eeprom: saveDeviceSettings Log level is now ESP_LOG_VERBOSE V (314) addon: LINE: Log level is now ESP_LOG_VERBOSE

E (1814) vs1053: NO VS1053 detected I (1814) main: hardware initialized I (1814) main: Hardware init done... E (1814) main: LCD Type 0 D (1814) addonu8g2: lcd init BW type: 0 X: 128, YY: 64, Y: 9 I (3194) main: audio_output_mode 2 One of I2S=0, I2S_MERUS, DAC_BUILT_IN, PDM, VS1053 I (3194) main: Set baudrate at 115200 I (3194) main: Release 0.9, Revision 6 I (3194) main: SDK v3.1-dev-191-g6daa52d2-dirty I (3194) main: Heap size: 171000 I (3234) main: t0 task: 3ffca774 I (3234) main: starting wifi I (3234) wifi: wifi firmware version: 403db1d I (3234) wifi: config NVS flash: enabled I (3234) wifi: config nano formating: disabled I (3264) wifi: Init dynamic tx buffer num: 32 I (3264) wifi: Init data frame dynamic rx buffer num: 32 I (3264) wifi: Init management frame dynamic rx buffer num: 32 I (3264) wifi: wifi driver task: 3ffd29f4, prio:23, stack:4096 I (3264) wifi: Init static rx buffer num: 10 I (3274) wifi: Init dynamic rx buffer num: 32 I (3274) wifi: wifi power manager task: 0x3ffd7634 prio: 21 stack: 2560 WIFI TRYING TO CONNECT TO SSID 1 E (3284) wifi: esp_wifi_disconnect 847 wifi not start I (3434) main: connecting I (3474) wifi: mode : sta (b4:e6:2d:8e:2e:69) I (3474) main: Initialised wifi I (3604) wifi: n:6 0, o:1 0, ap:255 255, sta:6 0, prof:1 I (4604) wifi: state: init -> auth (b0) I (4614) wifi: state: auth -> assoc (0) I (4624) wifi: state: assoc -> run (10) I (4794) wifi: connected with X1, channel 6 E (4804) event: invalid static ip E (4804) main: Wifi connected

DNS: 192.168.1.1 IP: 192.168.1.100

D (4814) eeprom: saveDeviceSettings D (4954) renderer: init I2S mode 2, port 0, 16 bit, 44100 Hz I (4954) renderer: chip revision 1 I (4964) renderer: i2s intr:0 I (5134) main: RAM left 119600 I (5134) main: uartInterfaceTask task: 3ffdae64 I (5134) main: clientTask task: 3ffdb8cc I (5134) servers: watermark: 0x820 2080 I (5134) main: serversTask task: 3ffdc624 I (5134) servers: telnetServer_sock socket: 4096, errno: 0 I (5134) addon: event_ir: 3ffddb04 I (5144) servers: Webserver socket: 4097, errno: 0 I (5144) addon: event_lcd: 3ffddd8c I (5134) main: task_addon task: 3ffdd99c D (5154) NEC: RMT started Init ............... Done autostart: playing:1, currentstation:37 V (6654) addon: LINE: autostart: playing:1, currentstation:37

READY. Type help for a list of commands V (6654) addon: LINE: READY. Type help for a list of commands

I (7624) wifi: pm start, type:0

V (8134) webserver: playstationInt: 37, new station: M2 80's

CLI.NAMESET#: 37 M2 80's

V (8134) addon: LINE: ##CLI.NAMESET#: 37 M2 80's

CLI.URLSET#: www.m2radio.fr

V (8134) addon: LINE: ##CLI.URLSET#: www.m2radio.fr

CLI.PATHSET#: /pls/m280.m3u

V (8144) addon: LINE: ##CLI.PATHSET#: /pls/m280.m3u

CLI.PORTSET#: 80

V (8144) addon: LINE: ##CLI.PORTSET#: 80

CLI.OVOLSET#: 0

V (8154) addon: LINE: ##CLI.OVOLSET#: 0

V (8374) webserver: setOffsetVol: 0 I (8374) webclient: Webclient socket: 4099, errno: 0

CLI.VOL#: 245

V (8374) addon: LINE: ##CLI.VOL#: 245

D (8374) renderer: Renderer volume: 9900 V (8484) webserver: server free of 3ffdefb8, Heap size: 97408 D (8484) websocket: websocketbroadcast: {"wsstation":"37"} V (8484) webserver: playstationInt: 37, device: 37 V (8484) webserver: server free of 3ffdf650, Heap size: 97512 V (8554) webclient: EXTM3U: http://live.m2stream.fr/m280-128.mp3

V (8554) webclient: parse str live.m2stream.fr/m280-128.mp3

V (8554) webclient: parse str url live.m2stream.fr

CLI.URLSET#: live.m2stream.fr

V (8564) addon: LINE: ##CLI.URLSET#: live.m2stream.fr

CLI.PATHSET#: /m280-128.mp3

V (8574) addon: LINE: ##CLI.PATHSET#: /m280-128.mp3

CLI.PORTSET#: 80

V (8574) addon: LINE: ##CLI.PORTSET#: 80

CLI.STOPPED# from C_PLIST

V (8584) addon: LINE: ##CLI.STOPPED# from C_PLIST

V (9654) webclient: Client malloc after of 107 bytes ret:3ffcdd54 Heap size: 10 4928 V (9654) webclient: WSH: len:106 "{"wsicy":{"curst":"37","descr":"","meta":""," name":"","bitr":"","url1":"","not1":"","not2":"","genre":""}}" D (9654) websocket: websocketbroadcast: {"wsicy":{"curst":"37","descr":"","meta" :"","name":"","bitr":"","url1":"","not1":"","not2":"","genre":""}} V (9674) webclient: Client incfree of 3ffcdd54, from wsh Heap size: 10 5040 I (9764) webclient: watermark : 64 100 I (9764) webclient: Webclient socket: 4100, errno: 0 V (10294) webclient: Client malloc after of 107 bytes ret:3ffcde20 Heap size: 1 04848 V (10294) webclient: WSH: len:106 "{"wsicy":{"curst":"37","descr":"","meta":"", "name":"","bitr":"","url1":"","not1":"","not2":"","genre":""}}" D (10304) websocket: websocketbroadcast: {"wsicy":{"curst":"37","descr":"","meta ":"","name":"","bitr":"","url1":"","not1":"","not2":"","genre":""}} V (10324) webclient: Client incfree of 3ffcde20, from wsh Heap size: 9 8052 V (10324) webclient: Header1 len: 456, Header: HTTP/1.0 200 OK Content-Type: audio/mpeg icy-br:128 ice-audio-info: ice-samplerate=44100;ice-bitrate=128;ice-channels=2 icy-br:128 icy-description:M2 80 - ONLY 80's HITS - Live From Paris France - www.m2radio.fr

icy-genre:80s Pop Rock Funk Decades icy-name:M2 80 - ONLY 80's HITS - Live From Paris France - www.m2radio.fr icy-private:0 icy-pub:1 icy-url:http://www.m2radio.fr Server: Icecast 2.3.2 Cache-Control: no-cache icy-metaint:16000

V (10374) webclient: ParseHeader: HTTP/1.0 200 OK Content-Type: audio/mpeg icy-br:128 ice-audio-info: ice-samplerate=44100;ice-bitrate=128;ice-channels=2 icy-br:128 icy-description:M2 80 - ONLY 80's HITS - Live From Paris France - www.m2radio.fr

icy-genre:80s Pop Rock Funk Decades icy-name:M2 80 - ONLY 80's HITS - Live From Paris France - www.m2radio.fr icy-private:0 icy-pub:1 icy-url:http://www.m2radio.fr Server: Icecast 2.3.2 Cache-Control: no-cache icy-metaint:16000

D (10414) webclient: contentType: 5 V (10424) webclient: icy deb: 0 V (10424) webclient: icy in: 0 V (10424) webclient: Client malloc after of 65 bytes ret:3ffcbfe4 Heap size: 94 528 V (10434) webclient: Client malloc after of 84 bytes ret:3ffdfaac Heap size: 94 440 V (10444) webclient: stringify: enter: len:64 "M2 80 - ONLY 80's HITS - Live Fr om Paris France - www.m2radio.fr" V (10454) webclient: Client incfree of 3ffcbfe4, from str Heap size: 9 4512 V (10454) webclient: stringify: exit: len:64 "M2 80 - ONLY 80's HITS - Live Fro m Paris France - www.m2radio.fr"

CLI.ICY0#: M2 80 - ONLY 80's HITS - Live From Paris France - www.m2radio.fr

V (10564) addon: LINE: ##CLI.ICY0#: M2 80 - ONLY 80's HITS - Live From Paris Fra nce - www.m2radio.fr

V (10564) webclient: header after num:0 addr:0x3ffdfaac cont:"M2 80 - ONLY 80's HITS - Live From Paris France - www.m2radio.fr" V (10574) webclient: icy deb: 1 V (10574) webclient: icy deb: 2 V (10584) webclient: icy deb: 3 V (10584) webclient: icy in: 3 V (10584) webclient: Client malloc after of 22 bytes ret:3ffcc034 Heap size: 94 412 V (10594) webclient: Client malloc after of 41 bytes ret:3ffdfaf4 Heap size: 94 364 V (10604) webclient: stringify: enter: len:21 "http://www.m2radio.fr" V (10604) webclient: Client incfree of 3ffcc034, from str H

nano111 commented 6 years ago

that was with modified gpio here is with original

rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0018,len:4 load:0x3fff001c,len:3052 load:0x40078000,len:0 load:0x40078000,len:12880 entry 0x4007851c I (54) main: starting app_main() I (54) main: RAM left: 172244 E (54) main: Running partition type 0 subtype 17 (offset 0x001d0000) I (84) main: Partition init done... D (194) eeprom: saveDeviceSettings Log level is now ESP_LOG_VERBOSE V (314) addon: LINE: Log level is now ESP_LOG_VERBOSE

E (1814) vs1053: NO VS1053 detected I (1814) main: hardware initialized I (1814) main: Hardware init done... E (1814) main: LCD Type 1 D (1814) addonu8g2: lcd init BW type: 1 X: 128, YY: 64, Y: 9 I (3194) main: audio_output_mode 2 One of I2S=0, I2S_MERUS, DAC_BUILT_IN, PDM, VS1053 I (3194) main: Set baudrate at 115200 I (3194) main: Release 0.9, Revision 6 I (3194) main: SDK v3.1-dev-191-g6daa52d2-dirty I (3194) main: Heap size: 171000 I (3234) main: t0 task: 3ffca774 I (3234) main: starting wifi I (3234) wifi: wifi firmware version: 403db1d I (3234) wifi: config NVS flash: enabled I (3234) wifi: config nano formating: disabled I (3264) wifi: Init dynamic tx buffer num: 32 I (3264) wifi: Init data frame dynamic rx buffer num: 32 I (3264) wifi: Init management frame dynamic rx buffer num: 32 I (3264) wifi: wifi driver task: 3ffd29f4, prio:23, stack:4096 I (3264) wifi: Init static rx buffer num: 10 I (3274) wifi: Init dynamic rx buffer num: 32 I (3274) wifi: wifi power manager task: 0x3ffd7634 prio: 21 stack: 2560 WIFI TRYING TO CONNECT TO SSID 1 E (3274) wifi: esp_wifi_disconnect 847 wifi not start I (3424) main: connecting I (3464) wifi: mode : sta (b4:e6:2d:8e:2e:69) I (3464) main: Initialised wifi I (3584) wifi: n:6 0, o:1 0, ap:255 255, sta:6 0, prof:1 I (4594) wifi: state: init -> auth (b0) I (4604) wifi: state: auth -> assoc (0) I (4604) wifi: state: assoc -> run (10) I (4784) wifi: connected with X1, channel 6 E (4784) event: invalid static ip E (4784) main: Wifi connected

DNS: 192.168.1.1 IP: 192.168.1.100

D (4804) eeprom: saveDeviceSettings D (4944) renderer: init I2S mode 2, port 0, 16 bit, 44100 Hz I (4944) renderer: chip revision 1 I (4954) renderer: i2s intr:0 I (5124) main: RAM left 119600 I (5124) main: uartInterfaceTask task: 3ffdae64 I (5124) main: clientTask task: 3ffdb8cc I (5124) servers: watermark: 0x820 2080 I (5124) main: serversTask task: 3ffdc624 I (5124) servers: telnetServer_sock socket: 4096, errno: 0 I (5124) addon: event_ir: 3ffddb04 I (5134) servers: Webserver socket: 4097, errno: 0 I (5134) addon: event_lcd: 3ffddd8c I (5124) main: task_addon task: 3ffdd99c D (5144) NEC: RMT started Init ............... Done autostart: playing:1, currentstation:37 V (6644) addon: LINE: autostart: playing:1, currentstation:37

READY. Type help for a list of commands V (6644) addon: LINE: READY. Type help for a list of commands

I (7604) wifi: pm start, type:0

nano111 commented 6 years ago

Now I can not go back to semi working display.What to delete to start fresh make? I updated to 0.9 R6 and cant go back.

pilnikov commented 6 years ago

// I2C lcd (and rda5807 if lcd is i2c or LCD_NONE) //------------------------------------------------

define PIN_I2C_SCL GPIO_NUM_15

define PIN_I2C_SDA GPIO_NUM_4

define PIN_I2C_RST GPIO_NUM_16 // or not used

// I2C rda5807 (if lcd is spi) //----------------------------

define PIN_SI2C_SCL GPIO_NUM_14

define PIN_SI2C_SDA GPIO_NUM_27

// SPI lcd //--------- // HSPI pins +

define PIN_LCD_CS GPIO_NUM_13 //CS

define PIN_LCD_A0 GPIO_NUM_14 //A0 or D/C

define PIN_LCD_RST GPIO_NUM_2 //Reset RES RST or not used

its your config (from your second post) //--------------------------------------------------------------------------------------

try it like this

// I2C lcd (and rda5807 if lcd is i2c or LCD_NONE) //------------------------------------------------

define PIN_I2C_SCL GPIO_NUM_14

define PIN_I2C_SDA GPIO_NUM_13

define PIN_I2C_RST GPIO_NUM_16 // or not used

// I2C rda5807 (if lcd is spi) //----------------------------

define PIN_SI2C_SCL GPIO_NUM_21

define PIN_SI2C_SDA GPIO_NUM_27

// SPI lcd //--------- // HSPI pins +

define PIN_LCD_CS GPIO_NUM_19 //CS

define PIN_LCD_A0 GPIO_NUM_23 //A0 or D/C

define PIN_LCD_RST GPIO_NUM_2 //Reset RES RST or not used

nano111 commented 6 years ago

Thanks , I will try. Is it enough to chang that in gpio.h and just do make flash or I have to do make clean first. Thanks again for your effort Rgards Goran

pilnikov commented 6 years ago

Is it enough to chang that in gpio.h and just do make flash

nano111 commented 6 years ago

Does not work. From datasheet od Heltec board oled is connected as folows Slck gpio15 SDA gpio4 RST gpio16 With config as above was working as described befor.Kara logo,connecting to wifi,connected and then black screen. How does the software "know" which display is connected? in arduino enviroment I have to put: U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, 16, 15, 4); // OLED graphics for display to work...any help from that

nano111 commented 6 years ago

Now ir works.... with this

define GPIO_LED GPIO_NUM_35 // Flashing led or Playing led

// gpio of the vs1053 //-------------------

define PIN_NUM_XCS GPIO_NUM_32

define PIN_NUM_RST GPIO_NUM_12

define PIN_NUM_XDCS GPIO_NUM_33

define PIN_NUM_DREQ GPIO_NUM_34

// + HSPI pins

// Encoder knob //-------------

define PIN_ENC_A GPIO_NUM_14 // CLK

define PIN_ENC_B GPIO_NUM_17 // DT

define PIN_ENC_BTN GPIO_NUM_5 // SW

// I2C lcd (and rda5807 if lcd is i2c or LCD_NONE) //------------------------------------------------

define PIN_I2C_SCL GPIO_NUM_15

define PIN_I2C_SDA GPIO_NUM_4

define PIN_I2C_RST GPIO_NUM_16 // or not used

// I2C rda5807 (if lcd is spi) //----------------------------

define PIN_SI2C_SCL GPIO_NUM_15

define PIN_SI2C_SDA GPIO_NUM_27

// SPI lcd //--------- // HSPI pins +

define PIN_LCD_CS GPIO_NUM_13 //CS

define PIN_LCD_A0 GPIO_NUM_14 //A0 or D/C

define PIN_LCD_RST GPIO_NUM_2 //Reset RES RST or not used

// IR Signal //-----------

define PIN_IR_SIGNAL GPIO_NUM_21 // Remote IR source

// I2S DAC or PDM output //-----------------------

define PIN_I2S_LRCK GPIO_NUM_25 // or Channel1

define PIN_I2S_BCLK GPIO_NUM_26 // or channel2

define PIN_I2S_DATA GPIO_NUM_22

I am not sure why...thanks for your help. Next will try rotary encoder or switches for control.... Thanks again