Giter VIP home page Giter VIP logo

icenav-v3's Introduction

Static Badge PlatformIO ViewCount

icenav_logo

ESP32 Based GPS Navigator.

  • Note: Under development

Screenshots

Specifications

For the moment we have two Icenav models, with the next hardware setup and specs:

Other setups like another sensors, etc... not listed in the specs, now They are not included

If you wish to add any other type of sensor, module, etc., you can create a PR without any problem, and we will try to implement it. Thank you!

Customboard ESP32 setup

  • ESP32 WROVER with 4Mb PSRAM / 16 Mb Flash
  • ILI9488 TFT (320x480) - SPI Mode
  • SD/MicroSD reader
  • HCM5883L Magnetometer
  • BME280 Temperature / Humidity sensor
  • MPU6050 Accelerometer and Gyroscope IMU
  • HT1818Z3G5L GPS Module (AT6558D)
  • LVGL UI + LovyanGFX

Makerfabs ESP32-S3 setup

  • ESP32-S3-WROOM-1 with 2Mb PSRAM / 16 Mb Flash
  • ILI9488 TFT (320x480) - 16bit Parallel Mode
  • MicroSD reader
  • FT6236 Capactive Touch Panel Driver
  • HT1612Z3M3L GPS Module (AT6558D)
  • MPU9250 (Compass+IMU)
  • LVGL UI + LovyanGFX

Wiring

   Pinout (ESP32-WROVER)
   HCM5883L      BME280        MPU6050       ILI9488        SD CARD        VBAT             GPS
   -----------------------------------------------------------------------------------------------------
   VCC 3,3v      VCC 5v        VCC 3.3v      VCC  3,3v      VCC  3,3v      GPIO34           VCC  3,3v
   GND GND       GND GND       GND GND       GND  GND       GND  GND       ADC1_CHANNEL_6   GND  GND
   SDA GPIO21    SDA GPIO21    SDA GPIO21    LED  GPIO33    CS   GPIO4     (Resist. div)    RX   GPIO25
   SCL GPIO22    SCL GPIO22    SCL GPIO22    MISO GPIO27    MISO GPIO19                     TX   GPIO26
                                             SCK  GPIO14    SCK  GPIO12
                                             MOSI GPIO13    MOSI GPIO23
                                             DC   GPIO15
                                             RST  GPIO32
                                             CS   GPIO2
                                             LED  GPIO33
                                             TCH  GPIO18
                                             TIRQ GPIO5

   Pinout (ESP32S3-MakerFabs)
   GPS (HT1612Z3M3L)  MPU9250
   -----------------------------------------------------------------------------------------------------
   VCC 3,3v           VCC 3.3v
   GND GND            GND GND
   TX  GPIO17         SDA GPIO38
   RX  GPIO18         SCL GPIO39

SD Map Tile File structure

Using Maperitive select your zone and generate your tiles. For that enter to MAP-> Set Geometry bounds draw or expand the square of your zone and run the command generate-tiles minzoom=6 maxzoom=17, It could takes long time, maybe 1 hour or more depending your area.

Maperitive zone selection

After that, copy the contents of directory Tiles into your SD in a directory called MAP.

On SD Card map tiles (256x256 PNG Format) should be stored, in these folders structure:

  [ MAP ]
     |________ [ zoom folder (number) ]
                          |__________________ [ tile X folder (number) ]
                                                         |_______________________ tile Y file.png

Firmware install

Please install first PlatformIO open source ecosystem for IoT development compatible with Arduino IDE and its command line tools (Windows, MacOs and Linux). Also, you may need to install git in your system.

For custom ESP32 board run:

pio run --target upload

For ESP32S3 Makerfab board:

pio run -e MAKERF_ESP32S3 --target upload

After the first run, load the icons and assets with:

pio run --target uploadfs

Optional, for map debugging version with specific coordinates, build and install the firmware with the next environment variables, like this:

export ICENAV3_LAT=52.5200
export ICENAV3_LON=13.4049
pio run --target upload

Note: For production version don't forget unset these environment variables.

If the GPS module supports multiple GNSS, uncomment the following flag in the platformio.ini file under the build_flags section

-D MULTI_GNSS=1

TO DO

  • LVGL 9 Integration
  • GPX Integration
  • Multiple IMU's and Compass module implementation
  • Power saving
  • Vector maps
  • Google Maps navigation style
  • Optimize code
  • Fix bugs!
  • Web file server

Credits

icenav-v3's People

Contributors

hpsaturn avatar jgauchia 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

