adam2809 / komoot-navi-esp-idf

2 stars 0 forks source link

Help #3

Open Biker1Ben opened 2 years ago

Biker1Ben commented 2 years ago

Hello,

I can not figure it out how to install it on my lolin esp32 lite paaired with a 128x64 oled screen. Can you help me?

adam2809 commented 2 years ago

Hi sorry for this the previous version of the code should work but I lazily used this repo for another project which includes anti theft features targeted for the ttgo tcall this is why it probably breaks. Thanks for raising this issue I will fix it today evening after work and probably make a new repo and update the readme I will update you when it is done. If you have any other problems with my project don’t hesitate to ask.

Biker1Ben commented 2 years ago

Thank you for the fast response! I would be super nice, if you can make a new repo with a nice instruction how to install in on the esp32. Thanks for your great work!

adam2809 commented 2 years ago

Hi I am still working on this but I got a version of this code to run on my ttgo lora v2 but I don't have a lolin on hand now so you could check if make_komoot_work branch in this repo works. Install pio core (https://docs.platformio.org/en/stable/core/installation.html#installation-methods). Than clone the repo git clone https://github.com/adam2809/komoot-navi-esp-idf.git switch to the branch I mentioned git checkout make_komoot_work download dependencies git submodule update --init and upload the code pio run --target upload -e lolin32. The lolin configuration crashes immediately on my esp32 not sure if this is because it is actually broken or just incompatible with my board. If it doesn't work try pio run --target upload. Expect a proper new repo with some new updates in the coming days and let me know if you have any problems.

Biker1Ben commented 2 years ago

I'm having problems with the step where I'm supposed to download the dependencies, I get the following error message: PS C:\Users/benja/komoot-navi-esp-idf> git submodule update --init. Clone to 'C:/Users/benja/komoot-navi-esp-idf/components/i2c_manager'... git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.

Please make sure that you have the correct access rights and the repository exists. fatal: Cloning of 'git@github.com:ropg/i2c_manager.git' into submodule path 'C:/Users/benja/komoot-navi-esp-idf/components/i2c_manager' failed. The cloning of 'components/i2c_manager' failed. Try again Clone to 'C:/Users/benja/komoot-navi-esp-idf/components/i2c_manager'... git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.

Please make sure that you have the correct access rights and the repository exists. fatal: Cloning of 'git@github.com:ropg/i2c_manager.git' into submodule path 'C:/Users/benja/komoot-navi-esp-idf/components/i2c_manager' failed. The cloning of 'components/i2c_manager' failed a second time and was aborted. PS C:/Users/benja/komoot-navi-esp-idf>

adam2809 commented 2 years ago

I just pushed an update just git pull while on the make_komoot_work branch.

Biker1Ben commented 2 years ago

