-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #255 from jgauchia/devel
0.1.9 Release
- Loading branch information
Showing
96 changed files
with
1,384 additions
and
734 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ ESP32 Based GPS Navigator (LVGL - LovyanGFX). | |
|:-:|:-:|:-:| | ||
| Add Waypoint | Add Waypoint (landscape) | Waypoint List | | ||
|
||
|<img src="images/dev/settings.jpg">|<img src="images/dev/compasscal.jpg">|<img src="images/dev/touchcal.jpg">|<img src="images/dev/mapsettings.jpg">|<img src="images/dev/devicesettings.jpg">| | ||
|<img src="images/dev/settings.jpg">|<img src="images/dev/compasscal.jpg">|<img src="images/dev/touchcal.jpg">|<img src="images/dev/mapsettings.jpg">|<img src="images/dev/devicesettings.png">| | ||
|:-:|:-:|:-:|:-:|:-:| | ||
| Settings | Compass Calibration | Touch Calibration | Map Settings | Device Settings | | ||
|
||
|
@@ -84,8 +84,6 @@ If the board has a BOOT button (GPIO0) it is possible to use power saving functi | |
To do this, simply include the following Build Flag in the required env in platformio.ini | ||
|
||
```-DPOWER_SAVE``` <br> | ||
```-DARDUINO_RUNNING_CORE=1``` <br> | ||
```-DARDUINO_EVENT_RUNNING_CORE=1``` <br> | ||
|
||
> [!IMPORTANT] | ||
> Currently, this project can run on any board with an ESP32S3 and at least a 320x480 TFT screen. The idea is to support all existing boards on the market that I can get to work, so if you don't want to use the specific IceNav board, please feel free to create an issue, and I will look into providing support. | ||
|
@@ -107,10 +105,10 @@ To do this, simply include the following Build Flag in the required env in platf | |
|:------------|:--------------|:-----------------------------------|:-------------------------------------------------------| | ||
| | 🔋 Batt. Monitor | ```-DADC1``` or ```-DADC2``` <br> ```-DBATT_PIN=ADCn_CHANNEL_x``` | | | ||
| AT6558D | 🛰️ GPS | ```-DAT6558D_GPS``` | | | ||
| HMC5883L | 🧭 Compass | ```-DHMC5883L``` | ```dfrobot/DFRobot_QMC5883@^1.0.0``` | | ||
| QMC5883 | 🧭 Compass | ```-DQMC5883``` | ```dfrobot/DFRobot_QMC5883@^1.0.0``` | | ||
| MPU9250 | 🧭 IMU (Compass) | ```-DIMU_MPU9250``` | ```bolderflight/Bolder Flight Systems MPU9250@^1.0.2```| | ||
| BME280 | 🌡️ Temp <br> ☁️ Pres <br> 💧 Hum | ```-DBME280``` | ```adafruit/Adafruit Unified Sensor@^1.1.14``` <br> ```adafruit/Adafruit BusIO@^1.16.1``` <br> ```adafruit/Adafruit BME280 Library@^2.2.4```| | ||
| HMC5883L | 🧭 Compass | ```-DHMC5883L``` | ```dfrobot/[email protected]``` | | ||
| QMC5883 | 🧭 Compass | ```-DQMC5883``` | ```dfrobot/[email protected]``` | | ||
| MPU9250 | 🧭 IMU (Compass) | ```-DIMU_MPU9250``` | ```bolderflight/Bolder Flight Systems [email protected]```| | ||
| BME280 | 🌡️ Temp <br> ☁️ Pres <br> 💧 Hum | ```-DBME280``` | ```adafruit/Adafruit Unified [email protected]``` <br> ```adafruit/Adafruit [email protected].2``` <br> ```adafruit/Adafruit BME280 [email protected]```| | ||
|
||
[^1]: For ELECROW board UART port is shared with USB connection, GPS pinout are mapped to IO19 and IO40 (Analog and Digital Port). If CLI isn't used is possible to attach GPS module to UART port but for upload the firmware (change pinout at **hal.hpp**), the module should be disconnected. | ||
[^2]: See **hal.hpp** for pinouts configuration | ||
|
@@ -210,6 +208,8 @@ Please follow the instructions provided by [OSM_Extract](https://github.com/ares | |
> pio run --target uploadfs | ||
> ``` | ||
> [!TIP] | ||
> Optional, firmware upgrade is possible from SD Card, please see [PR #259](https://github.com/jgauchia/IceNav-v3/pull/259) for detailed instructions | ||
> [!TIP] | ||
> Optional, for map debugging with specific coordinates, or when you are in indoors, you are able to set the defaults coordinates, on two ways: | ||
|
@@ -248,7 +248,7 @@ outnmea: toggle GPS NMEA output (or Ctrl+C to stop) | |
poweroff: perform a ESP32 deep sleep | ||
reboot: perform a ESP32 reboot | ||
scshot: screenshot to SD or sending a PC | ||
settings: device settings | ||
setdstzone: set DST (Daylight Saving Time zone: NONE, EU or USA) | ||
waypoint: waypoint utilities | ||
webfile: enable/disable Web file server | ||
wipe: wipe preferences to factory default | ||
|
@@ -270,6 +270,7 @@ Some extra details: | |
VmaxBatt custom | ||
VminBatt custom | ||
tempOffs custom | ||
defGMT custom | ||
``` | ||
**kset KEYNAME**: Set user custom settings: | ||
|
@@ -300,8 +301,6 @@ nc -l -p 8123 > screenshot.png | |
Additionally, you can download the screenshot with webfile server. | ||
**settings**: Device settings type `settings` for detailed options. | ||
**waypoint**: type `waypoint` for detailed options. | ||
Additionally, this waypoint command can send the waypoint over WiFi using the following syntax (replace IP with your PC IP): | ||
|
@@ -338,7 +337,7 @@ To access the Web File Server, simply use any browser and go to the following ad | |
- [X] Vector maps | ||
- [ ] Google Maps navigation style | ||
- [x] Optimize code | ||
- [ ] Fix bugs! | ||
- [X] Fix bugs! | ||
- [X] Web file server | ||
|
@@ -362,10 +361,11 @@ To access the Web File Server, simply use any browser and go to the following ad | |
* OSM to binary vectorial maps [OSM_Extract](https://github.com/aresta/OSM_Extract) thanks to [@aresta](https://github.com/aresta) | ||
* Preferences Library [Easy Preferences](https://github.com/hpsaturn/easy-preferences) thanks to [@hpsaturn](https://github.com/hpsaturn) | ||
* Wifi CLI manager [esp32-wifi-cli](https://github.com/hpsaturn/esp32-wifi-cli) thanks to [@hpsaturn](https://github.com/hpsaturn) | ||
* Web file server based in [@smford](https://github.com/smford) [esp32-asyncwebserver-fileupload-example ](https://github.com/smford/esp32-asyncwebserver-fileupload-example) | ||
* Web file server based in [@smford](https://github.com/smford) [esp32-asyncwebserver-fileupload-example](https://github.com/smford/esp32-asyncwebserver-fileupload-example) | ||
* Solar sunset and sunrise [SolarCalculator](https://github.com/jpb10/SolarCalculator) thanks to [@jpb10](https://github.com/jpb10) | ||
--- | ||
Map data is available thanks to the great OpenStreetMap project and contributors. The map data is available under the Open Database License. | ||
© OpenStreetMap contributors | ||
[© OpenStreetMap contributors](https://www.openstreetmap.org/copyright) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
* @file hal.hpp | ||
* @author Jordi Gauchía ([email protected]) | ||
* @brief Boards Pin definitions | ||
* @version 0.1.8 | ||
* @date 2024-11 | ||
* @version 0.1.9 | ||
* @date 2024-12 | ||
*/ | ||
|
||
#ifndef HAL_HPP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,80 +2,78 @@ | |
* @file battery.cpp | ||
* @author Jordi Gauchía ([email protected]) | ||
* @brief Battery monitor definition and functions | ||
* @version 0.1.8 | ||
* @date 2024-11 | ||
* @version 0.1.9 | ||
* @date 2024-12 | ||
*/ | ||
|
||
|
||
#include "battery.hpp" | ||
|
||
/** | ||
* @brief Battery values | ||
* | ||
*/ | ||
uint8_t battLevel = 0; | ||
uint8_t battLevelOld = 0; | ||
float batteryMax = 4.2; // maximum voltage of battery | ||
float batteryMin = 3.6; // minimum voltage of battery before shutdown | ||
Battery::Battery() {} | ||
|
||
/** | ||
* @brief Configure ADC Channel for battery reading | ||
* | ||
*/ | ||
void initADC() | ||
void Battery::initADC() | ||
{ | ||
// When VDD_A is 3.3V: | ||
// 0dB attenuation (ADC_ATTEN_DB_0) gives full-scale voltage 1.1V | ||
// 2.5dB attenuation (ADC_ATTEN_DB_2_5) gives full-scale voltage 1.5V | ||
// 6dB attenuation (ADC_ATTEN_DB_6) gives full-scale voltage 2.2V | ||
// 12dB attenuation (ADC_ATTEN_DB_12) gives full-scale voltage 3.9V | ||
|
||
#ifdef ADC1 | ||
#ifdef ADC1 | ||
adc1_config_width(ADC_WIDTH_BIT_12); | ||
adc1_config_channel_atten(BATT_PIN, ADC_ATTEN_DB_12); | ||
#endif | ||
adc1_config_channel_atten(BATT_PIN, ADC_ATTEN_DB_12); | ||
#endif | ||
|
||
#ifdef ADC2 | ||
#ifdef ADC2 | ||
adc2_config_channel_atten(BATT_PIN, ADC_ATTEN_DB_12); | ||
#endif | ||
#endif | ||
} | ||
|
||
/** | ||
* @brief Set battery voltage levels | ||
* | ||
* @param maxVoltage -> Full Charge voltage | ||
* @param minVoltage -> Min Charge voltage | ||
*/ | ||
void Battery::setBatteryLevels(float maxVoltage, float minVoltage) | ||
{ | ||
batteryMax = maxVoltage; | ||
batteryMin = minVoltage; | ||
} | ||
|
||
/** | ||
* @brief Read battery charge and return % | ||
* @brief Read battery charge and return %. | ||
* | ||
* @return float -> % Charge | ||
*/ | ||
float batteryRead() | ||
float Battery::readBattery() | ||
{ | ||
long sum = 0; // sum of samples taken | ||
float voltage = 0.0; // calculated voltage | ||
float output = 0.0; // output value | ||
for (int i = 0; i < 100; i++) | ||
{ | ||
long sum = 0; // Sum of samples taken | ||
float voltage = 0.0; // Calculated voltage | ||
float output = 0.0; // Output value | ||
|
||
for (int i = 0; i < 100; i++) | ||
{ | ||
#ifdef ADC1 | ||
sum += static_cast<long>(adc1_get_raw(BATT_PIN)); | ||
#endif | ||
|
||
#ifdef ADC2 | ||
int readRaw; | ||
esp_err_t r = adc2_get_raw(BATT_PIN, ADC_WIDTH_BIT_12, &readRaw); | ||
if (r == ESP_OK) | ||
sum += static_cast<long>(readRaw); | ||
#endif | ||
|
||
#ifdef ADC1 | ||
sum += (long)adc1_get_raw(BATT_PIN); | ||
#endif | ||
delayMicroseconds(150); | ||
} | ||
|
||
#ifdef ADC2 | ||
int readRaw; | ||
esp_err_t r = adc2_get_raw(BATT_PIN, ADC_WIDTH_BIT_12, &readRaw); | ||
if (r == ESP_OK) | ||
sum += (long)readRaw; | ||
#endif | ||
voltage = sum / 100.0; | ||
// Custom board has a divider circuit | ||
constexpr float R1 = 100000.0; // Resistance of R1 (100K) | ||
constexpr float R2 = 100000.0; // Resistance of R2 (100K) | ||
voltage = (voltage * V_REF) / 4096.0; | ||
voltage = voltage / (R2 / (R1 + R2)); | ||
voltage = roundf(voltage * 100) / 100; | ||
|
||
delayMicroseconds(150); | ||
} | ||
voltage = sum / (float)100; | ||
// custom board has a divider circuit | ||
float R1 = 100000.0; // resistance of R1 (100K) | ||
float R2 = 100000.0; // resistance of R2 (100K) | ||
voltage = (voltage * V_REF) / 4096.0; | ||
voltage = voltage / (R2 / (R1 + R2)); | ||
voltage = roundf(voltage * 100) / 100; | ||
output = ((voltage - batteryMin) / (batteryMax - batteryMin)) * 100; | ||
if (output <= 160) | ||
return output; | ||
else | ||
return 0.0f; | ||
output = ((voltage - batteryMin) / (batteryMax - batteryMin)) * 100; | ||
return (output <= 160) ? output : 0.0f; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
* @file battery.hpp | ||
* @author Jordi Gauchía ([email protected]) | ||
* @brief Battery monitor definition and functions | ||
* @version 0.1.8 | ||
* @date 2024-11 | ||
* @version 0.1.9 | ||
* @date 2024-12 | ||
*/ | ||
|
||
#ifndef BATTERY_HPP | ||
|
@@ -13,16 +13,19 @@ | |
#include <driver/adc.h> | ||
#include <esp_adc_cal.h> | ||
|
||
static esp_adc_cal_characteristics_t characteristics; | ||
#define V_REF 3.9 // ADC reference voltage | ||
class Battery | ||
{ | ||
private: | ||
float batteryMax; | ||
float batteryMin; | ||
static constexpr float V_REF = 3.9; // ADC reference voltage | ||
|
||
extern float batteryMax; // 4.2; // maximum voltage of battery | ||
extern float batteryMin; // 3.6; // minimum voltage of battery before shutdown | ||
public: | ||
Battery(); | ||
|
||
extern uint8_t battLevel; | ||
extern uint8_t battLevelOld; | ||
|
||
void initADC(); | ||
float batteryRead(); | ||
void initADC(); | ||
void setBatteryLevels(float maxVoltage, float minVoltage); | ||
float readBattery(); | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
* @file bme.cpp | ||
* @author Jordi Gauchía ([email protected]) | ||
* @brief BME280 Sensor functions | ||
* @version 0.1.8 | ||
* @date 2024-11 | ||
* @version 0.1.9 | ||
* @date 2024-12 | ||
*/ | ||
|
||
#include "bme.hpp" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
* @file bme.hpp | ||
* @author Jordi Gauchía ([email protected]) | ||
* @brief BME280 Sensor functions | ||
* @version 0.1.8 | ||
* @date 2024-11 | ||
* @version 0.1.9 | ||
* @date 2024-12 | ||
*/ | ||
|
||
#ifndef BME_HPP | ||
|
Oops, something went wrong.