Watchers

 avatar  avatar

icenav-v3's Issues

where is the Compass Calibration

now,i connect my makefabs board with the mpu9250.
contrast to my phone compass, i find that the mpu920 compass pointing is huge different with the compass on the phone.
I have changed the value float declinationAngle =0.05 according to my location(-3°13′ west).
i find that the Compass Calibration code.
void create_settings_scr()
{
// Settings Screen
settingsScreen = lv_obj_create(NULL);
lv_obj_set_size(settingsScreen, TFT_WIDTH, TFT_HEIGHT);
lv_obj_set_pos(settingsScreen, 0, 0);
lv_obj_set_flex_flow(settingsScreen, LV_FLEX_FLOW_COLUMN);
lv_obj_set_flex_align(settingsScreen, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);

lv_obj_t *but_label;

// Compass Calibration
lv_obj_t *compass_calib_but = lv_btn_create(settingsScreen);
lv_obj_set_size(compass_calib_but, TFT_WIDTH - 30, 40);
but_label = lv_label_create(compass_calib_but);
lv_obj_set_style_text_font(but_label, &lv_font_montserrat_20, 0);
lv_label_set_text_static(but_label, "Compass Calibration");
lv_obj_center(but_label);
lv_obj_add_event_cb(compass_calib_but, compass_calib, LV_EVENT_CLICKED, NULL);

// Touch Calibration
lv_obj_t *touch_calib_but = lv_btn_create(settingsScreen);
lv_obj_set_size(touch_calib_but, TFT_WIDTH - 30, 40);
but_label = lv_label_create(touch_calib_but);
lv_obj_set_style_text_font(but_label, &lv_font_montserrat_20, 0);
lv_label_set_text_static(but_label, "Touch Calibration");
lv_obj_center(but_label);
lv_obj_add_event_cb(touch_calib_but, touch_calib, LV_EVENT_CLICKED, NULL);

// Back button
lv_obj_t *back_but = lv_btn_create(settingsScreen);
lv_obj_set_size(back_but, TFT_WIDTH - 30, 40);
but_label = lv_label_create(back_but);
lv_obj_set_style_text_font(but_label, &lv_font_montserrat_20, 0);
lv_label_set_text_static(but_label, "Back");
lv_obj_center(but_label);
lv_obj_add_event_cb(back_but, back, LV_EVENT_CLICKED, NULL);

}

however, when the device boot, there is just some text about memory free xxxxx, and then quickly jump to search sat.
I cannot get into the Compass Calibration button.

what iot device shoud i connect?

Hi sir,this project is great, i connect a gps moudule with gpio 17 and gpio 18, i put maps with (13 14 15 16 resolutions) into sd card.
I can get the gps location and display maps on the screen, i can see the speed of my foot about 3-6 km/h.
How the speed data display?i don't connect anything like move sensors to the esp32s3 borad but gps modules.
Of course,the speed display is not accurate, and the maps zoom in or zoom out is slow between 13 14 15 and 16 resolution maps.
Is necessary to buy the HCM5883 + MPU6050+MPU9250, what the difference between them?
Waiting for you reply.

how can i compile it on by vscode with platformio of esp32s3 borad.

Hi sir, my board is esp32s3, if i compile this code with original CUSTOMBOARD, i cannot upload to my device with the error "it is a esp32s3 not a esp32"
If i make change the platformio.ini as follows:
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[platformio]
description = ESP32 GPS Navigator
default_envs = esp32-s3-devkitm-1

[common]
platform = espressif32
framework = arduino
version = 0.1.7
revision = 38
monitor_speed = 115200
monitor_rts = 0
monitor_dtr = 0
monitor_echo = yes
monitor_filters =
send_on_enter
esp32_exception_decoder
extra_scripts = pre:prebuild.py
build_flags =
-D CORE_DEBUG_LEVEL=5
-D USE_LINE_BUFFER=1
-D DISABLE_RADIO=1
-D GPS_BAUDRATE=9600
-D AT6558D_GPS=1
-D MULTI_GNSS=1
-D BAUDRATE=115200
-D DEBUG=1
lib_deps =
mikalhart/TinyGPSPlus@^1.0.3
paulstoffregen/Time@^1.6.1
; me-no-dev/ESP Async WebServer@^1.2.3
lvgl/lvgl@^8.3.9
lovyan03/LovyanGFX@^1.1.8
jchristensen/Timezone@^1.2.4