That part is working, now I have another problem: Linking .pio\build\lolin32\firmware.elf c:/users/benja/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: warning: size of symbol `dir_symbols_imgs' changed from 4 in .pio\build\lolin32\main\main.o to 128 in .pio\build\lolin32\esp-idf\display\libdisplay.a(dir_symbols.o) Retrieving maximum program size .pio\build\lolin32\firmware.elf Checking size .pio\build\lolin32\firmware.elf Advanced Memory Usage is available via "PlatformIO Home > Project Inspect" RAM: [== ] 20.9% (used 68524 bytes from 327680 bytes) Flash: [======== ] 82.3% (used 863053 bytes from 1048576 bytes) Building .pio\build\lolin32\firmware.bin esptool.py v3.1 Merged 2 ELF sections Configuring upload protocol... AVAILABLE: esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa CURRENT: upload_protocol = esptool Looking for upload port... Use manually specified: /dev/ttyUSB0 Uploading .pio\build\lolin32\firmware.bin esptool.py v3.1 Serial port /dev/ttyUSB0 Traceback (most recent call last): File "C:\Users\benja.platformio\packages\tool-esptoolpy\esptool.py", line 4582, in _main() File "C:\Users\benja.platformio\packages\tool-esptoolpy\esptool.py", line 4575, in _main main() File "C:\Users\benja.platformio\packages\tool-esptoolpy\esptool.py", line 4074, in main esp = esp or get_default_connected_device(ser_list, port=args.port, connect_attempts=args.connect_attempts, File "C:\Users\benja.platformio\packages\tool-esptoolpy\esptool.py", line 120, in get_default_connected_device _esp = chip_class(each_port, initial_baud, trace) File "C:\Users\benja.platformio\packages\tool-esptoolpy\esptool.py", line 313, in init self._port = serial.serial_for_url(port) File "C:\Users\benja.platformio\penv\lib\site-packages\serial__init__.py", line 90, in serial_for_url instance.open() File "C:\Users\benja.platformio\penv\lib\site-packages\serial\serialwin32.py", line 64, in open raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError())) serial.serialutil.SerialException: could not open port '/dev/ttyUSB0': FileNotFoundError(2, 'Das System kann den angegebenen Pfad nicht finden.', None, 3) *** [upload] Error 1 =============================================================================================================================================== [FAILED] Took 102.17 seconds ===============================================================================================================================================

Environment Status Duration


lolin32 FAILED 00:01:42.170

adam2809 commented 2 years ago

Ok sorry pushed another change if it does not work find out what is your port is and put it in the port variable in platformio.ini

Biker1Ben commented 2 years ago

Sorry for bothering you with that little problem, I typed in the platform.ini the upload port, but I still get an error

[env] monitor_speed=115200 monitor_filters = direct build_flags = -DCORE_DEBUG_LEVEL=5 port= 5

[env:ttgo-lora32-v2] platform = espressif32 board = ttgo-lora32-v2 framework = espidf

upload_port=${env.port} monitor_port=${env.port} monitor_speed=${env.monitor_speed}

monitor_filters = ${env.monitor_filters} build_flags = ${env.build_flags}

[env:lolin32] platform = espressif32 board = lolin32 framework = espidf

upload_port=${env.port} monitor_port=${env.port} monitor_speed=${env.monitor_speed}

monitor_filters = ${env.monitor_filters} build_flags = ${env.build_flags}

[platformio] src_dir = main default_envs = ttgo-lora32-v2

Error code is: PS C:\Users\benja\Documents\TestGitHub\komoot-navi-esp-idf\komoot-navi-esp-idf> pio run --target upload -e lolin32 Can not remove temporary directory C:\Users\benja\Documents\TestGitHub\komoot-navi-esp-idf\komoot-navi-esp-idf\.pio\build. Please remove it manually to avoid build issues Error: Invalid 'C:\Users\benja\Documents\TestGitHub\komoot-navi-esp-idf\komoot-navi-esp-idf\platformio.ini' (project configuration file): 'No option 'port' in section: 'env''

adam2809 commented 2 years ago

Sorry for bothering you with that little problem, I typed in the platform.ini the upload port, but I still get an error

[env] monitor_speed=115200 monitor_filters = direct build_flags = -DCORE_DEBUG_LEVEL=5 port= 5

[env:ttgo-lora32-v2] platform = espressif32 board = ttgo-lora32-v2 framework = espidf

upload_port=${env.port} monitor_port=${env.port} monitor_speed=${env.monitor_speed}

monitor_filters = ${env.monitor_filters} build_flags = ${env.build_flags}

[env:lolin32] platform = espressif32 board = lolin32 framework = espidf

upload_port=${env.port} monitor_port=${env.port} monitor_speed=${env.monitor_speed}

monitor_filters = ${env.monitor_filters} build_flags = ${env.build_flags}

[platformio] src_dir = main default_envs = ttgo-lora32-v2

Error code is: PS C:\Users\benja\Documents\TestGitHub\komoot-navi-esp-idf\komoot-navi-esp-idf> pio run --target upload -e lolin32 Can not remove temporary directory C:\Users\benja\Documents\TestGitHub\komoot-navi-esp-idf\komoot-navi-esp-idf\.pio\build. Please remove it manually to avoid build issues Error: Invalid 'C:\Users\benja\Documents\TestGitHub\komoot-navi-esp-idf\komoot-navi-esp-idf\platformio.ini' (project configuration file): 'No option 'port' in section: 'env''

Sorry another stupid mistake just pushed another update. It should find your usb port automatically but if it does not add upload_port = YOUR_PORT monitor_port = YOUR_PORT under [env:lolin32] and [env:ttgo-lora32-v2]

Biker1Ben commented 2 years ago

So I got it on my lolin32 but I get constant crashing and rebooting.

ets Jun 8 2016 00:22:57 21:37:10.907 -> 21:37:10.907 -> rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) 21:37:10.907 -> configsip: 0, SPIWP:0xee 21:37:10.907 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 21:37:10.907 -> mode:DIO, clock div:2 21:37:10.907 -> load:0x3fff0030,len:7580 21:37:10.907 -> ho 0 tail 12 room 4 21:37:10.907 -> load:0x40078000,len:14912 21:37:10.954 -> load:0x40080400,len:3688 21:37:10.954 -> entry 0x4008067c 21:37:10.954 -> I (29) boot: ESP-IDF 4.3.2 2nd stage bootloader 21:37:10.954 -> I (29) boot: compile time 21:35:19 21:37:10.954 -> I (29) boot: chip revision: 1 21:37:10.954 -> I (32) boot_comm: chip revision: 1, min. bootloader chip revision: 0 21:37:10.954 -> I (39) boot.esp32: SPI Speed : 40MHz 21:37:10.954 -> I (43) boot.esp32: SPI Mode : DIO 21:37:10.954 -> I (48) boot.esp32: SPI Flash Size : 4MB 21:37:10.954 -> I (52) boot: Enabling RNG early entropy source... 21:37:10.999 -> I (58) boot: Partition Table: 21:37:10.999 -> I (61) boot: ## Label Usage Type ST Offset Length 21:37:10.999 -> I (69) boot: 0 nvs WiFi data 01 02 00009000 00006000 21:37:10.999 -> I (76) boot: 1 phy_init RF data 01 01 0000f000 00001000 21:37:10.999 -> I (84) boot: 2 factory factory app 00 00 00010000 00100000 21:37:10.999 -> I (91) boot: End of partition table 21:37:10.999 -> I (95) boot_comm: chip revision: 1, min. application chip revision: 0 21:37:10.999 -> I (102) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=26078h (155768) map 21:37:11.094 -> I (167) esp_image: segment 1: paddr=000360a0 vaddr=3ffbdb60 size=03d2ch ( 15660) load 21:37:11.094 -> I (174) esp_image: segment 2: paddr=00039dd4 vaddr=40080000 size=06244h ( 25156) load 21:37:11.094 -> I (184) esp_image: segment 3: paddr=00040020 vaddr=400d0020 size=905c0h (591296) map 21:37:11.325 -> I (398) esp_image: segment 4: paddr=000d05e8 vaddr=40086244 size=126a8h ( 75432) load 21:37:11.325 -> I (430) esp_image: segment 5: paddr=000e2c98 vaddr=50000000 size=00010h ( 16) load 21:37:11.372 -> I (442) boot: Loaded app from partition at offset 0x10000 21:37:11.372 -> I (442) boot: Disabling RNG early entropy source... 21:37:11.372 -> I (454) cpu_start: Pro cpu up. 21:37:11.372 -> I (454) cpu_start: Starting app cpu, entry point is 0x4008137c 21:37:11.372 -> I (440) cpu_start: App cpu up. 21:37:11.372 -> I (470) cpu_start: Pro cpu start user code 21:37:11.372 -> I (470) cpu_start: cpu freq: 160000000 21:37:11.372 -> I (470) cpu_start: Application information: 21:37:11.372 -> I (475) cpu_start: Project name: komoot-navi-esp-idf 21:37:11.418 -> I (481) cpu_start: App version: 3ba22c5 21:37:11.418 -> I (486) cpu_start: Compile time: May 8 2022 21:33:36 21:37:11.418 -> I (492) cpu_start: ELF file SHA256: 86bcf322bd7ed1de... 21:37:11.418 -> I (498) cpu_start: ESP-IDF: 4.3.2 21:37:11.418 -> I (503) heap_init: Initializing. RAM available for dynamic allocation: 21:37:11.418 -> I (510) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM 21:37:11.418 -> I (516) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM 21:37:11.463 -> I (522) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM 21:37:11.463 -> I (528) heap_init: At 3FFCE710 len 000118F0 (70 KiB): DRAM 21:37:11.463 -> I (534) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM 21:37:11.463 -> I (541) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM 21:37:11.463 -> I (547) heap_init: At 400988EC len 00007714 (29 KiB): IRAM 21:37:11.463 -> I (554) spi_flash: detected chip: generic 21:37:11.463 -> I (558) spi_flash: flash io: dio 21:37:11.463 -> I (563) cpu_start: Starting scheduler on PRO CPU. 21:37:11.508 -> I (0) cpu_start: Starting scheduler on APP CPU. 21:37:11.508 -> I (595) BTDM_INIT: BT controller compile version [6a07b06] 21:37:11.508 -> I (595) system_api: Base MAC address is not set 21:37:11.508 -> I (595) system_api: read default base MAC address from EFUSE 21:37:11.508 -> I (605) lvgl_i2c: Now following I2C Manager for locking 21:37:11.508 -> I (605) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07 21:37:11.508 -> I (615) lvgl_helpers: Display hor size: 128, ver size: 64 21:37:11.508 -> I (625) lvgl_helpers: Display buffer size: 1024 21:37:11.555 -> I (625) lvgl_i2c: Starting I2C master at port 0. 21:37:11.555 -> I (635) lvgl_i2c: Initialised port 0 (SDA: 21, SCL: 22, speed: 400000 Hz.) 21:37:11.555 -> W (645) lvgl_i2c: Error: -1 21:37:11.555 -> 21:37:11.555 -> assert failed: ssd1306_init ssd1306.c:133 (0 == err) 21:37:11.555 -> 21:37:11.555 -> Backtrace:0x400816c3:0x3ffd1990 0x4009146d:0x3ffd19b0 0x40096d19:0x3ffd19d0 0x400e673b:0x3ffd1af0 0x400e666b:0x3ffd1b20 0x400e6663:0x3ffd1b40 0x400d18dc:0x3ffd1b70 0x400d1bb3:0x3ffd1bd0 0x40094705:0x3ffd1c10 21:37:11.555 -> 21:37:11.555 -> 21:37:11.555 -> ELF file SHA256: 86bcf322bd7ed1de 21:37:11.602 -> 21:37:11.602 -> Rebooting...

adam2809 commented 2 years ago

Did you try with pio run --target upload?