commit
27c8b13fff
@ -9,6 +9,7 @@ Tutorial (in german language): https://www.heise.de/select/make/2019/1/155109923
|
|||||||
<img src="img/Paxcounter-Screen.png">
|
<img src="img/Paxcounter-Screen.png">
|
||||||
<img src="img/TTGO-case.jpg">
|
<img src="img/TTGO-case.jpg">
|
||||||
<img src="img/TTGO-curves.jpg">
|
<img src="img/TTGO-curves.jpg">
|
||||||
|
<img src="img/Paxcounter-LEDmatrix.jpg">
|
||||||
|
|
||||||
# Use case
|
# Use case
|
||||||
|
|
||||||
@ -54,7 +55,7 @@ Depending on board hardware following features are supported:
|
|||||||
- Real Time Clock (Maxim DS3231 I2C)
|
- Real Time Clock (Maxim DS3231 I2C)
|
||||||
- IF482 (serial) and DCF77 (gpio) time telegram generator
|
- IF482 (serial) and DCF77 (gpio) time telegram generator
|
||||||
- Switch external power / battery
|
- Switch external power / battery
|
||||||
- 64x16 pixel LED Matrix display (similar to [this model](https://www.instructables.com/id/64x16-RED-LED-Marquee/))
|
- 64x16 pixel LED Matrix display (similar to [this model](https://www.instructables.com/id/64x16-RED-LED-Marquee/), can be ordered on [Aliexpress](https://www.aliexpress.com/item/P3-75-dot-matrix-led-module-3-75mm-high-clear-top1-for-text-display-304-60mm/32616683948.html))
|
||||||
|
|
||||||
Target platform must be selected in [platformio.ini](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/platformio.ini).<br>
|
Target platform must be selected in [platformio.ini](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/platformio.ini).<br>
|
||||||
Hardware dependent settings (pinout etc.) are stored in board files in /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.<br>
|
Hardware dependent settings (pinout etc.) are stored in board files in /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.<br>
|
||||||
@ -93,7 +94,7 @@ If your device has a **real time clock** it can be updated bei either LoRaWAN ne
|
|||||||
|
|
||||||
# Building
|
# Building
|
||||||
|
|
||||||
Use <A HREF="https://platformio.org/">PlatformIO</A> with your preferred IDE for development and building this code. Make sure you have latest PlatformIO version, **at least v4.0.0a15**.
|
Use <A HREF="https://platformio.org/">PlatformIO</A> with your preferred IDE for development and building this code. Make sure you have latest PlatformIO version.
|
||||||
|
|
||||||
# Uploading
|
# Uploading
|
||||||
|
|
||||||
|
35
build.py
35
build.py
@ -8,16 +8,22 @@ import requests
|
|||||||
from os.path import basename
|
from os.path import basename
|
||||||
from platformio import util
|
from platformio import util
|
||||||
|
|
||||||
|
try:
|
||||||
|
import configparser
|
||||||
|
except ImportError:
|
||||||
|
import ConfigParser as configparser
|
||||||
|
|
||||||
Import("env")
|
Import("env")
|
||||||
|
|
||||||
# get platformio environment variables
|
# get platformio environment variables
|
||||||
project_config = util.load_project_config()
|
config = configparser.ConfigParser()
|
||||||
|
config.read("platformio.ini")
|
||||||
|
|
||||||
# get platformio source path
|
# get platformio source path
|
||||||
srcdir = env.get("PROJECTSRC_DIR").replace("\\", "/")
|
srcdir = env.get("PROJECTSRC_DIR")
|
||||||
|
|
||||||
# check if lmic config file is present in source directory
|
# check if lmic config file is present in source directory
|
||||||
lmicconfig = project_config.get("common", "lmicconfigfile")
|
lmicconfig = config.get("common", "lmicconfigfile")
|
||||||
lmicconfigfile = os.path.join (srcdir, lmicconfig)
|
lmicconfigfile = os.path.join (srcdir, lmicconfig)
|
||||||
if os.path.isfile(lmicconfigfile) and os.access(lmicconfigfile, os.R_OK):
|
if os.path.isfile(lmicconfigfile) and os.access(lmicconfigfile, os.R_OK):
|
||||||
print "Parsing LMIC configuration from " + lmicconfigfile
|
print "Parsing LMIC configuration from " + lmicconfigfile
|
||||||
@ -25,14 +31,14 @@ else:
|
|||||||
sys.exit("Missing file " + lmicconfigfile + ", please create it! Aborting.")
|
sys.exit("Missing file " + lmicconfigfile + ", please create it! Aborting.")
|
||||||
|
|
||||||
# check if lora key file is present in source directory
|
# check if lora key file is present in source directory
|
||||||
lorakeyfile = os.path.join (srcdir, project_config.get("common", "lorakeyfile"))
|
lorakeyfile = os.path.join (srcdir, config.get("common", "lorakeyfile"))
|
||||||
if os.path.isfile(lorakeyfile) and os.access(lorakeyfile, os.R_OK):
|
if os.path.isfile(lorakeyfile) and os.access(lorakeyfile, os.R_OK):
|
||||||
print "Parsing LORAWAN keys from " + lorakeyfile
|
print "Parsing LORAWAN keys from " + lorakeyfile
|
||||||
else:
|
else:
|
||||||
sys.exit("Missing file " + lorakeyfile + ", please create it! Aborting.")
|
sys.exit("Missing file " + lorakeyfile + ", please create it! Aborting.")
|
||||||
|
|
||||||
# check if ota key file is present in source directory
|
# check if ota key file is present in source directory
|
||||||
otakeyfile = os.path.join (srcdir, project_config.get("common", "otakeyfile"))
|
otakeyfile = os.path.join (srcdir, config.get("common", "otakeyfile"))
|
||||||
if os.path.isfile(otakeyfile) and os.access(otakeyfile, os.R_OK):
|
if os.path.isfile(otakeyfile) and os.access(otakeyfile, os.R_OK):
|
||||||
print "Parsing OTA keys from " + otakeyfile
|
print "Parsing OTA keys from " + otakeyfile
|
||||||
else:
|
else:
|
||||||
@ -51,7 +57,7 @@ repository = mykeys["BINTRAY_REPO"]
|
|||||||
apitoken = mykeys["BINTRAY_API_TOKEN"]
|
apitoken = mykeys["BINTRAY_API_TOKEN"]
|
||||||
|
|
||||||
# get bintray upload parameters from platformio environment
|
# get bintray upload parameters from platformio environment
|
||||||
version = project_config.get("common", "release_version")
|
version = config.get("common", "release_version")
|
||||||
package = str(env.get("PIOENV"))
|
package = str(env.get("PIOENV"))
|
||||||
|
|
||||||
# put bintray user credentials to platformio environment
|
# put bintray user credentials to platformio environment
|
||||||
@ -89,16 +95,19 @@ def publish_bintray(source, target, env):
|
|||||||
"X-Bintray-Override": "1"
|
"X-Bintray-Override": "1"
|
||||||
}
|
}
|
||||||
|
|
||||||
r = requests.put(
|
r = None
|
||||||
url,
|
|
||||||
|
try:
|
||||||
|
r = requests.put(url,
|
||||||
data=open(firmware_path, "rb"),
|
data=open(firmware_path, "rb"),
|
||||||
headers=headers,
|
headers=headers,
|
||||||
auth=(user, apitoken))
|
auth=(user,apitoken))
|
||||||
|
r.raise_for_status()
|
||||||
|
except requests.exceptions.RequestException as e:
|
||||||
|
sys.stderr.write("Failed to submit package: %s\n" %
|
||||||
|
("%s\n%s" % (r.status_code, r.text) if r else str(e)))
|
||||||
|
env.Exit(1)
|
||||||
|
|
||||||
if r.status_code != 201:
|
|
||||||
print("Failed to submit package: {0}\n{1}".format(
|
|
||||||
r.status_code, r.text))
|
|
||||||
else:
|
|
||||||
print("The firmware has been successfuly published at Bintray.com!")
|
print("The firmware has been successfuly published at Bintray.com!")
|
||||||
|
|
||||||
# put build file name and upload command to platformio environment
|
# put build file name and upload command to platformio environment
|
||||||
|
BIN
img/Paxcounter-LEDmatrix.jpg
Normal file
BIN
img/Paxcounter-LEDmatrix.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.2 MiB |
@ -6,33 +6,33 @@
|
|||||||
|
|
||||||
; ---> SELECT TARGET PLATFORM HERE! <---
|
; ---> SELECT TARGET PLATFORM HERE! <---
|
||||||
[platformio]
|
[platformio]
|
||||||
env_default = generic
|
default_envs = generic
|
||||||
;env_default = ebox
|
;default_envs = ebox
|
||||||
;env_default = eboxtube
|
;default_envs = eboxtube
|
||||||
;env_default = ecopower
|
;default_envs = ecopower
|
||||||
;env_default = heltec
|
;default_envs = heltec
|
||||||
;env_default = heltecv2
|
;default_envs = heltecv2
|
||||||
;env_default = ttgov1
|
;default_envs = ttgov1
|
||||||
;env_default = ttgov2
|
;default_envs = ttgov2
|
||||||
;env_default = ttgov21old
|
;default_envs = ttgov21old
|
||||||
;env_default = ttgov21new
|
;default_envs = ttgov21new
|
||||||
;env_default = ttgobeam
|
;default_envs = ttgobeam
|
||||||
;env_default = ttgofox
|
;default_envs = ttgofox
|
||||||
;env_default = lopy
|
;default_envs = lopy
|
||||||
;env_default = lopy4
|
;default_envs = lopy4
|
||||||
;env_default = fipy
|
;default_envs = fipy
|
||||||
;env_default = lolin32litelora
|
;default_envs = lolin32litelora
|
||||||
;env_default = lolin32lora
|
;default_envs = lolin32lora
|
||||||
;env_default = lolin32lite
|
;default_envs = lolin32lite
|
||||||
;env_default = wemos32oled
|
;default_envs = wemos32oled
|
||||||
;env_default = octopus32
|
;default_envs = octopus32
|
||||||
;env_default = ecopower, eboxtube, heltec, ttgobeam, lopy4, lopy, ttgov21old, ttgov21new, ttgofox
|
;default_envs = ecopower, eboxtube, heltec, ttgobeam, lopy4, lopy, ttgov21old, ttgov21new, ttgofox
|
||||||
;
|
;
|
||||||
description = Paxcounter is a proof-of-concept ESP32 device for metering passenger flows in realtime. It counts how many mobile devices are around.
|
description = Paxcounter is a proof-of-concept ESP32 device for metering passenger flows in realtime. It counts how many mobile devices are around.
|
||||||
|
|
||||||
[common]
|
[common]
|
||||||
; for release_version use max. 10 chars total, use any decimal format like "a.b.c"
|
; for release_version use max. 10 chars total, use any decimal format like "a.b.c"
|
||||||
release_version = 1.7.61
|
release_version = 1.7.62
|
||||||
; DEBUG LEVEL: For production run set to 0, otherwise device will leak RAM while running!
|
; 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
|
; 0=None, 1=Error, 2=Warn, 3=Info, 4=Debug, 5=Verbose
|
||||||
debug_level = 3
|
debug_level = 3
|
||||||
@ -51,7 +51,7 @@ lib_deps_lora =
|
|||||||
;MCCI LoRaWAN LMIC library@2.3.2
|
;MCCI LoRaWAN LMIC library@2.3.2
|
||||||
https://github.com/mcci-catena/arduino-lmic.git
|
https://github.com/mcci-catena/arduino-lmic.git
|
||||||
lib_deps_display =
|
lib_deps_display =
|
||||||
U8g2@>=2.25.7
|
U8g2@>=2.26.13
|
||||||
lib_deps_matrix_display =
|
lib_deps_matrix_display =
|
||||||
https://github.com/Seeed-Studio/Ultrathin_LED_Matrix.git
|
https://github.com/Seeed-Studio/Ultrathin_LED_Matrix.git
|
||||||
lib_deps_rgbled =
|
lib_deps_rgbled =
|
||||||
@ -63,8 +63,8 @@ lib_deps_sensors =
|
|||||||
Adafruit BME280 Library@1.0.8
|
Adafruit BME280 Library@1.0.8
|
||||||
lib_deps_basic =
|
lib_deps_basic =
|
||||||
ArduinoJson@^5.13.1
|
ArduinoJson@^5.13.1
|
||||||
Timezone@^1.2.2
|
76@^1.2.2 ;Timezone by Jack Christensen
|
||||||
RTC@^2.3.3
|
274@^2.3.3 ;RTC by Michael Miller
|
||||||
SimpleButton
|
SimpleButton
|
||||||
lib_deps_all =
|
lib_deps_all =
|
||||||
${common.lib_deps_basic}
|
${common.lib_deps_basic}
|
||||||
|
Loading…
Reference in New Issue
Block a user