[esp32_common]
platform = ${common.platform}
framework = ${common.framework}
monitor_speed = ${common.monitor_speed}
monitor_rts = ${common.monitor_rts}
monitor_dtr = ${common.monitor_dtr}
monitor_echo = ${common.monitor_echo}
monitor_filters = ${common.monitor_filters}
build_flags = ${common.build_flags}
lib_deps = ${common.lib_deps}
extra_scripts = ${common.extra_scripts}

[env:esp32-s3-devkitm-1]
extends = esp32_common
board = esp32-s3-devkitm-1
upload_port = /dev/ttyUSB0
board_upload.flash_size = 16MB
board_build.partitions = default_16MB.csv
lib_deps =
${common.lib_deps}
adafruit/Adafruit Unified Sensor@^1.1.13
adafruit/Adafruit HMC5883 Unified@^1.2.1
adafruit/Adafruit BusIO@^1.14.3
adafruit/Adafruit BME280 Library@^2.2.2
; me-no-dev/ESP Async WebServer@^1.2.3 ; Why we need that? This library is heavy (~200kb)
build_flags =
${common.build_flags}
-DBOARD_HAS_PSRAM
-mfix-esp32-psram-cache-issue
-D ENABLE_COMPASS=1
-D ENABLE_BME=1
-D TFT_WIDTH=320
-D TFT_HEIGHT=480
-D TFT_BL=33

[env:MAKERF_ESP32S3]
extends = esp32_common
board = esp32-s3-devkitc-1
board_build.mcu = esp32s3
board_build.f_cpu = 240000000L
lib_deps =
${common.lib_deps}
bolderflight/Bolder Flight Systems MPU9250@^1.0.2
build_flags =
${common.build_flags}
-DBOARD_HAS_PSRAM
-D ENABLE_COMPASS=1
; -D ENABLE_GYRO=1
; -D ENABLE_BME=1
-D TFT_WIDTH=320
-D TFT_HEIGHT=480
-D TFT_BL=45

image

How can i change the ini file for my esp32se-groom-1 with 4.3 lcd

Waypoints

Summary

Add the option to save waypoints in GPX format.

Seeking Help for Code Review, Optimization, and Cleanup

Summary

I am seeking assistance with reviewing, optimizing, and cleaning up the code for my project on GitHub.

If you could take a moment to review the code and provide your feedback, it would be immensely helpful. I am also willing to collaborate closely to implement any changes you might suggest.

Vector Maps

Summary

Change PNG Maps to Vector Maps from OpenStreetMaps PBF files.

With this improvement, it will be possible to optimize the usage of PSRAM memory, which is currently used to generate a larger map from 9 PNG tiles.

Tile boundaries

Overview

Since the current map is composed of a 9-tile matrix, it is necessary to review how the tile is determined based on the current longitude and latitude coordinates.

Details

The program currently retrieves the central tile from the 9-tile matrix based on the current longitude and latitude coordinates.

From this central tile, the expanded map is generated with a total of 9 tiles covering a total of 768x768 pixels (each tile measuring 256x256 pixels).

It is necessary to obtain the boundaries, in longitude and latitude coordinates, of the expanded map. The method of retrieving the current tile position needs to be changed so that it obtains the new central tile (required for creating the expanded map) if the current longitude and latitude coordinates exceed the boundaries of the expanded map.

This will prevent the current situation where the expanded map is generated only when the current coordinates match the central tile, instead of considering that the map is larger and already includes the surrounding tiles of the central one

