cyberman54 / esp32-paxcounter Goto Github PK
View Code? Open in Web Editor NEWWifi & BLE driven passenger flow metering with cheap ESP32 boards
Home Page: https://cyberman54.github.io/ESP32-Paxcounter/
License: Other
Wifi & BLE driven passenger flow metering with cheap ESP32 boards
Home Page: https://cyberman54.github.io/ESP32-Paxcounter/
License: Other
If you select the USA freq band, you get case 11 and 12 as DR_SF11, "DR_SF12 was not declared in this scope"
In lorabase.h they are defined as DR_SF11CR and DR_SF12CR with a note: // Devices behind a router: Need to investigate why this is.
In the remote command interpreter....
// help function to assign LoRa datarates to spreadfactor values
void switch_lora (int sf, int tx) {
if ( tx > 20 ) return;
cfg.txpower = tx;
switch (sf) {
case 7: LMIC_setDrTxpow(DR_SF7,tx); cfg.lorasf=sf; break;
case 8: LMIC_setDrTxpow(DR_SF8,tx); cfg.lorasf=sf; break;
case 9: LMIC_setDrTxpow(DR_SF9,tx); cfg.lorasf=sf; break;
case 10: LMIC_setDrTxpow(DR_SF10,tx); cfg.lorasf=sf; break;
case 11: LMIC_setDrTxpow(DR_SF11,tx); cfg.lorasf=sf; break;
case 12: LMIC_setDrTxpow(DR_SF12,tx); cfg.lorasf=sf; break;
default: break;
}
}
I get the following errors when trying to build on Platformio:
.piolibdeps/ESP32 BLE Arduino_ID1841/src/BLEDescriptor.cpp: In member function 'void BLEDescriptor::handleGATTServerEvent(esp_gatts_cb_event_t, esp_gatt_if_t, esp_ble_gatts_cb_param_t*)':
.piolibdeps/ESP32 BLE Arduino_ID1841/src/BLEDescriptor.cpp:158:53: error: 'struct esp_ble_gatts_cb_param_t::gatts_add_char_descr_evt_param' has no member named 'descr_uuid'
m_bleUUID.equals(BLEUUID(param->add_char_descr.descr_uuid)) &&
^
.piolibdeps/ESP32 BLE Arduino_ID1841/src/BLEClient.cpp: In member function 'bool BLEClient::connect(BLEAddress)':
.piolibdeps/ESP32 BLE Arduino_ID1841/src/BLEClient.cpp:115:2: error: too many arguments to function 'esp_err_t esp_ble_gattc_open(esp_gatt_if_t, uint8_t*, bool)'
);
^
In file included from .piolibdeps/ESP32 BLE Arduino_ID1841/src/BLEClient.cpp:13:0:
/Users/henkdebruijn/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/bluedroid/esp_gattc_api.h:293:11: note: declared here
esp_err_t esp_ble_gattc_open(esp_gatt_if_t gattc_if, esp_bd_addr_t remote_bda, bool is_direct);
I use the following configuration:
[env:lopy]
platform = espressif32
board = esp32dev
framework = arduino
monitor_baud = 115200
upload_speed = 921600
lib_deps =
U8g2@>2.21.7
ESP32 BLE Arduino@>=0.4.9
SmartLeds
build_flags =
;set log level, we need build_flag for this, otherwise we can't use ESP_LOGx in arduino framework
-DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_INFO
; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE
; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_NONE
;needed for ESP32 BLE Ardunio v0.4.9
-fexceptions
-std=c++11
;override lora settings from LMiC library in lmic/config.h and use main.h instead
-Dlopy
-D_lmic_config_h_
-include "src/main.h"
-include "src/hal/lopy.h"
;FreeRTOS single core operation, switches off core 1 (see arduino-esp32/cores/esp32/main.cpp)
; -DCONFIG_FREERTOS_UNICORE
This maybe an issue...
In main.c you do a: #ifdef DEVEUI To see if DEVEUI is defined in you
config file...
A quick test of this by defining DEVEUI, shows it’s not working by sending
the generated DEVEUI.
No time to investigate this today....
void os_getDevEui (u1_t* buf) {
#ifdef DEVEUI
memcpy(buf, DEVEUI, 8);
RevBytes(buf, 8); // TTN requires it in LSB First order, so we swap bytes
#else
gen_lora_deveui(buf);
#endif
}
I'm trying to build this project, but building process fails with this error:
.piolibdeps/ESP32 BLE Arduino_ID1841/src/BLEDescriptor.cpp: In member function 'void BLEDescriptor::handleGATTServerEvent(esp_
gatts_cb_event_t, esp_gatt_if_t, esp_ble_gatts_cb_param_t*)':
.piolibdeps/ESP32 BLE Arduino_ID1841/src/BLEDescriptor.cpp:158:53: error: 'struct esp_ble_gatts_cb_param_t::gatts_add_char_des
cr_evt_param' has no member named 'descr_uuid'
I hope I haven't missed some instructions. This is what I've done so far:
I've created loraconf.h
as instructed.
I've enabled TTGOv2 (which I have) in platformio.ini
:
; ---> SELECT TARGET PLATFORM HERE! <---
[platformio]
;env_default = heltec_wifi_lora_32
;env_default = ttgov1
env_default = ttgov2
I've done platformio upgrade
on Mac Os X 10.13.4:
You're up-to-date!
PlatformIO 3.5.3a9 is currently the newest version available.
I've done platformio update
:
...
Platform Espressif 32
--------
Updating espressif32 @ 0.12.0 [Up-to-date]
Updating tool-esptoolpy @ 1.20100.0 [Up-to-date]
Updating framework-arduinoespressif32 @ 1.4.0 [Up-to-date]
Updating tool-espotapy @ 1.1.0 [Up-to-date]
...
After all this trying to build raises this output:
[Mon Apr 16 09:15:13 2018] Processing ttgov2 (framework: arduino; platform: espressif32; board: esp32dev)
--------------------------------------------------------------------------------
PackageManager: Installing toolchain-xtensa32 @ ~2.50200.0
Downloading...
Unpacking...
Verbose mode can be enabled via `-v, --verbose` option
PLATFORM: Espressif 32 > Espressif ESP32 Dev Module
SYSTEM: ESP32 240MHz 288KB RAM (1.25MB Flash)
...
Compiling .pioenvs/ttgov2/lib54a/ESP32 BLE Arduino_ID1841/BLERemoteService.cpp.o
.piolibdeps/ESP32 BLE Arduino_ID1841/src/BLEDescriptor.cpp: In member function 'void BLEDescriptor::handleGATTServerEvent(esp_
gatts_cb_event_t, esp_gatt_if_t, esp_ble_gatts_cb_param_t*)':
.piolibdeps/ESP32 BLE Arduino_ID1841/src/BLEDescriptor.cpp:158:53: error: 'struct esp_ble_gatts_cb_param_t::gatts_add_char_des
cr_evt_param' has no member named 'descr_uuid'
m_bleUUID.equals(BLEUUID(param->add_char_descr.descr_uuid)) &&
^
*** [.pioenvs/ttgov2/lib54a/ESP32 BLE Arduino_ID1841/BLEDescriptor.cpp.o] Error 1
.piolibdeps/ESP32 BLE Arduino_ID1841/src/BLEClient.cpp: In member function 'bool BLEClient::connect(BLEAddress)':
.piolibdeps/ESP32 BLE Arduino_ID1841/src/BLEClient.cpp:115:2: error: too many arguments to function 'esp_err_t esp_ble_gattc_o
pen(esp_gatt_if_t, uint8_t*, bool)'
);
^
In file included from .piolibdeps/ESP32 BLE Arduino_ID1841/src/BLEClient.cpp:13:0:
/Users/arista/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/bluedroid/esp_gattc_api.h:293:11: note: decl
ared here
esp_err_t esp_ble_gattc_open(esp_gatt_if_t gattc_if, esp_bd_addr_t remote_bda, bool is_direct);
^
*** [.pioenvs/ttgov2/lib54a/ESP32 BLE Arduino_ID1841/BLEClient.cpp.o] Error 1
========================== [ERROR] Took 13.24 seconds ==========================
I guess this might be some library mismatch issue, but my knowledge of PlatformIO isn't very strong so I can't say for sure.
On esp32.com forum i found some posts where packet loss is reported, while capturing packets in promiscuous mode. We should validate that our code doesn't have this problem, or, if there is a packet loss, we should try to calculate the quote. Setup could be a surrounding with defined Wifi traffic in the air, then capturing with paxcounter and parallel on a PC with wireshark, then compare results.
Hello, Mr. cyberman54. We are a manufacturer of TTGO T3 VI.0 and V2.0. Given your previous project, we want to further cooperate with you. Correspondingly, we will pay you accordingly. If you are interested, please email [email protected] to discuss details with us.
ESP32 has integrated hall sensor. Could be used to emulate a "reed switch", triggered by a magnet.
Perhaps for resetting NVRAM to values to factory values.
you may want to add this to your code base to support byte swapping of keys... This allow direct use of TTN keys...
// Function to do a byte swap in a byte array
void RevBytes(unsigned char* b, size_t c)
{
u1_t i;
for (i = 0; i < c / 2; i++)
{
unsigned char t = b[i];
b[i] = b[c - 1 - i];
b[c - 1 - i] = t;
}
}
Example:
/* ************************************************************************************** */
// LoRaWAN DevEUI, unique device ID (LSBF)
//static const u1_t DEVEUI[8] = { 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
static const u1_t DEVEUI[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07 };
/* ************************************************************************************** */
// provide device ID (8 bytes, LSBF)
void os_getDevEui (u1_t* buf) {
memcpy(buf, DEVEUI, 8);
RevBytes(buf, 8); // TTN requires it in LSB First order, so lets swap byte's
}
Hi
I just got the TTGO T-Beam, and did the changes in the config files, but when the board boots up I keep getting W (565) wifi: ap start fail
Is there a place I must specify the wifi?
Thanks
[I][main.cpp:622] setup(): Starting Lora task on core 1
[I][main.cpp:627] setup(): Starting Wifi task on core 0
I (194) wifi: wifi firmware version: 2fc15c0
I (197) wifi: config NVS flash: disabled
I (200) wifi: config nano formating: disabled
I (206) wifi: Init dynamic tx buffer num: 32
I (209) wifi: Init data frame dynamic rx buffer num: 64
I (214) wifi: Init management frame dynamic rx buffer num: 64
I (219) wifi: wifi driver task: 3ffdac68, prio:23, stack:4096
I (225) wifi: Init static rx buffer num: 10
I (228) wifi: Init dynamic rx buffer num: 0
I (560) wifi: set country: cc=EU␀ schan=1 nchan=13 policy=1
W (565) wifi: ap start fail
Brownout detector was triggered
The project is missing code guidelines leading to several inconsistencies.
Starting with the simple stuff like spacing, new line characters, etc. I would like to suggest to follow some existing guide and run a reformatting tool like clang-format
on the project. This will disrupt the development once since all work-in-progress patches might have some simple merge conflicts afterwards but we reach a clean state.
You need to do it for both.. DEVEUI and APPEUI
Compiler complains about multi line comments:
//#define GPS_SERIAL \
^
In file included from <command-line>:0:0:
./src\hal\ttgobeam.h:12:1: warning: multi-line comment [-Wcomment]
Hi,
I've compiled and uploaded latest code on an Heltec Lora 32 but although a JOIN packet is sent to Gateway and the server replies on the node there is no EV_JOINED and on display I have:
Join wait
PACKET QUEUED
But from code I would expect JOINING
Tested on TTGOv2, devices resets after reaching around 800-1000 counts, for yet an unknown reason.
Assumption: RAM oder stack memory leakage - to be figured out.
Currently the counter is reset after a successful (but not acknowledged) transmission of the counter values. This means that the time frame in which for a counting cycle is not constant making it harder to interprete the results. Therefor I like to suggest decoupling the sending of counter values and resetting the counter.
Use bits instead of bytes for configuration answer (rcommand 0x80), this saves 5 bytes payload
byte 1: LoRaWAN tx settings
bit 0: Lora ADR (1=on, 0=off)
bits 1..3: Lora SF modulo 7 (7..12) -> (0..5)
bits 4..7 Lora TXpower (2..15)
byte2: Device settings
bit 0: Screensaver status (1=on, 0=off)
bit 1: Display status (1=on, 0=off)
bit 2: Wifi scanning (1=on, 0=off)
bit 3: BLE scanning (1=on, 0=off)
bits 4..5: Counter mode (0=cyclic unconfirmed, 1=cumulative, 2=cyclic confirmed)
byte 3: RSSI limiter threshold value (0..255 negative)
byte 4: Wifi scan cycle duration in seconds/2 (0..255)
byte 5: Wifi channel switch interval in seconds/100 (0..255)
byte 6: BLE scan cycle duration in seconds (0..255)
bytes 7-16: Software version (ASCII format)
TTGO T-Beam runs in "Lora Busy" endless loop, causing sending no data.
This happenes because for some unknown reason the lmic event TX_COMPLETE is missing.
DIO1 is wired.
Problem is reproducable with code as well from master and as development branch.
Re-Registering GAP scan after scan interval parameter was changed by rcommand does not work, since the running scan is not stopped. Need to find a way to stop and restart the scan after cfg.blescantime changed.
After an OTAA Join has finished, your node has the very same details you’d have for an ABP device. So: store the DevAddr and the secret session keys NwkSKey and AppSKey, and keep track of both frame counters. After deep sleep, configure your node as an ABP node using LMIC_setSession(...), and set the frame counters to their last stored values, using LMIC.seqnoUp = ... and LMIC.seqnoDn = ....
For LMiC, these session details have different names (which originate from the early days where LoRaWAN was still called LoRaMAC). The documentation shows:
2.5.4 void LMIC_setSession (u4_t netid, devaddr_t devaddr, u1_t* nwkKey, u1_t* artKey)
Set static session parameters. Instead of dynamically establishing a session by joining the network, precomputed session parameters can be provided. To resume a session with precomputed parameters, the frame sequence counters (LMIC.seqnoUp and LMIC.seqnoDn) must be restored to their latest values.
And so does the code:
void LMIC_setSession (u4_t netid, devaddr_t devaddr, xref2u1_t nwkKey, xref2u1_t artKey);
Indeed, the global LMIC variable provides access to properties such as LMIC.nwkKey for NwkSKey, LMIC.artKey for AppSkey and LMIC.devaddr for DevAddr, which you should be able to retrieve and persist in case EV_JOINED.Beware that you might also need to store and set the frequency and RX2 details that you get in the Join Accept, or after subsequent ADR commands…
(I have not used this.)
Enable a configurable low-power mode, in which the device only wakes up after a set interval in order to scan for MACs and BSSIDs (that would be great for indoor location), get a location fix from the GPS, transmit everything and then sleep again.
Add support for a flag set by the gateway that prevents the device from sleeping for a set period (for on-demand scanning).
For integration of Paxcountet in Cayenne add a payload format LPP option.
Either as compile time option, or as runtime switchable option.
On device powering up and each n minutes cycle stop wifi sniffing MACs and scan Wifi network BSSIDs instead. Pass them to Collos backend for TDOA Wifi localization.
https://www.thethingsnetwork.org/docs/applications/collos/wifi.html
I found another issue regarding the "*100 bug" (Cayenne LPP payload):
If count is set to 1 (continuous counting without reset of the counter), the counter can become negativ. In display it is shown correctly but Cayenne payload is wrong. It's the same for WiFi and BLE counting.
Error: The program size (1340950 bytes) is greater than maximum allowed (1310720 bytes)
Paxcounter v1.2.95 crashes while scanning Bluetooth MACs in highly dense environments (> 150 Bluetooth MACs around, e.g. in areas where beacons are deployed like shopping malls). The crash happenes in the BLE stack. Currently i have no idea how to solve this.
I raised an issue in ESP32 BLE code repository.
Better use millis() to manage timing as illustrated here
If we use the serial montior we geht this:
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 188777542, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:812
load:0x40078000,len:0
load:0x40078000,len:11584
entry 0x40078a60
[I][main.cpp:490] setup(): Starting PAXCNT 1.3.82
[I][main.cpp:507] setup(): This is ESP32 chip with 2 CPU cores, WiFi/BT/BLE, silicon revision 1, 4MB embedded Flash
[I][main.cpp:508] setup(): ESP32 SDK: v3.1-dev-661-gf586f5e6
[I][configmanager.cpp:173] loadConfig(): Reading settings from NVS
[I][configmanager.cpp:54] open_storage(): Opening NVS
[I][configmanager.cpp:59] open_storage(): Done
[I][configmanager.cpp:187] loadConfig(): NVRAM settings version = 1.3.82
[I][configmanager.cpp:204] loadConfig(): lorasf = 9
[I][configmanager.cpp:212] loadConfig(): txpower = 15
[I][configmanager.cpp:220] loadConfig(): adrmode = 1
[I][configmanager.cpp:228] loadConfig(): screensaver = 0
[I][configmanager.cpp:236] loadConfig(): screenon = 1
[I][configmanager.cpp:244] loadConfig(): countermode = 0
[I][configmanager.cpp:252] loadConfig(): sendcycle = 120
[I][configmanager.cpp:260] loadConfig(): wifichancycle = 50
[I][configmanager.cpp:268] loadConfig(): wifiantenna = 0
[I][configmanager.cpp:276] loadConfig(): vendorfilter = 1
[I][configmanager.cpp:284] loadConfig(): rgbluminosity = 30
[I][configmanager.cpp:292] loadConfig(): blescantime = 8
[I][configmanager.cpp:300] loadConfig(): BLEscanmode = 1
[I][configmanager.cpp:308] loadConfig(): rssilimit = 0
[I][configmanager.cpp:316] loadConfig(): GPSmode = 1
[I][configmanager.cpp:323] loadConfig(): Done
[I][main.cpp:603] setup(): Features: LED OLED PAYLOAD_CAYENNE
[I][lorawan.cpp:89] printKey(): DevEUI: xxxxxxxx
[I][lorawan.cpp:89] printKey(): AppEUI: xxxxxxxxx
[I][lorawan.cpp:89] printKey(): AppKey: xxxxxxxxx
FAILURE
lib/arduino-lmic-1.5.0-arduino-2-tweaked/src/lmic/radio.c:694
Problem remains that the device shows: Pax: 0, BLTH: 0, WIFI: 0 and RLIM: off
Implement battery power display for devices which have suitable battery probing hardware
(#define HAS_BATTERY_PROBE
)
After some hours of operation, the mac counter is reset to zero. Sinc this does not happen due to a device reset, this seems to happen on application level.
Assumption: In v1.3.34 a low memory threshold was newly implemented in the main loop in main.cpp, which clears macs set container if heap memory is lower than MEM_LOW threshold. For some strange reason this seems to trigger way to early.
// check free memory
if (ESP.getFreeHeap() <= MEM_LOW) {
do_send(&sendjob); // send count
reset_counters(); // clear macs container and reset all counters
reset_salt(); // get new salt for salting hashes
}
Hi, we have 433Mhz devices, what can we do?
Show DEVEUI, APPEUI and APPKEY as QR code on OLED-Display when device starts, for easy copy & paste to LoRaWAN server. Maybe even with embedded URL that points to automatic import in TTN.
Perhaps by using QRduino library and drawXBM function of u8g2 Library
void drawPic() { // show QR-Code
// picture loop
u8g2.clearBuffer();
u8g2.firstPage();
do {
u8g2.drawXBM( 0, 0, qr_code_width, qr_code_height, qr_code_bits);
} while( u8g2.nextPage() );
}
On TTGO T-Beam "LORA BUSY" error persists after first packet sent out.
Same code runs on TTGO v2 without this problem.
Problem occurs on T-Beam as well GPS is compiled as not compiled.
Console log shows that event "EV_TX_COMPLETE" is missing. But DIO1 is cabled.
No idea currently what's the root cause here. It worked a while before.
Could be an hardware error - not sure.
I tried to give a try with platformio, thinking it will be simple (installed from scratch), but I'm facing this problem.
First I needed to install the Bluetooth library by hand with
platformio lib install 1841
now lib is found but no luck, I'm facing this issue (esp32 idf version too recent)
https://community.platformio.org/t/how-to-set-up-esp32-sdk-toolchain/3464
Any help ?
Hi,
I am using a TTGO v1 board, but I ma unable to use it with the current version of the Paxcounter, because it seems not to be able to use WiFi. Here is the log of it:
Rebooting...
ets Jun 8 2016 00:22:57rst:0xc (SW_CPU_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:812
load:0x40078000,len:0
load:0x40078000,len:11404
entry 0x40078a28
[I][main.cpp:327] setup(): Starting PAXCNT 1.2.0
[I][main.cpp:341] setup(): This is ESP32 chip with 2 CPU cores, WiFi/BT/BLE, silicon revision 1, 4MB external Flash
[I][configmanager.cpp:130] loadConfig(): Reading settings from NVS
[I][configmanager.cpp:41] open_storage(): Opening NVS
[I][configmanager.cpp:46] open_storage(): Done
[I][configmanager.cpp:143] loadConfig(): NVRAM settings version = 1.2.0
[I][configmanager.cpp:159] loadConfig(): lorasf = 9
[I][configmanager.cpp:167] loadConfig(): txpower = 15
[I][configmanager.cpp:175] loadConfig(): adrmode = 1
[I][configmanager.cpp:183] loadConfig(): screensaver = 0
[I][configmanager.cpp:191] loadConfig(): screenon = 1
[I][configmanager.cpp:199] loadConfig(): countermode = 0
[I][configmanager.cpp:207] loadConfig(): wifiscancycle = 120
[I][configmanager.cpp:215] loadConfig(): wifichancycle = 50
[I][configmanager.cpp:223] loadConfig(): blescancycle = 30
[I][configmanager.cpp:231] loadConfig(): BLEscanmode = 0
[I][configmanager.cpp:239] loadConfig(): rssilimit = 0
[I][configmanager.cpp:246] loadConfig(): Done
[I][lorawan.cpp:56] printKey(): DevEUI: xxxxx
[I][lorawan.cpp:56] printKey(): AppEUI: yyyyy
[I][lorawan.cpp:56] printKey(): AppKey: zzzzz
I (8750) wifi: wifi firmware version: 403db1d
I (8750) wifi: config NVS flash: enabled
I (8750) wifi: config nano formating: disabled
I (8755) wifi: Init dynamic tx buffer num: 32
I (8756) wifi: Init data frame dynamic rx buffer num: 64
I (8756) wifi: Init management frame dynamic rx buffer num: 64
I (8759) wifi: wifi driver task: 3ffdbef4, prio:23, stack:4096
I (8765) wifi: Init static rx buffer num: 10
I (8769) wifi: Init dynamic rx buffer num: 0
I (8773) wifi: wifi power manager task: 0x3ffe1054 prio: 21 stack: 2560
I (17641) wifi: set country: cc=EU schan=1 nchan=13 policy=0W (17648) wifi: sta start fail
E (17650) tcpip_adapter: tcpip_adapter is not initialized!
I (17673) wifi: mode : null
abort() was called at PC 0x40189f37 on core 0Backtrace: 0x4008af28:0x3ffd64a0 0x4008b027:0x3ffd64c0 0x40189f37:0x3ffd64e0 0x4012b3cd:0x3ffd6520 0x4012b671:0x3ffd6540 0x40129c41:0x3ffd6560
Rebooting...
ets Jun 8 2016 00:22:57
Any idea, what's going on here?
Btw, I also added a TTGO v1 configuration file and changed the platformio.ini to support it. I have attached them to this posting.
It is possible to break a device by sending rcommands with wrong parameters, e.g. set a bluetooth scan window which is too wide causes timing problems.
We need testing parameter ranges for each rcommmand and a strong field validation in rcommand.cpp !
So we installed platform.io on atom, configured to ttgo v2.1.
When building using the platform.io plugin we get the following error message:
src/blecsan.cpp:15:22: fatal error: bt_types.h: No such file or directory
what should we do?
Migrate software from Espressif32 core v1.0.2 to version 1.1.x
some prerequsits already done, code compiles
check code warnings / error logs
to be done: bugfixing an upcoming i2c interrupt error, which crashes performance on i2c bus used for OLED display. This is an Arduino-Espressif32 related problem, issue was raised here:
espressif/arduino-esp32#1588
Thanks for the very nice project. For small tests and checking the pax count in the TTN console without converting the payload every time by hand, I've used these two functions for the Custom Payload Format settings:
function Decoder(bytes, port) {
// Decode an uplink message from a buffer
// (array) of bytes to an object of fields.
var decoded = {};
if (port === 1) {
decoded.wifi = (bytes[0] << 8) | bytes[1];
decoded.ble = (bytes[2] << 8) | bytes[3];
}
return decoded;
}
function Converter(decoded, port) {
// Merge, split or otherwise
// mutate decoded fields.
var converted = decoded;
if (port === 1) {
converted.pax = converted.ble + converted.wifi;
}
return converted;
}
Feel free to improve/put them in the readme/whatever :)
Bluetooth scan sometimes starts before wifi channel scan cycle is completed.
No obvious reason to see for me. Maybe a side effect?
[I][main.cpp:269] wifi_sniffer_loop(): Wifi set channel 1
[I][main.cpp:269] wifi_sniffer_loop(): Wifi set channel 2
[I][main.cpp:269] wifi_sniffer_loop(): Wifi set channel 3
[I][main.cpp:269] wifi_sniffer_loop(): Wifi set channel 4
[I][main.cpp:269] wifi_sniffer_loop(): Wifi set channel 5
[I][main.cpp:269] wifi_sniffer_loop(): Wifi set channel 6
[I][main.cpp:269] wifi_sniffer_loop(): Wifi set channel 7
[I][main.cpp:269] wifi_sniffer_loop(): Wifi set channel 8
[I][main.cpp:269] wifi_sniffer_loop(): Wifi set channel 9
[D][BLEScan.cpp:192] start(): >> start(duration=15)
[D][BLEUtils.cpp:1091] dumpGapEvent(): Received a GAP event: ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT
[D][BLEUtils.cpp:1229] dumpGapEvent(): [status: 0]
[D][BLEUtils.cpp:1091] dumpGapEvent(): Received a GAP event: ESP_GAP_BLE_SCAN_START_COMPLETE_EVT
[D][BLEUtils.cpp:1305] dumpGapEvent(): [status: 0]
E (2138986) BT: btc_search_callback BLE observe compl [...]
run build on very commit:
cp src/loraconf.sample.h src/loraconf.h
pip install platformio==3.6.0a1
platformio run -e heltec -e ttgov1 -e ttgov2 -e ttgov21 -e ttgobeam -e fipy -e lopy -e lopy4 -e lolin32lite -e lolin32
maybe even check for code guideline violations.
I would like to go with gitlab-ci as a ci system. This would (more long term) allow for a custom runner that does not just build but also deploys on a board and does some simple checks if it still works.
Use F() like in Serial.print(F("Hello from PROGMEM"));
Some ESP32 boards have an external SRAM chip.
Make this usable to have more RAM for MAC buffer container.
Make a paxcounter SENSOR variant (besides paxcounter LORA): Make it usable for integration in devices and sensor appliances.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.