diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index bd4b63e2..d4d87f2a 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -92,9 +92,9 @@ jobs:
- name: Copy of necessary files
run: |
cp platformio_orig.ini platformio.ini
- cp src/loraconf_sample.h src/loraconf.h
- cp src/ota_sample.conf src/ota.conf
- cp src/paxcounter_orig.conf src/paxcounter.conf
+ cp shared/loraconf_sample.h shared/loraconf.h
+ cp shared/ota_sample.conf shared/ota.conf
+ cp shared/paxcounter_orig.conf shared/paxcounter.conf
- name: Clean
run: pio run -t clean -e ci
- name: Run PlatformIO CI for ${{ matrix.board }}
@@ -143,9 +143,9 @@ jobs:
- name: Copy of necessary files
run: |
cp platformio_orig.ini platformio.ini
- cp src/loraconf_sample.h src/loraconf.h
- cp src/ota_sample.conf src/ota.conf
- cp src/paxcounter_orig.conf src/paxcounter.conf
+ cp shared/loraconf_sample.h shared/loraconf.h
+ cp shared/ota_sample.conf shared/ota.conf
+ cp shared/paxcounter_orig.conf shared/paxcounter.conf
- name: Clean
run: pio run -t clean -e ci
- name: Run PlatformIO CI for ${{ matrix.board }}
@@ -197,9 +197,9 @@ jobs:
- name: Copy of necessary files
run: |
cp platformio_orig_s3.ini platformio.ini
- cp src/loraconf_sample.h src/loraconf.h
- cp src/ota_sample.conf src/ota.conf
- cp src/paxcounter_orig.conf src/paxcounter.conf
+ cp shared/loraconf_sample.h shared/loraconf.h
+ cp shared/ota_sample.conf shared/ota.conf
+ cp shared/paxcounter_orig.conf shared/paxcounter.conf
- name: Clean
run: pio run -t clean -e ci
- name: Run PlatformIO CI for ${{ matrix.board }}
@@ -235,22 +235,22 @@ jobs:
- name: Prepare config files for test
run: |
cp platformio_orig.ini platformio.ini
- cp src/loraconf_sample.h src/loraconf.h
- cp src/ota_sample.conf src/ota.conf
- cp src/paxcounter_orig.conf src/paxcounter.conf
+ cp shared/loraconf_sample.h shared/loraconf.h
+ cp shared/ota_sample.conf shared/ota.conf
+ cp shared/paxcounter_orig.conf shared/paxcounter.conf
# apply test credentials to loraconf.h
- sed -i "s/APPEUI\[8\] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};/${{ secrets.APPEUI }}/" "src/loraconf.h"
- sed -i "s/APPKEY\[16\] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};/${{ secrets.APPKEY }}/" "src/loraconf.h"
+ sed -i "s/APPEUI\[8\] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};/${{ secrets.APPEUI }}/" "shared/loraconf.h"
+ sed -i "s/APPKEY\[16\] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};/${{ secrets.APPKEY }}/" "shared/loraconf.h"
# apply test credentials to ota.conf
- sed -i "/OTA_WIFI_SSID/c OTA_WIFI_SSID = ${{ secrets.OTA_WIFI_SSID }}" "src/ota.conf"
- sed -i "/OTA_WIFI_PASS/c OTA_WIFI_PASS = ${{ secrets.OTA_WIFI_PASS }}" "src/ota.conf"
- sed -i "/PAXEXPRESS_USER/c PAXEXPRESS_USER = ${{ secrets.PAXEXPRESS_USER }}" "src/ota.conf"
- sed -i "/PAXEXPRESS_REPO/c PAXEXPRESS_REPO = ${{ secrets.PAXEXPRESS_REPO }}" "src/ota.conf"
- sed -i "/PAXEXPRESS_API_TOKEN/c PAXEXPRESS_API_TOKEN = ${{ secrets.PAXEXPRESS_API_TOKEN }}" "src/ota.conf"
+ sed -i "/OTA_WIFI_SSID/c OTA_WIFI_SSID = ${{ secrets.OTA_WIFI_SSID }}" "shared/ota.conf"
+ sed -i "/OTA_WIFI_PASS/c OTA_WIFI_PASS = ${{ secrets.OTA_WIFI_PASS }}" "shared/ota.conf"
+ sed -i "/PAXEXPRESS_USER/c PAXEXPRESS_USER = ${{ secrets.PAXEXPRESS_USER }}" "shared/ota.conf"
+ sed -i "/PAXEXPRESS_REPO/c PAXEXPRESS_REPO = ${{ secrets.PAXEXPRESS_REPO }}" "shared/ota.conf"
+ sed -i "/PAXEXPRESS_API_TOKEN/c PAXEXPRESS_API_TOKEN = ${{ secrets.PAXEXPRESS_API_TOKEN }}" "shared/ota.conf"
- name: Build and deploy for testboard
env:
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}
- run: pio remote -a prenzlpi run -t upload -r
+ run: pio remote -a prenzlpi run -t upload
- name: Wait 120 seconds
run: sleep 120s
shell: bash
diff --git a/.gitignore b/.gitignore
index fa273fab..0bd3a0b4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,7 +10,7 @@
.vscode/.browse.c_cpp.db*
.clang_complete
.gcc-flags.json
-src/loraconf.h
-src/ota.conf
+shared/loraconf.h
+shared/ota.conf
platformio.ini
-src/paxcounter.conf
+shared/paxcounter.conf
diff --git a/docs/configuration/custom-sensors.md b/docs/configuration/custom-sensors.md
index 6f8516dc..12c96914 100644
--- a/docs/configuration/custom-sensors.md
+++ b/docs/configuration/custom-sensors.md
@@ -14,23 +14,23 @@ The following exampls show how to add a custom temperature and humidty sensor.
To use a custom sensor you first have to enable the Sensor which you want to use. For this you have to edit or add `HAS_SENSOR_1` in either the `paxcounter.conf` or the `hal` file of your board.
=== "Activate Sensor 1"
- ```c linenums="132" title="src/paxcounter_orig.conf"
+ ```c linenums="132" title="shared/paxcounter_orig.conf"
#define HAS_SENSOR_1 1
```
=== "Activate Sensor 2"
- ```c linenums="132" title="src/paxcounter_orig.conf"
+ ```c linenums="132" title="shared/paxcounter_orig.conf"
#define HAS_SENSOR_2 1
```
=== "Activate Sensor 3"
- ```c linenums="132" title="src/paxcounter_orig.conf"
+ ```c linenums="132" title="shared/paxcounter_orig.conf"
#define HAS_SENSOR_3 1
```
You might also add a constant for your custom sensor in the `paxcounter.conf` file. This is optional but can be used to identify the sensor type.
-```c linenums="133" title="src/paxcounter_orig.conf"
+```c linenums="133" title="shared/paxcounter_orig.conf"
#define HAS_GY21 1 // (1)
```
diff --git a/docs/configuration/index.md b/docs/configuration/index.md
index 0ed00637..55091431 100644
--- a/docs/configuration/index.md
+++ b/docs/configuration/index.md
@@ -14,24 +14,24 @@ You can add up to 3 user defined sensors. Insert your sensor's payload scheme in
For these peripherals no additional code is needed. To activate configure them in the board's hal file before building the code.
-See [`generic.h`](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/src/hal/generic.h) for all options and for proper configuration of BME280/BME680.
+See [`generic.h`](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/shared/hal/generic.h) for all options and for proper configuration of BME280/BME680.
=== "BME/ BMP Configuration"
- ```c linenums="37" title="src/hal/generic.h"
- --8<-- "src/hal/generic.h:37:49"
+ ```c linenums="37" title="shared/hal/generic.h"
+ --8<-- "shared/hal/generic.h:37:49"
```
=== "SDS011 Configuration"
- ```c linenums="51" title="src/hal/generic.h"
- --8<-- "src/hal/generic.h:51:56"
+ ```c linenums="51" title="shared/hal/generic.h"
+ --8<-- "shared/hal/generic.h:51:56"
```
=== "Custom Sensors Configuration"
- ```c linenums="57" title="src/hal/generic.h"
- --8<-- "src/hal/generic.h:57:60"
+ ```c linenums="57" title="shared/hal/generic.h"
+ --8<-- "shared/hal/generic.h:57:60"
```
=== "Complete `generic.h`"
- ```c linenums="1" title="src/hal/generic.h"
- --8<-- "src/hal/generic.h"
+ ```c linenums="1" title="shared/hal/generic.h"
+ --8<-- "shared/hal/generic.h"
```
Output of user sensor data can be switched by user remote control command `0x14` sent to Port 2.
@@ -51,8 +51,8 @@ Output of sensor and peripheral data is internally switched by a bitmask registe
\*) GPS data can also be combined with paxcounter payload on port 1, `#define GPSPORT 1` in paxcounter.conf to enable
-```c linenums="102" title="src/paxcounter_orig.conf"
---8<-- "src/paxcounter_orig.conf:102:102"
+```c linenums="102" title="shared/paxcounter_orig.conf"
+--8<-- "shared/paxcounter_orig.conf:102:102"
```
@@ -60,8 +60,8 @@ Output of sensor and peripheral data is internally switched by a bitmask registe
Paxcounter supports a battery friendly power saving mode. In this mode the device enters deep sleep, after all data is polled from all sensors and the dataset is completeley sent through all user configured channels (LORAWAN / SPI / MQTT / SD-Card). Set `#define SLEEPCYCLE` in paxcounter.conf to enable power saving mode and to specify the duration of a sleep cycle.
-```c linenums="20" title="src/paxcounter_orig.conf"
---8<-- "src/paxcounter_orig.conf:20:20"
+```c linenums="20" title="shared/paxcounter_orig.conf"
+--8<-- "shared/paxcounter_orig.conf:20:20"
```
@@ -73,14 +73,14 @@ Paxcounter supports a battery friendly power saving mode. In this mode the devic
Paxcounter can keep a time-of-day synced with external or on board time sources. Set `#define TIME_SYNC_INTERVAL` in `paxcounter.conf` to enable time sync.
-```c linenums="88" title="src/paxcounter_orig.conf"
---8<-- "src/paxcounter_orig.conf:88:88"
+```c linenums="88" title="shared/paxcounter_orig.conf"
+--8<-- "shared/paxcounter_orig.conf:88:88"
```
-Supported external time sources are GPS, LORAWAN network time and LORAWAN application timeserver time. Supported on board time sources are the RTC of ESP32 and a DS3231 RTC chip, both are kept sycned as fallback time sources. Time accuracy depends on board's time base which generates the pulse per second. Supported are GPS PPS, SQW output of RTC, and internal ESP32 hardware timer. Time base is selected by #defines in the board's hal file, see example in [`generic.h`](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/src/hal/generic.h).
+Supported external time sources are GPS, LORAWAN network time and LORAWAN application timeserver time. Supported on board time sources are the RTC of ESP32 and a DS3231 RTC chip, both are kept sycned as fallback time sources. Time accuracy depends on board's time base which generates the pulse per second. Supported are GPS PPS, SQW output of RTC, and internal ESP32 hardware timer. Time base is selected by #defines in the board's hal file, see example in [`generic.h`](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/shared/hal/generic.h).
-```c linenums="87" title="src/hal/generic.h"
---8<-- "src/hal/generic.h:87:96"
+```c linenums="87" title="shared/hal/generic.h"
+--8<-- "shared/hal/generic.h:87:96"
```
@@ -100,8 +100,8 @@ Paxcounter can be used to sync a wall clock which has a DCF77 or IF482 time tele
This describes how to set up a mobile PaxCounter:
Follow all steps so far for preparing the device, selecting the packed payload format. In `paxcounter.conf` set `PAYLOAD_OPENSENSEBOX` to `1`.
-```c linenums="60" title="src/paxcounter_orig.conf"
---8<-- "src/paxcounter_orig.conf:60:60"
+```c linenums="60" title="shared/paxcounter_orig.conf"
+--8<-- "shared/paxcounter_orig.conf:60:60"
```
Register a new sensebox on [https://opensensemap.org/](https://opensensemap.org). In the sensor configuration select "TheThingsNetwork" and set decoding profile to "LoRa serialization". Enter your TTN Application and Device ID. Setup decoding option using:
@@ -112,7 +112,7 @@ This describes how to set up a mobile PaxCounter:
Follow all steps so far fo
## SD-card
-Data can be stored on SD-card if the board provides an SD card interface, either with SPI or MMC mode. To enable this feature, specify interface mode and hardware pins in board's hal file (`src/hal/`):
+Data can be stored on a FAT32 (pre-)formatted SD-card if the board provides an SD card interface, either with SPI or MMC mode. To enable this feature, specify interface mode and hardware pins in board's hal file (`shared/hal/`):
```c
#define HAS_SDCARD 1 // SD-card interface, using SPI mode
@@ -126,10 +126,10 @@ Data can be stored on SD-card if the board provides an SD card interface, either
#define SDCARD_SCLK (14)
```
-This is an example of a board with MMC SD-card interface: [https://www.aliexpress.com/item/32915894264.html](https://www.aliexpress.com/item/32915894264.html). For this board use file [`src/hal/ttgov21new.h`](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/src/hal/ttgov21new.h) and add the lines given above.
+This is an example of a board with MMC SD-card interface: [https://www.aliexpress.com/item/32915894264.html](https://www.aliexpress.com/item/32915894264.html). For this board use file [`shared/hal/ttgov21new.h`](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/shared/hal/ttgov21new.h) and add the lines given above.
Another approach would be this tiny board: [https://www.aliexpress.com/item/32424558182.html](https://www.aliexpress.com/item/32424558182.html) (needs 5V).
-In this case you choose the correct file for your ESP32-board in the src/hal-directory and add the lines given above. Edit the pin numbers given in the example, according to your wiring.
+In this case you choose the correct file for your ESP32-board in the shared/hal-directory and add the lines given above. Edit the pin numbers given in the example, according to your wiring.
Data is written on SD-card to a single file. After 3 write operations the data is flushed to the disk to minimize flash write cycles. Thus, up to the last 3 records of data will get lost when the Paxcounter looses power during operation.
@@ -147,6 +147,6 @@ If you want to change this, modify `src/sdcard.cpp` and `include/sdcard.h`.
Additionally, it's possible to redirect system console output to a plain text file on SD card. This can be useful for debugging headless devices in the field. In `paxcounter.conf` set `SDLOGGING` to `1`.
-```c linenums="16" title="src/paxcounter_orig.conf"
---8<-- "src/paxcounter_orig.conf:16:16"
-```
\ No newline at end of file
+```c linenums="16" title="shared/paxcounter_orig.conf"
+--8<-- "shared/paxcounter_orig.conf:16:16"
+```
diff --git a/docs/getting-started.md b/docs/getting-started.md
index c2e09a8d..da03ef58 100644
--- a/docs/getting-started.md
+++ b/docs/getting-started.md
@@ -41,15 +41,15 @@ Edit `platformio_orig.ini` (for ESP32 CPU based boards) *or* `platformio_orig_s3
## paxcounter.conf
-Edit `src/paxcounter_orig.conf` and tailor settings in this file according to your needs and use case. Please take care of the duty cycle regulations of the LoRaWAN network you're going to use. Copy or rename to `src/paxcounter.conf`.
+Edit `shared/paxcounter_orig.conf` and tailor settings in this file according to your needs and use case. Please take care of the duty cycle regulations of the LoRaWAN network you're going to use. Copy or rename to `shared/paxcounter.conf`.
=== "Copy"
``` bash
- cp src/paxcounter_orig.conf src/paxcounter.conf
+ cp shared/paxcounter_orig.conf shared/paxcounter.conf
```
=== "Rename"
``` bash
- mv src/paxcounter_orig.conf src/paxcounter.conf
+ mv shared/paxcounter_orig.conf shared/paxcounter.conf
```
@@ -58,52 +58,52 @@ Edit `src/paxcounter_orig.conf` and tailor settings in this file according to yo
If your device has a **real time clock** it can be updated by either LoRaWAN network or GPS time, according to settings *TIME_SYNC_INTERVAL* and *TIME_SYNC_LORAWAN* in `paxcounter.conf`.
```c linenums="85" title="paxcounter.conf"
---8<-- "src/paxcounter_orig.conf:85:85"
+--8<-- "shared/paxcounter_orig.conf:85:85"
```
-## src/lmic_config.h
-Edit `src/lmic_config.h` and tailor settings in this file according to your country and device hardware. Please take care of national regulations when selecting the frequency band for LoRaWAN.
+## shared/lmic_config.h
+Edit `shared/lmic_config.h` and tailor settings in this file according to your country and device hardware. Please take care of national regulations when selecting the frequency band for LoRaWAN.
-```c linenums="9" title="national regulations in src/lmic_config.h "
---8<-- "src/lmic_config.h:9:18"
+```c linenums="9" title="national regulations in shared/lmic_config.h "
+--8<-- "shared/lmic_config.h:9:18"
```
-## src/loraconf.h
-Create file `src/loraconf.h` using the template [src/loraconf_sample.h](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/src/loraconf_sample.h) and adjust settings to use your personal values. To join the network and activate your paxcounter, you must configure either OTAA or ABP join method. You should use OTAA, whenever possible. To understand the differences of the two methods, [this article](https://www.thethingsnetwork.org/docs/devices/registration.html) may be useful.
+## shared/loraconf.h
+Create file `shared/loraconf.h` using the template [shared/loraconf_sample.h](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/shared/loraconf_sample.h) and adjust settings to use your personal values. To join the network and activate your paxcounter, you must configure either OTAA or ABP join method. You should use OTAA, whenever possible. To understand the differences of the two methods, [this article](https://www.thethingsnetwork.org/docs/devices/registration.html) may be useful.
=== "Copy"
``` bash
- cp src/loraconf_sample.h src/loraconf.h
+ cp shared/loraconf_sample.h shared/loraconf.h
```
=== "Rename"
``` bash
- mv src/loraconf_sample.h src/loraconf.h
+ mv shared/loraconf_sample.h shared/loraconf.h
```
-To configure OTAA, leave `#define LORA_ABP` deactivated (commented). To use ABP, activate (uncomment) `#define LORA_ABP` in the file `src/loraconf.h`.
-The file `src/loraconf_sample.h` contains more information about the values to provide.
+To configure OTAA, leave `#define LORA_ABP` deactivated (commented). To use ABP, activate (uncomment) `#define LORA_ABP` in the file `shared/loraconf.h`.
+The file `shared/loraconf_sample.h` contains more information about the values to provide.
=== "Activate OTAA (Default), Deactivate ABP"
- ``` c linenums="18" title="src/loraconf.h"
- --8<-- "src/loraconf_sample.h:18:18"
+ ``` c linenums="18" title="shared/loraconf.h"
+ --8<-- "shared/loraconf_sample.h:18:18"
```
=== "Deactivate OTAA, Activate ABP"
- ``` c linenums="18" title="src/loraconf.h"
+ ``` c linenums="18" title="shared/loraconf.h"
#define LORA_ABP
```
-## src/ota.conf
-Create file `src/ota.conf` using the template [src/ota_sample.conf](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/src/ota_sample.conf) and enter your WIFI network & key. These settings are used for downloading updates via WiFi, either from a remote https server, or locally via WebUI. If you want to use a remote server, you need a PAX.express repository. Enter your PAX.express credentials in ota.conf. If you don't need wireless firmware updates just rename ota.sample.conf to ota.conf.
+## shared/ota.conf
+Create file `shared/ota.conf` using the template [shared/ota_sample.conf](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/shared/ota_sample.conf) and enter your WIFI network & key. These settings are used for downloading updates via WiFi, either from a remote https server, or locally via WebUI. If you want to use a remote server, you need a PAX.express repository. Enter your PAX.express credentials in ota.conf. If you don't need wireless firmware updates just rename ota.sample.conf to ota.conf.
=== "Copy"
``` bash
- cp src/ota_sample.conf src/ota.conf
+ cp shared/ota_sample.conf shared/ota.conf
```
=== "Rename"
``` bash
- mv src/ota_sample.conf src/ota.conf
+ mv shared/ota_sample.conf shared/ota.conf
```
# Building
diff --git a/docs/hardware.md b/docs/hardware.md
index 57a8a588..b50842b7 100644
--- a/docs/hardware.md
+++ b/docs/hardware.md
@@ -24,7 +24,7 @@ LoLin32lite + [LoraNode32-Lite shield](https://github.com/hallard/LoLin32-Lite-L
- TTGO: [T-Wristband](https://www.aliexpress.com/item/4000527495064.html)
- Generic ESP32
-*) supports microSD/TF-card for local logging of paxcounter data
+*) supports microSD/TF-card for local logging of paxcounter data. SD/TF-card must be FAT32 formatted.
Depending on board hardware following features are supported:
@@ -45,7 +45,7 @@ Depending on board hardware following features are supported:
- SD-card (see section SD-card here) for logging pax data
Target platform must be selected in `platformio.ini`.
-Hardware dependent settings (pinout etc.) are stored in board files in [/hal](https://github.com/cyberman54/ESP32-Paxcounter/tree/master/src/hal) directory. If you want to use a ESP32 board which is not yet supported, use hal file generic.h and tailor pin mappings to your needs. Pull requests for new boards welcome.
+Hardware dependent settings (pinout etc.) are stored in board files in [/shared/hal](https://github.com/cyberman54/ESP32-Paxcounter/tree/master/shared/hal) directory. If you want to use a ESP32 board which is not yet supported, use hal file generic.h and tailor pin mappings to your needs. Pull requests for new boards welcome.
### 3D printed cases
Some 3D printable cases can be found (and, if wanted so, ordered) on Thingiverse, see
@@ -73,4 +73,4 @@ By default, bluetooth sniffing is not started. If you enable bluetooth be aware
``` c linenums="29" title="paxcounter.conf"
#define BLECOUNTER 1
- ```
\ No newline at end of file
+ ```
diff --git a/docs/payloadformat.md b/docs/payloadformat.md
index 18dbd8fb..393ce2a4 100644
--- a/docs/payloadformat.md
+++ b/docs/payloadformat.md
@@ -1,7 +1,7 @@
# Payload format
-You can select different payload formats in [`paxcounter.conf`](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/src/paxcounter_orig.conf):
+You can select different payload formats in [`paxcounter.conf`](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/shared/paxcounter_orig.conf):
- ***Plain*** uses big endian format and generates json fields, e.g. useful for TTN console
@@ -10,8 +10,8 @@ You can select different payload formats in [`paxcounter.conf`](https://github.c
- [***CayenneLPP***](https://developers.mydevices.com/cayenne/docs/lora/#lora-cayenne-low-power-payload) generates MyDevices Cayenne readable fields
-```c linenums="20" title="src/paxcounter_orig.conf"
---8<-- "src/paxcounter_orig.conf:20:20"
+```c linenums="20" title="shared/paxcounter_orig.conf"
+--8<-- "shared/paxcounter_orig.conf:20:20"
```
diff --git a/include/globals.h b/include/globals.h
index 78e633b5..dc7316b9 100644
--- a/include/globals.h
+++ b/include/globals.h
@@ -6,6 +6,7 @@
// Time functions
#ifdef HAS_RTC
+#include
#include
#endif
#include
diff --git a/include/gpsread.h b/include/gpsread.h
index 6eae7bb7..cb234eb1 100644
--- a/include/gpsread.h
+++ b/include/gpsread.h
@@ -4,7 +4,6 @@
#if (HAS_GPS)
#include // library for parsing NMEA data
-#include
#include "timekeeper.h"
#ifndef GPS_BAUDRATE
diff --git a/platformio_orig.ini b/platformio_orig.ini
index 9e5ad5b8..58de5052 100644
--- a/platformio_orig.ini
+++ b/platformio_orig.ini
@@ -51,11 +51,11 @@ release_version = 3.6.0
; DEBUG LEVEL: For production run set to 0, otherwise device will leak RAM while running!
; 0=None, 1=Error, 2=Warn, 3=Info, 4=Debug, 5=Verbose
debug_level = 3
-extra_scripts = pre:src/build.py
+extra_scripts = pre:shared/build.py
otakeyfile = ota.conf
lorakeyfile = loraconf.h
lmicconfigfile = lmic_config.h
-platform_espressif32 = espressif32@6.3.1
+platform_espressif32 = espressif32@6.3.2
monitor_speed = 115200
upload_speed = 115200 ; set by build.py and taken from hal file
lib_deps_lora =
@@ -93,7 +93,7 @@ lib_deps_all =
${common.lib_deps_sensors}
${common.lib_deps_ledmatrix}
build_flags_all =
- -include "src/paxcounter.conf"
+ -include "shared/paxcounter.conf"
'-D CORE_DEBUG_LEVEL=${common.debug_level}'
'-D LOG_LOCAL_LEVEL=${common.debug_level}'
'-D PROGVERSION="${common.release_version}"'
@@ -114,7 +114,7 @@ upload_speed = ${common.upload_speed}
platform = ${common.platform_espressif32}
lib_deps = ${common.lib_deps_all}
build_flags =
- -include "src/hal/${board.halfile}"
+ -include "shared/hal/${board.halfile}"
${common.build_flags_all}
extra_scripts = ${common.extra_scripts}
monitor_speed = ${common.monitor_speed}
@@ -138,6 +138,6 @@ platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/
[env:ci]
build_flags =
- -include "src/hal/${sysenv.CI_HALFILE}" ; set by CI
+ -include "shared/hal/${sysenv.CI_HALFILE}" ; set by CI
${common.build_flags_all}
upload_protocol = esptool
diff --git a/platformio_orig_s3.ini b/platformio_orig_s3.ini
index 0d43c89e..b7c45e6a 100644
--- a/platformio_orig_s3.ini
+++ b/platformio_orig_s3.ini
@@ -14,11 +14,11 @@ release_version = 3.6.0
; DEBUG LEVEL: For production run set to 0, otherwise device will leak RAM while running!
; 0=None, 1=Error, 2=Warn, 3=Info, 4=Debug, 5=Verbose
debug_level = 3
-extra_scripts = pre:src/build.py
+extra_scripts = pre:shared/build.py
otakeyfile = ota.conf
lorakeyfile = loraconf.h
lmicconfigfile = lmic_config.h
-platform_espressif32 = espressif32@6.3.1
+platform_espressif32 = espressif32@6.3.2
monitor_speed = 115200
upload_speed = 115200 ; set by build.py and taken from hal file
lib_deps_all =
@@ -32,7 +32,7 @@ lib_deps_all =
256dpi/MQTT @ ^2.5.1
ricmoo/QRCode @ ^0.0.1
build_flags_all =
- -include "src/paxcounter.conf"
+ -include "shared/paxcounter.conf"
'-D CORE_DEBUG_LEVEL=${common.debug_level}'
'-D LOG_LOCAL_LEVEL=${common.debug_level}'
'-D PROGVERSION="${common.release_version}"'
@@ -53,7 +53,7 @@ upload_speed = ${common.upload_speed}
platform = ${common.platform_espressif32}
lib_deps = ${common.lib_deps_all}
build_flags =
- -include "src/hal/${board.halfile}"
+ -include "shared/hal/${board.halfile}"
${common.build_flags_all}
extra_scripts = ${common.extra_scripts}
monitor_speed = ${common.monitor_speed}
@@ -64,6 +64,6 @@ upload_protocol = esptool
[env:ci]
build_flags =
- -include "src/hal/${sysenv.CI_HALFILE}" ; set by CI
+ -include "shared/hal/${sysenv.CI_HALFILE}" ; set by CI
${common.build_flags_all}
upload_protocol = esptool
\ No newline at end of file
diff --git a/src/build.py b/shared/build.py
similarity index 89%
rename from src/build.py
rename to shared/build.py
index e6bd6b50..0261f910 100644
--- a/src/build.py
+++ b/shared/build.py
@@ -19,11 +19,14 @@ env = DefaultEnvironment()
config = configparser.ConfigParser()
config.read("platformio.ini")
-# get platformio source path
-srcdir = env.get("PROJECT_SRC_DIR")
+# get platformio project directory
+prjdir = env.get("PROJECT_DIR")
+
+# get platformio shared path
+shareddir = os.path.join (prjdir, "shared")
# get hal path
-haldir = os.path.join (srcdir, "hal")
+haldir = os.path.join (shareddir, "hal")
# check if hal file is present in source directory
halconfig = config.get("board", "halfile")
@@ -42,23 +45,23 @@ if os.path.isfile(halconfigfile) and os.access(halconfigfile, os.R_OK):
else:
sys.exit("Missing file " + halconfigfile + ", please create it! Aborting.")
-# check if lmic config file is present in source directory
+# check if lmic config file is present in shared directory
lmicconfig = config.get("common", "lmicconfigfile")
-lmicconfigfile = os.path.join (srcdir, lmicconfig)
+lmicconfigfile = os.path.join (shareddir, lmicconfig)
if os.path.isfile(lmicconfigfile) and os.access(lmicconfigfile, os.R_OK):
print("Parsing LMIC configuration from " + lmicconfigfile)
else:
sys.exit("Missing file " + lmicconfigfile + ", please create it! Aborting.")
-# check if lora key file is present in source directory
-lorakeyfile = os.path.join (srcdir, config.get("common", "lorakeyfile"))
+# check if lora key file is present in shared directory
+lorakeyfile = os.path.join (shareddir, config.get("common", "lorakeyfile"))
if os.path.isfile(lorakeyfile) and os.access(lorakeyfile, os.R_OK):
print("Parsing LORAWAN keys from " + lorakeyfile)
else:
sys.exit("Missing file " + lorakeyfile + ", please create it! Aborting.")
-# check if ota key file is present in source directory
-otakeyfile = os.path.join (srcdir, config.get("common", "otakeyfile"))
+# check if ota key file is present in shared directory
+otakeyfile = os.path.join (shareddir, config.get("common", "otakeyfile"))
if os.path.isfile(otakeyfile) and os.access(otakeyfile, os.R_OK):
print("Parsing OTA keys from " + otakeyfile)
else:
@@ -113,7 +116,7 @@ env.Append(BUILD_FLAGS=[
u'-DPAXEXPRESS_REPO=\\"' + mykeys["PAXEXPRESS_REPO"] + '\\"',
u'-DPAXEXPRESS_PACKAGE=\\"' + package + '\\"',
u'-DARDUINO_LMIC_PROJECT_CONFIG_H=' + lmicconfig,
- u'-I \"' + srcdir + '\"'
+ u'-I \"' + shareddir + '\"'
])
# function for pushing new firmware to paxexpress storage using API
diff --git a/src/hal/ebox.h b/shared/hal/ebox.h
similarity index 100%
rename from src/hal/ebox.h
rename to shared/hal/ebox.h
diff --git a/src/hal/eboxtube.h b/shared/hal/eboxtube.h
similarity index 100%
rename from src/hal/eboxtube.h
rename to shared/hal/eboxtube.h
diff --git a/src/hal/ecopower.h b/shared/hal/ecopower.h
similarity index 100%
rename from src/hal/ecopower.h
rename to shared/hal/ecopower.h
diff --git a/src/hal/fipy.h b/shared/hal/fipy.h
similarity index 96%
rename from src/hal/fipy.h
rename to shared/hal/fipy.h
index dd8a5da5..4a6c6a42 100644
--- a/src/hal/fipy.h
+++ b/shared/hal/fipy.h
@@ -1,34 +1,34 @@
-// clang-format off
-// upload_speed 921600
-// board esp32dev
-
-#ifndef _FIPY_H
-#define _FIPY_H
-
-#include
-
-// Hardware related definitions for Pycom FiPy Board
-
-#define HAS_LORA 1 // comment out if device shall not send data via LoRa
-
-#define CFG_sx1272_radio 1
-#define HAS_LED NOT_A_PIN // FiPy has no on board LED, so we use RGB LED
-#define RGB_LED_COUNT 1 // we have 1 LED
-#define HAS_RGB_LED FastLED.addLeds(leds, RGB_LED_COUNT);
-#define BOARD_HAS_PSRAM // use extra 4MB extern RAM
-
-// Pins for LORA chip SPI interface, reset line and interrupt lines
-#define LORA_SCK (5)
-#define LORA_CS (18)
-#define LORA_MISO (19)
-#define LORA_MOSI (27)
-#define LORA_RST LMIC_UNUSED_PIN
-#define LORA_IRQ (23) // LoRa IRQ
-#define LORA_IO1 (23) // Pin tied via diode to DIO0
-#define LORA_IO2 LMIC_UNUSED_PIN
-
-// select WIFI antenna (internal = onboard / external = u.fl socket)
-#define HAS_ANTENNA_SWITCH GPIO_NUM_21 // pin for switching wifi antenna
-#define WIFI_ANTENNA 0 // 0 = internal, 1 = external
-
-#endif
+// clang-format off
+// upload_speed 921600
+// board esp32dev
+
+#ifndef _FIPY_H
+#define _FIPY_H
+
+#include
+
+// Hardware related definitions for Pycom FiPy Board
+
+#define HAS_LORA 1 // comment out if device shall not send data via LoRa
+
+#define CFG_sx1272_radio 1
+#define HAS_LED NOT_A_PIN // FiPy has no on board LED, so we use RGB LED
+#define RGB_LED_COUNT 1 // we have 1 LED
+#define HAS_RGB_LED FastLED.addLeds(leds, RGB_LED_COUNT);
+#define BOARD_HAS_PSRAM // use extra 4MB extern RAM
+
+// Pins for LORA chip SPI interface, reset line and interrupt lines
+#define LORA_SCK (5)
+#define LORA_CS (18)
+#define LORA_MISO (19)
+#define LORA_MOSI (27)
+#define LORA_RST LMIC_UNUSED_PIN
+#define LORA_IRQ (23) // LoRa IRQ
+#define LORA_IO1 (23) // Pin tied via diode to DIO0
+#define LORA_IO2 LMIC_UNUSED_PIN
+
+// select WIFI antenna (internal = onboard / external = u.fl socket)
+#define HAS_ANTENNA_SWITCH GPIO_NUM_21 // pin for switching wifi antenna
+#define WIFI_ANTENNA 0 // 0 = internal, 1 = external
+
+#endif
diff --git a/src/hal/generic.h b/shared/hal/generic.h
similarity index 100%
rename from src/hal/generic.h
rename to shared/hal/generic.h
diff --git a/src/hal/heltec.h b/shared/hal/heltec.h
similarity index 100%
rename from src/hal/heltec.h
rename to shared/hal/heltec.h
diff --git a/src/hal/heltecv2.h b/shared/hal/heltecv2.h
similarity index 100%
rename from src/hal/heltecv2.h
rename to shared/hal/heltecv2.h
diff --git a/src/hal/heltecv21.h b/shared/hal/heltecv21.h
similarity index 100%
rename from src/hal/heltecv21.h
rename to shared/hal/heltecv21.h
diff --git a/src/hal/lolin32lite.h b/shared/hal/lolin32lite.h
similarity index 100%
rename from src/hal/lolin32lite.h
rename to shared/hal/lolin32lite.h
diff --git a/src/hal/lolin32litelora.h b/shared/hal/lolin32litelora.h
similarity index 100%
rename from src/hal/lolin32litelora.h
rename to shared/hal/lolin32litelora.h
diff --git a/src/hal/lolin32lora.h b/shared/hal/lolin32lora.h
similarity index 100%
rename from src/hal/lolin32lora.h
rename to shared/hal/lolin32lora.h
diff --git a/src/hal/lopy.h b/shared/hal/lopy.h
similarity index 100%
rename from src/hal/lopy.h
rename to shared/hal/lopy.h
diff --git a/src/hal/lopy4.h b/shared/hal/lopy4.h
similarity index 100%
rename from src/hal/lopy4.h
rename to shared/hal/lopy4.h
diff --git a/src/hal/m5core.h b/shared/hal/m5core.h
similarity index 100%
rename from src/hal/m5core.h
rename to shared/hal/m5core.h
diff --git a/src/hal/m5fire.h b/shared/hal/m5fire.h
similarity index 100%
rename from src/hal/m5fire.h
rename to shared/hal/m5fire.h
diff --git a/src/hal/octopus32.h b/shared/hal/octopus32.h
similarity index 100%
rename from src/hal/octopus32.h
rename to shared/hal/octopus32.h
diff --git a/src/hal/olimexpoeiso.h b/shared/hal/olimexpoeiso.h
similarity index 100%
rename from src/hal/olimexpoeiso.h
rename to shared/hal/olimexpoeiso.h
diff --git a/src/hal/tinypico.h b/shared/hal/tinypico.h
similarity index 100%
rename from src/hal/tinypico.h
rename to shared/hal/tinypico.h
diff --git a/src/hal/tinypicomatrix.h b/shared/hal/tinypicomatrix.h
similarity index 100%
rename from src/hal/tinypicomatrix.h
rename to shared/hal/tinypicomatrix.h
diff --git a/src/hal/ttgobeam.h b/shared/hal/ttgobeam.h
similarity index 100%
rename from src/hal/ttgobeam.h
rename to shared/hal/ttgobeam.h
diff --git a/src/hal/ttgobeam10.h b/shared/hal/ttgobeam10.h
similarity index 100%
rename from src/hal/ttgobeam10.h
rename to shared/hal/ttgobeam10.h
diff --git a/src/hal/ttgofox.h b/shared/hal/ttgofox.h
similarity index 100%
rename from src/hal/ttgofox.h
rename to shared/hal/ttgofox.h
diff --git a/src/hal/ttgotdisplay.h b/shared/hal/ttgotdisplay.h
similarity index 100%
rename from src/hal/ttgotdisplay.h
rename to shared/hal/ttgotdisplay.h
diff --git a/src/hal/ttgotdisplays3.h b/shared/hal/ttgotdisplays3.h
similarity index 100%
rename from src/hal/ttgotdisplays3.h
rename to shared/hal/ttgotdisplays3.h
diff --git a/src/hal/ttgotdongledisplays3.h b/shared/hal/ttgotdongledisplays3.h
similarity index 100%
rename from src/hal/ttgotdongledisplays3.h
rename to shared/hal/ttgotdongledisplays3.h
diff --git a/src/hal/ttgotdongles3.h b/shared/hal/ttgotdongles3.h
similarity index 100%
rename from src/hal/ttgotdongles3.h
rename to shared/hal/ttgotdongles3.h
diff --git a/src/hal/ttgotwristband.h b/shared/hal/ttgotwristband.h
similarity index 100%
rename from src/hal/ttgotwristband.h
rename to shared/hal/ttgotwristband.h
diff --git a/src/hal/ttgov1.h b/shared/hal/ttgov1.h
similarity index 100%
rename from src/hal/ttgov1.h
rename to shared/hal/ttgov1.h
diff --git a/src/hal/ttgov2.h b/shared/hal/ttgov2.h
similarity index 100%
rename from src/hal/ttgov2.h
rename to shared/hal/ttgov2.h
diff --git a/src/hal/ttgov21new.h b/shared/hal/ttgov21new.h
similarity index 100%
rename from src/hal/ttgov21new.h
rename to shared/hal/ttgov21new.h
diff --git a/src/hal/ttgov21old.h b/shared/hal/ttgov21old.h
similarity index 100%
rename from src/hal/ttgov21old.h
rename to shared/hal/ttgov21old.h
diff --git a/src/hal/wemos32matrix.h b/shared/hal/wemos32matrix.h
similarity index 100%
rename from src/hal/wemos32matrix.h
rename to shared/hal/wemos32matrix.h
diff --git a/src/hal/wemos32oled.h b/shared/hal/wemos32oled.h
similarity index 100%
rename from src/hal/wemos32oled.h
rename to shared/hal/wemos32oled.h
diff --git a/src/lmic_config.h b/shared/lmic_config.h
similarity index 100%
rename from src/lmic_config.h
rename to shared/lmic_config.h
diff --git a/src/loraconf_sample.h b/shared/loraconf_sample.h
similarity index 98%
rename from src/loraconf_sample.h
rename to shared/loraconf_sample.h
index 093d73aa..4f367600 100644
--- a/src/loraconf_sample.h
+++ b/shared/loraconf_sample.h
@@ -7,7 +7,7 @@
* LMIC LoRaWAN configuration
*
* Read the values from TTN console (or whatever applies), insert them here,
- * and rename this file to src/loraconf.h
+ * and rename this file to shared/loraconf.h
*
* You can configure OTAA or ABP Activation. In order to use ABP, uncomment
* (enable) the following line, but you should only do so, if you have good
diff --git a/src/ota_sample.conf b/shared/ota_sample.conf
similarity index 100%
rename from src/ota_sample.conf
rename to shared/ota_sample.conf
diff --git a/src/paxcounter_orig.conf b/shared/paxcounter_orig.conf
similarity index 100%
rename from src/paxcounter_orig.conf
rename to shared/paxcounter_orig.conf
diff --git a/src/lorawan.cpp b/src/lorawan.cpp
index a8ca9547..6fafcd14 100644
--- a/src/lorawan.cpp
+++ b/src/lorawan.cpp
@@ -266,7 +266,7 @@ esp_err_t lmic_init(void) {
// This tells LMIC to make the receive windows bigger, in case your clock is
// faster or slower. This causes the transceiver to be earlier switched on,
// so consuming more power. You may sharpen (reduce) CLOCK_ERROR_PERCENTAGE
-// in src/lmic_config.h if you are limited on battery.
+// in shared/lmic_config.h if you are limited on battery.
#ifdef CLOCK_ERROR_PROCENTAGE
LMIC_setClockError(CLOCK_ERROR_PROCENTAGE * MAX_CLOCK_ERROR / 1000);
#endif