IMU initialization unsuccessful

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0xb (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x44c
load:0x403c9700,len:0xbd8
load:0x403cc700,len:0x2a80
entry 0x403c98d0
[ 504][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
[ 509][I][esp32-hal-i2c.c:75] i2cInit(): Initialising I2C Master: sda=38 scl=39 freq=100000
[ 510][W][Wire.cpp:301] begin(): Bus already started in Master Mode.
[ 706][E][compass.h:65] init_compass(): IMU initialization unsuccessful
[ 706]��[ 714][E][Preferences.cpp:503] getBytesLength(): nvs_get_blob len fail: C_offset_x NOT_FOUND
[ 714][E][Preferences.cpp:503] getBytesLength(): nvs_get_blob len fail: C_offset_y NOT_FOUND
[ 719][V][preferences.h:22] load_preferences(): OFFSET X 0.000000
[ 726][V][preferences.h:23] load_preferences(): OFFSET Y 0.000000
[ 739][V][sdcard.h:35] init_sd(): SD Card Mounted
[ 839][V][sdcard.h:49] init_SPIFFS(): SPIFFS Mounted
[ 1639][E][Wire.cpp:137] setPins(): bus already initialized. change pins only when not.
[ 1639][W][Wire.cpp:301] begin(): Bus already started in Master Mode.
[ 1643][V][Touch_FT5x06.cpp:63] _check_init(): [FT5x06] CIPHER:0x64 / FIRMID:0x01 / VENDID:0x11
E (1377) ledc: ledc_get_duty(740): LEDC is not initialized

I have bought a mpu9255 module(no mpu9250 found). I connect it to esp32s3 with sda、scl、vcc and gnd.
However, when i check the data from uart, IMU initialization unsuccessful.
I check the sda scl vcc and gnd via voltmeter,the volitage is ok with normal status.
Is reason that i cannot use mpu9250.h for the mpu9255 module? If it is right, i cannot find mpu9255.h, can you give me some links?

Settings option

Summary

Add configuration option.

Add a configuration icon and include the necessary options.

arrows direction and maps

I have used the makerfabs to finish this project, everything is fine.
I used the mpu9250 module to receive compass data.
However, i found that the arrow on the maps cannot move, meanwhile, the maps move according to the compass data.
In common sense, like maps on the phone, the arrow direction changes with the owner walking direction, and the maps always remain unchangeable.
So, how can i hold the maps direction and change the arrow direction according to the compass?

how can i get the real point north via the compass?

There is a problem with the compass pointing north, and the compass in the upper right corner has nothing to do with the north, but only reflects the direction of movement.
The true pointing north is that no matter how much you move, the pointing north in the upper right corner always remains the same, that is, pointing north.

As you know, sir, i have finished that the navigation on the maps tile in the lcd center change direction according to the mpu9250 module.
so, i want to the compass in the upper right corner reflect the pointing north and remains silently to north,just like the phone.
how can complete it?

Change BME280 Library

Summary

Use a custom library for the temperature sensor instead of using the Adafruit libraries.

Compass Calibration with IMU

Summary

Add support for compass calibration using an IMU.

It is necessary to create an informative screen indicating the calibration process as well as the result. The calibration data should be saved internally on the ESP.

Include support for the following modules:

  • HCM5883 + MPU6050
  • MPU9250.

Change HMC5883 library

Summary

Use a custom library for the compass instead of using the Adafruit libraries.

Increase the map size

Summary

Increase the map size and include 2 labels. One for the zoom level and another for the current speed.
This way, the current zoom label generated with LVGL will be removed, improving the tile refresh.

Compass smothing

Summary

Smooth the compass readings to prevent jumps. (flickering)

how to change the size of arrow navigation

static const unsigned char navigation[] PROGMEM = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x36,0x03,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x35,0x03,0x36,0x03,0x36,0x03,0x16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x56,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x76,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x02,0xf7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0xef,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x16,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x57,0x03,0xb9,0x03,0xb9,0x03,0x57,0x03,0x36,0x03,0x36,0x03,0x36,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x57,0x03,0x78,0x03,0x78,0x03,0x78,0x03,0x78,0x03,0x57,0x03,0x36,0x03,0x36,0x03,0x36,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x03,0x36,0x03,0x36,0x03,0x57,0x03,0x37,0x03,0x57,0x03,0x57,0x03,0x37,0x03,0x56,0x03,0x56,0x03,0x37,0x03,0x36,0x03,0x36,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x03,0x15,0x03,0x36,0x02,0xb5,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0xb5,0x03,0x36,0x03,0x15,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00

};

sprArrow.createSprite(16, 16);
sprArrow.setColorDepth(16);
sprArrow.pushImage(0, 0, 16, 16, (uint16_t *)navigation);

Now the arrow size is little small, i want to change the arrow bigger on the lcd display.
However,when i change the width and height from 16 to 20、25、32 ,it will be not right on the lcd display,distortion.
maybe, i should redefine the navigation(static const unsigned char navigation[] PROGMEM =).
how can i define the navigation, which tools or url can be accessed?
what are the relation between navigation 、colordepth、width and height,why is the size of 'char navigation' 526?

Device Info

Summary

Add Device Info in settings screen

Sleep & Wake-up

Summary

Add functionality to enable sleep and wake-up by touching the TFT screen.

Makerfabs LVGL improve

Overview

Optimize LVGL for the Makerfabs board.

Details

It seems that with the Makerfabs board, the performance of LVGL is not the same as with a custom board using ESP32-WROVER.

[dev] drag/drop widgets freezing

Overview

When you try to move to the second window, and touch the compass, the widget is selected and it is freezing the device. But, the custom widget editor works fine.Maybe is only with a fast drag (trying to pass to the second window

[doc] request for map documentation

Overview

Great project. I want contribute with the project. My first goal will be try to run a minimal version on T-Display board with my GPS and maybe with the minimal resources files into the user partition flash. For that, is possible describe the procedure to have the map or a basic guide of the map files generation?

[Makerfab] checkbox settings freezing

Overview

On the makerfabs board, some settings widgets are freezing the device.

Details

Using the branch v.0.1.8_dev
Raplication: settings->map settings->show compass

Log output

[   501][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
[   522][I][esp32-hal-i2c.c:75] i2cInit(): Initialising I2C Master: sda=38 scl=39 freq=100000
[   523][W][Wire.cpp:301] begin(): Bus already started in Master Mode.
[  4534][V][Preferences.cpp:352] getUChar(): nvs_get_u8 fail: Map_compass NOT_FOUND
[  4535][V][Preferences.cpp:352] getUChar(): nvs_get_u8 fail: Map_speed NOT_FOUND
[  4538][V][Preferences.cpp:352] getUChar(): nvs_get_u8 fail: Map_scale NOT_FOUND
[  4546][V][Preferences.cpp:388] getInt(): nvs_get_i32 fail: Coords_X NOT_FOUND
[  4552][V][Preferences.cpp:388] getInt(): nvs_get_i32 fail: Coords_Y NOT_FOUND
[  4560][V][Preferences.cpp:352] getUChar(): nvs_get_u8 fail: Map_vector NOT_FOUND
[  4567][V][preferences.h:91] load_preferences(): COMPASS OFFSET X  27.231785
[  4573][V][preferences.h:92] load_preferences(): COMPASS OFFSET Y  24.160965
[  4580][V][preferences.h:93] load_preferences(): MAP ROTATION 1
[  4586][V][preferences.h:94] load_preferences(): DEFAULT ZOOM LEVEL 17
[  4592][V][preferences.h:95] load_preferences(): SHOW MAP COMPASS 0
[  4598][V][preferences.h:96] load_preferences(): SHOW MAP SPEED 0
[  4604][V][preferences.h:97] load_preferences(): SHOW MAP SCALE 0
[  4610][V][preferences.h:98] load_preferences(): GPS SPEED 2
[  4616][V][preferences.h:99] load_preferences(): GPS UPDATE RATE 3
[  4622][V][preferences.h:100] load_preferences(): COMPASS POS X 52
[  4628][V][preferences.h:101] load_preferences(): COMPASS POS Y 91
[  4634][V][preferences.h:102] load_preferences(): COORDINATE POS X 15
[  4640][V][preferences.h:103] load_preferences(): COORDINATE POS Y 10
[  4646][V][preferences.h:104] load_preferences(): SPEED POS X 11
[  4652][V][preferences.h:105] load_preferences(): SPEED POS Y 339
[  4658][V][preferences.h:106] load_preferences(): VECTOR MAP 0
[  4671][V][sdcard.h:35] init_sd(): SD Card Mounted
[  4771][V][sdcard.h:49] init_SPIFFS(): SPIFFS Mounted
[  5347][E][Wire.cpp:137] setPins(): bus already initialized. change pins only when not.
[  5347][W][Wire.cpp:301] begin(): Bus already started in Master Mode.
[  5351][V][Touch_FT5x06.cpp:63] _check_init(): [FT5x06] CIPHER:0x64 / FIRMID:0x03 / VENDID:0x11
E (5088) ledc: ledc_get_duty(740): LEDC is not initialized
[ 21784][V][button_bar.h:26] settings(): Settings

With these LV_LOG settings

#define LV_LOG_PRINTF 1

    /*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/
    #define LV_LOG_TRACE_MEM        0
    #define LV_LOG_TRACE_TIMER      0
    #define LV_LOG_TRACE_INDEV      1
    #define LV_LOG_TRACE_DISP_REFR  1
    #define LV_LOG_TRACE_EVENT      1
    #define LV_LOG_TRACE_OBJ_CREATE 0
    #define LV_LOG_TRACE_LAYOUT     1
    #define LV_LOG_TRACE_ANIM       0

I have the next output, just before the freezing. (complete file in the comments):

23:48:08.317 > [Trace]	(139.560, +0)	 event_send_core: Sending event 21 to 0x3de084fc with 0x3de07ad8 param 	(in lv_event.c line #428)
23:48:08.339 > [Trace]	(139.560, +0)	 event_send_core: Sending event 26 to 0x3de084fc with 0x3fcebc68 param 	(in lv_event.c line #428)
23:48:08.339 > [Trace]	(139.560, +0)	 event_send_core: Sending event 27 to 0x3de084fc with 0x3fcebc68 param 	(in lv_event.c line #428)
23:48:08.361 > [Trace]	(139.560, +0)	 event_send_core: Sending event 22 to 0x3de084fc with 0x3de07ad8 param 	(in lv_event.c line #428)
23:48:08.361 > [Trace]	(139.560, +0)	 event_send_core: Sending event 23 to 0x3de084fc with 0x3de07ad8 param 	(in lv_event.c line #428)
23:48:08.361 > [Trace]	(139.560, +0)	 event_send_core: Sending event 24 to 0x3de084fc with 0x3de07ad8 param 	(in lv_event.c line #428)
23:48:08.383 > [Trace]	(139.560, +0)	 event_send_core: Sending event 25 to 0x3de084fc with 0x3de07ad8 param 	(in lv_event.c line #428)
23:48:08.383 > [Trace]	(139.560, +0)	 event_send_core: Sending event 20 to 0x3de08540 with 0x3de07ad8 param 	(in lv_event.c line #428)
23:48:08.405 > [Trace]	(139.560, +0)	 event_send_core: Sending event 21 to 0x3de08540 with 0x3de07ad8 param 	(in lv_event.c line #428)
23:48:08.405 > [Trace]	(139.560, +0)	 event_send_core: Sending event 26 to 0x3de08540 with 0x3fcebc68 param 	(in lv_event.c line #428)
23:48:08.428 > [Trace]	(139.560, +0)	 event_send_core: Sending event 27 to 0x3de08540 with 0x3fcebc68 param 	(in lv_event.c line #428)
23:48:08.428 > [Trace]	(139.560, +0)	 event_send_core: Sending event 22 to 0x3de08540 with 0x3de07ad8 param 	(in lv_event.c line #428)
23:48:08.450 > [Trace]	(139.560, +0)	 event_send_core: Sending event 23 to 0x3de08540 with 0x3de07ad8 param 	(in lv_event.c line #428)
23:48:08.450 > [Trace]	(139.560, +0)	 event_send_core: Sending event 24 to 0x3de08540 with 0x3de07ad8 param 	(in lv_event.c line #428)
23:48:08.472 > [Trace]	(139.560, +0)	 event_send_core: Sending event 25 to 0x3de08540 with 0x3de07ad8 param 	(in lv_event.c line #428)
23:48:08.472 > [Trace]	(139.560, +0)	 call_flush_cb: Calling flush_cb on (257;165)(301;201) area with 0x3de0f27c image pointer 	(in lv_refr.c line #1232)

sdmmc card

Hi sir, i have no makerfabs esp32s3 board, my board is as the save, however the sd card is sdmmc type :
image

I changed the main.cpp as follows:

_**

/**

#define CALIBRATION_FILE "/TouchCalData1"
bool REPEAT_CAL = false;
//sdmmc related;
#include "FS.h"
#include "SD_MMC.h" //sd_mmc card related
bool sdloaded = false;//flag of whether sd_mmc card is mounted or not

#include <Arduino.h>
#include <stdint.h>
#include <Wire.h>
#include <SPIFFS.h>
#include <SPI.h>
#include <WiFi.h>
#include <esp_wifi.h>
#include <esp_bt.h>
#include <Timezone.h>

unsigned long millis_actual = 0;

#include "hardware/hal.h"
#include "hardware/serial.h"
//#include "hardware/sdcard.h"
#include "hardware/tft.h"
#ifdef ENABLE_COMPASS
#include "hardware/compass.h"
#endif
#ifdef ENABLE_BME
#include "hardware/bme.h"
#endif
#include "hardware/battery.h"
#include "hardware/gps.h"
#include "hardware/power.h"
#include "utils/gps_maps.h"
#include "utils/gps_math.h"
#include "utils/sat_info.h"
#include "utils/lv_spiffs_fs.h"
//#include "utils/lv_sd_fs.h"
#include "utils/time_zone.h"
#include "utils/preferences.h"
#include "gui/lvgl.h"

#include "tasks.h"

// Default pins for ESP-S3
// Warning: ESP32-S3-WROOM-2 is using most of the default GPIOs (33-37) to interface with on-board OPI flash.
// If the SD_MMC is initialized with default pins it will result in rebooting loop - please
// reassign the pins elsewhere using the mentioned command setPins.
// Note: ESP32-S3-WROOM-1 does not have GPIO 33 and 34 broken out.
// Note: if it's ok to use default pins, you do not need to call the setPins
int clk = 47;
int cmd = 21;
int d0 = 48;
int d1 = 45;
int d2 = 13;
int d3 = 14;

void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
Serial.printf("Listing directory: %s\n", dirname);

File root = fs.open(dirname);
if(!root){
    Serial.println("Failed to open directory");
    return;
}
if(!root.isDirectory()){
    Serial.println("Not a directory");
    return;
}

File file = root.openNextFile();
while(file){
    if(file.isDirectory()){
        Serial.print("  DIR : ");
        Serial.println(file.name());
        if(levels){
            listDir(fs, file.path(), levels -1);
        }
    } else {
        Serial.print("  FILE: ");
        Serial.print(file.name());
        Serial.print("  SIZE: ");
        Serial.println(file.size());
    }
    file = root.openNextFile();
}

}

void createDir(fs::FS &fs, const char * path){
Serial.printf("Creating Dir: %s\n", path);
if(fs.mkdir(path)){
Serial.println("Dir created");
} else {
Serial.println("mkdir failed");
}
}

void removeDir(fs::FS &fs, const char * path){
Serial.printf("Removing Dir: %s\n", path);
if(fs.rmdir(path)){
Serial.println("Dir removed");
} else {
Serial.println("rmdir failed");
}
}

void readFile(fs::FS &fs, const char * path){
Serial.printf("Reading file: %s\n", path);

File file = fs.open(path);
if(!file){
    Serial.println("Failed to open file for reading");
    return;
}

Serial.print("Read from file: ");
while(file.available()){
    Serial.write(file.read());
}

}

void writeFile(fs::FS &fs, const char * path, const char * message){
Serial.printf("Writing file: %s\n", path);

File file = fs.open(path, FILE_WRITE);
if(!file){
    Serial.println("Failed to open file for writing");
    return;
}
if(file.print(message)){
    Serial.println("File written");
} else {
    Serial.println("Write failed");
}

}

void appendFile(fs::FS &fs, const char * path, const char * message){
Serial.printf("Appending to file: %s\n", path);

File file = fs.open(path, FILE_APPEND);
if(!file){
    Serial.println("Failed to open file for appending");
    return;
}
if(file.print(message)){
    Serial.println("Message appended");
} else {
    Serial.println("Append failed");
}

}

void renameFile(fs::FS &fs, const char * path1, const char * path2){
Serial.printf("Renaming file %s to %s\n", path1, path2);
if (fs.rename(path1, path2)) {
Serial.println("File renamed");
} else {
Serial.println("Rename failed");
}
}

void deleteFile(fs::FS &fs, const char * path){
Serial.printf("Deleting file: %s\n", path);
if(fs.remove(path)){
Serial.println("File deleted");
} else {
Serial.println("Delete failed");
}
}

void testFileIO(fs::FS &fs, const char * path){
File file = fs.open(path);
static uint8_t buf[512];
size_t len = 0;
uint32_t start = millis();
uint32_t end = start;
if(file){
len = file.size();
size_t flen = len;
start = millis();
while(len){
size_t toRead = len;
if(toRead > 512){
toRead = 512;
}
file.read(buf, toRead);
len -= toRead;
}
end = millis() - start;
Serial.printf("%u bytes read for %u ms\n", flen, end);
file.close();
} else {
Serial.println("Failed to open file for reading");
}

file = fs.open(path, FILE_WRITE);
if(!file){
    Serial.println("Failed to open file for writing");
    return;
}

size_t i;
start = millis();
for(i=0; i<2048; i++){
    file.write(buf, 512);
}
end = millis() - start;
Serial.printf("%u bytes written for %u ms\n", 2048 * 512, end);
file.close();

}

void init_sdmmc(void){
if(!SD_MMC.setPins(clk, cmd, d0)){
if(!SD_MMC.setPins(clk, cmd, d0, d1, d2, d3)){
Serial.println("Pin change failed!");
return;
}
}
if(!SD_MMC.begin("/sdcard", true,true)){
Serial.println("Card Mount Failed");
return;
}
uint8_t cardType = SD_MMC.cardType();

if(cardType == CARD_NONE){
    Serial.println("No SD_MMC card attached");
    return;
}

bool sdloaded = true;//if sd_mmc card mounted

Serial.print("SD_MMC Card Type: ");
if(cardType == CARD_MMC){
    Serial.println("MMC");
} else if(cardType == CARD_SD){
    Serial.println("SDSC");
} else if(cardType == CARD_SDHC){
    Serial.println("SDHC");
} else {
    Serial.println("UNKNOWN");
}

uint64_t cardSize = SD_MMC.cardSize() / (1024 * 1024);
Serial.printf("SD_MMC Card Size: %lluMB\n", cardSize);

listDir(SD_MMC, "/", 0);
createDir(SD_MMC, "/mydir");
listDir(SD_MMC, "/", 0);
removeDir(SD_MMC, "/mydir");
listDir(SD_MMC, "/", 2);
writeFile(SD_MMC, "/hello.txt", "Hello ");
appendFile(SD_MMC, "/hello.txt", "World!\n");
readFile(SD_MMC, "/hello.txt");
deleteFile(SD_MMC, "/foo.txt");
renameFile(SD_MMC, "/hello.txt", "/foo.txt");
readFile(SD_MMC, "/foo.txt");
testFileIO(SD_MMC, "/test.txt");
Serial.printf("Total space: %lluMB\n", SD_MMC.totalBytes() / (1024 * 1024));
Serial.printf("Used space: %lluMB\n", SD_MMC.usedBytes() / (1024 * 1024));

}

/**

*/
void setup()
{
Serial.begin(115200);

#ifdef MAKERF_ESP32S3
Wire.setPins(I2C_SDA_PIN, I2C_SCL_PIN);
Wire.begin();
#endif

#ifdef ENABLE_BME
bme.begin(BME_ADDRESS);
#endif

#ifdef ENABLE_COMPASS
init_compass();
#endif

#ifdef DEBUG
init_serial();
#endif
powerOn();
load_preferences();
//init_sd();
//init_SPIFFS();
init_sdmmc();
init_LVGL();
init_tft();
init_gps();
init_ADC();

//map_spr.deleteSprite();
//map_spr.createSprite(768, 768);

//splash_scr();
// init_tasks();

#ifdef DEFAULT_LAT
load_main_screen();
#else
//lv_scr_load(searchSat);
#endif
}

/**

*/
void loop()
{
//vTaskDelay(5);
#ifdef MAKERF_ESP32S3
lv_tick_inc(5);
#endif
lv_timer_handler();
//lv_task_handler();

while (gps->available()>0)
{
#ifdef OUTPUT_NMEA
{
debug->write(gps->read());
}
#else
GPS.encode(gps->read());
#endif
}
}

**_

When i compile the code, the errors is
src/gui/screens/Main/events/main_scr.h:40:34: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
MapTile OldMapTile = {"", 0, 0, 0};
^
In file included from .pio/libdeps/MAKERF_ESP32S3/LovyanGFX/src/lgfx/v1_init.hpp:25,
from .pio/libdeps/MAKERF_ESP32S3/LovyanGFX/src/LovyanGFX.hpp:31,
from lib/makefabs-esp32s3parallel/LGFX_MakerFabs_Parallel_S3.hpp:11,
from src/hardware/tft.h:14,
from src/main.cpp:32:
.pio/libdeps/MAKERF_ESP32S3/LovyanGFX/src/lgfx/v1/LGFXBase.hpp: In instantiation of 'bool lgfx::v1::LGFXBase::drawPngFile(T&, const char*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, float, float, lgfx::v1::datum::datum_t) [with T = fs::SDMMCFS; int32_t = int; lgfx::v1::datum::datum_t = lgfx::v1::textdatum::textdatum_t]':
src/gui/screens/Main/events/map.h:158:74: required from here
.pio/libdeps/MAKERF_ESP32S3/LovyanGFX/src/lgfx/v1/LGFXBase.hpp:888:23: error: cannot declare variable 'file' to be of abstract type 'lgfx::v1::DataWrapperTfs::SDMMCFS'
DataWrapperT file ( &fs );
^~~~
.pio/libdeps/MAKERF_ESP32S3/LovyanGFX/src/lgfx/v1/LGFXBase.hpp:896:5: note: in expansion of macro 'LGFX_FUNCTION_GENERATOR'
LGFX_FUNCTION_GENERATOR(drawPng, draw_png)
image

Waiting for you reply.

Disable Compass or define map orientation priority

Summary

Sometimes the compass is not calibrated or it fails for magnetic fields like Tram lines. For this reason the orientation sometimes it's wrong or has a lot of noise. It's possible give more priority to the navigation calculation, or have the setting to disable the compass in the map?

Zoom issues

Overview

Some zoom levels do not display the map.

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.