cyberman54 / ESP32-Paxcounter

Wifi & BLE driven passenger flow metering with cheap ESP32 boards
https://cyberman54.github.io/ESP32-Paxcounter/
Other
1.69k stars 397 forks source link

Problem with wifi TCP/IP MQTT #724

Closed HelloWar75 closed 3 years ago

HelloWar75 commented 3 years ago

I have problem with wifi tcp/ip for mqtt.

My board is heltec lora32 v2.

--- Miniterm on COM3  115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
04:39:21.349 > ET),boot:0x1[I][reset.cpp:81] do_after_reset(): Starting Software v2.2.0, runmode powercycle
04:39:21.349 > [I][main.cpp:159] setup(): This is ESP32 chip with 2 CPU cores, WiFi/BT/BLE, silicon revision 1, 8MB external Flash
04:39:21.349 > [I][main.cpp:161] setup(): Internal Total heap 267080, internal Free Heap 240680
04:39:21.349 > [I][main.cpp:167] setup(): ChipRevision 1, Cpu Freq 240, SDK Version v3.2.3-14-gd3e562907
04:39:21.349 > [I][main.cpp:169] setup(): Flash Size 8388608, Flash Speed 40000000
04:39:21.349 > [I][main.cpp:171] setup(): Wifi/BT software coexist version 1.1.7
04:39:21.349 > [W][esp32-hal-i2c.c:1411] i2cCheckLineState(): invalid state sda(4)=0, scl(15)=0
04:39:21.349 > [E][esp32-hal-i2c.c:1426] i2cCheckLineState(): Bus Invalid State, TwoWire() Can't init sda=0, scl=0
04:39:21.349 > [I][configmanager.cpp:98] loadConfig(): Loading device configuration from NVRAM...
04:39:21.349 > [I][configmanager.cpp:123] loadConfig(): Runtime configuration v2.2.0 loaded
04:39:21.349 > [I][i2c.cpp:44] i2c_scan(): Starting I2C bus scan...
04:39:21.349 > [I][i2c.cpp:78] i2c_scan(): 0 I2C device(s) found
04:39:21.525 > [I][main.cpp:259] setup(): Starting LED Controller...
04:39:21.580 > [I][main.cpp:294] setup(): Starting MAC processor...
04:39:21.580 > [I][macsniff.cpp:54] macQueueInit(): MAC processing queue created, size 600 Bytes
04:39:21.580 > [I][main.cpp:298] setup(): Starting rcommand interpreter...
04:39:21.580 > [I][rcommand.cpp:493] rcmd_init(): Rcommand send queue created, size 55 Bytes
04:39:22.546 > E (3459) emac: Timed out waiting for PHY register 0x2 to have value 0x0007(mask 0xffff). Current value 0x0000
04:39:23.546 > E (4460) emac: Timed out waiting for PHY register 0x3 to have value 0xc0f0(mask 0xfff0). Current value 0x0000
04:39:23.557 > E (4461) emac: Initialise PHY device Timeout
04:39:23.568 > [E][ETH.cpp:101] begin(): esp_eth_enable error: -1
04:39:23.568 > [I][mqttclient.cpp:36] mqtt_init(): MQTT send queue created, size 510 Bytes
04:39:23.572 > [I][mqttclient.cpp:38] mqtt_init(): Starting MQTTloop...
04:39:23.577 > I (4481) wifi: wifi driver task: 3ffbbe20, prio:23, stack:3584, core=0
04:39:23.583 > I (8994) wifi: wifi firmware version: 7997e4b
04:39:23.587 > I (8996) wifi: config NVS flash: disabled
04:39:23.595 > I (9000) wifi: config nano formating: disabled
04:39:23.595 > I (9004) wifi: Init dynamic tx buffer num: 32
04:39:23.599 > I (9008) wifi: Init data frame dynamic rx buffer num: 32
04:39:23.604 > I (9013) wifi: Init management frame dynamic rx buffer num: 32
04:39:23.611 > I (9019) wifi: Init management short buffer num: 32
04:39:23.614 > I (9024) wifi: Init static rx buffer size: 1600
04:39:23.619 > I (9028) wifi: Init static rx buffer num: 16
04:39:23.627 > I (9032) wifi: Init dynamic rx buffer num: 32
04:39:23.627 > I (9036) wifi: set country: cc=BR␀ schan=1 nchan=13 policy=1
04:39:23.632 >
04:39:23.632 > W (9041) wifi: ap start fail
04:39:23.635 >
04:39:23.635 > I (9044) wifi: Set ps type: 0
04:39:23.643 >
04:39:23.643 > [I][main.cpp:426] setup(): Starting Wifi...
04:39:23.689 > I (9109) wifi: mode : null
04:39:23.692 > I (9110) wifi: ic_enable_sniffer
04:39:23.695 > [I][main.cpp:441] setup(): Starting Interrupt Handler...
04:39:23.700 > [I][main.cpp:469] setup(): Starting Timers...
04:39:23.704 > [I][main.cpp:527] setup(): Features: VEXT OLED LED OTA MQTT FILTER PLAIN WIFI BTN_PD
04:39:43.566 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:39:43.572 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:39:43.579 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:39:53.728 > [I][senddata.cpp:117] sendData(): Counter cleared
04:40:03.576 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:40:03.582 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:40:03.589 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:40:23.585 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:40:23.592 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:40:23.599 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:40:23.729 > [I][senddata.cpp:117] sendData(): Counter cleared
04:40:43.596 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:40:43.602 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:40:43.609 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:40:53.730 > [I][senddata.cpp:117] sendData(): Counter cleared
04:41:03.604 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:41:03.611 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:41:03.617 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:41:23.614 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:41:23.622 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:41:23.629 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:41:23.732 > [I][senddata.cpp:117] sendData(): Counter cleared
04:41:43.624 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:41:43.630 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:41:43.637 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:41:53.733 > [I][senddata.cpp:117] sendData(): Counter cleared
04:42:03.634 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:42:03.640 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:42:03.647 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:42:23.644 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:42:23.650 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:42:23.657 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:42:23.733 > [I][senddata.cpp:117] sendData(): Counter cleared
04:42:43.653 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:42:43.660 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:42:43.667 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:42:53.734 > [I][senddata.cpp:117] sendData(): Counter cleared
04:43:03.663 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:43:03.669 > [E][WiFiGeneric.cpp:654] h--- Miniterm on COM3  115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
04:39:21.349 > ET),boot:0x1[I][reset.cpp:81] do_after_reset(): Starting Software v2.2.0, runmode powercycle
04:39:21.349 > [I][main.cpp:159] setup(): This is ESP32 chip with 2 CPU cores, WiFi/BT/BLE, silicon revision 1, 8MB external Flash
04:39:21.349 > [I][main.cpp:161] setup(): Internal Total heap 267080, internal Free Heap 240680
04:39:21.349 > [I][main.cpp:167] setup(): ChipRevision 1, Cpu Freq 240, SDK Version v3.2.3-14-gd3e562907
04:39:21.349 > [I][main.cpp:169] setup(): Flash Size 8388608, Flash Speed 40000000
04:39:21.349 > [I][main.cpp:171] setup(): Wifi/BT software coexist version 1.1.7
04:39:21.349 > [W][esp32-hal-i2c.c:1411] i2cCheckLineState(): invalid state sda(4)=0, scl(15)=0
04:39:21.349 > [E][esp32-hal-i2c.c:1426] i2cCheckLineState(): Bus Invalid State, TwoWire() Can't init sda=0, scl=0
04:39:21.349 > [I][configmanager.cpp:98] loadConfig(): Loading device configuration from NVRAM...
04:39:21.349 > [I][configmanager.cpp:123] loadConfig(): Runtime configuration v2.2.0 loaded
04:39:21.349 > [I][i2c.cpp:44] i2c_scan(): Starting I2C bus scan...
04:39:21.349 > [I][i2c.cpp:78] i2c_scan(): 0 I2C device(s) found
04:39:21.525 > [I][main.cpp:259] setup(): Starting LED Controller...
04:39:21.580 > [I][main.cpp:294] setup(): Starting MAC processor...
04:39:21.580 > [I][macsniff.cpp:54] macQueueInit(): MAC processing queue created, size 600 Bytes
04:39:21.580 > [I][main.cpp:298] setup(): Starting rcommand interpreter...
04:39:21.580 > [I][rcommand.cpp:493] rcmd_init(): Rcommand send queue created, size 55 Bytes
04:39:22.546 > E (3459) emac: Timed out waiting for PHY register 0x2 to have value 0x0007(mask 0xffff). Current value 0x0000
04:39:23.546 > E (4460) emac: Timed out waiting for PHY register 0x3 to have value 0xc0f0(mask 0xfff0). Current value 0x0000
04:39:23.557 > E (4461) emac: Initialise PHY device Timeout
04:39:23.568 > [E][ETH.cpp:101] begin(): esp_eth_enable error: -1
04:39:23.568 > [I][mqttclient.cpp:36] mqtt_init(): MQTT send queue created, size 510 Bytes
04:39:23.572 > [I][mqttclient.cpp:38] mqtt_init(): Starting MQTTloop...
04:39:23.577 > I (4481) wifi: wifi driver task: 3ffbbe20, prio:23, stack:3584, core=0
04:39:23.583 > I (8994) wifi: wifi firmware version: 7997e4b
04:39:23.587 > I (8996) wifi: config NVS flash: disabled
04:39:23.595 > I (9000) wifi: config nano formating: disabled
04:39:23.595 > I (9004) wifi: Init dynamic tx buffer num: 32
04:39:23.599 > I (9008) wifi: Init data frame dynamic rx buffer num: 32
04:39:23.604 > I (9013) wifi: Init management frame dynamic rx buffer num: 32
04:39:23.611 > I (9019) wifi: Init management short buffer num: 32
04:39:23.614 > I (9024) wifi: Init static rx buffer size: 1600
04:39:23.619 > I (9028) wifi: Init static rx buffer num: 16
04:39:23.627 > I (9032) wifi: Init dynamic rx buffer num: 32
04:39:23.627 > I (9036) wifi: set country: cc=BR␀ schan=1 nchan=13 policy=1
04:39:23.632 >
04:39:23.632 > W (9041) wifi: ap start fail
04:39:23.635 >
04:39:23.635 > I (9044) wifi: Set ps type: 0
04:39:23.643 >
04:39:23.643 > [I][main.cpp:426] setup(): Starting Wifi...
04:39:23.689 > I (9109) wifi: mode : null
04:39:23.692 > I (9110) wifi: ic_enable_sniffer
04:39:23.695 > [I][main.cpp:441] setup(): Starting Interrupt Handler...
04:39:23.700 > [I][main.cpp:469] setup(): Starting Timers...
04:39:23.704 > [I][main.cpp:527] setup(): Features: VEXT OLED LED OTA MQTT FILTER PLAIN WIFI BTN_PD
04:39:43.566 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:39:43.572 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:39:43.579 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:39:53.728 > [I][senddata.cpp:117] sendData(): Counter cleared
04:40:03.576 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:40:03.582 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:40:03.589 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:40:23.585 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:40:23.592 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:40:23.599 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:40:23.729 > [I][senddata.cpp:117] sendData(): Counter cleared
04:40:43.596 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:40:43.602 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:40:43.609 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:40:53.730 > [I][senddata.cpp:117] sendData(): Counter cleared
04:41:03.604 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:41:03.611 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:41:03.617 > [I][mqttclient.cpp:61] mostByName(): DNS Failed for public.cloud.shiftr.io
04:43:03.676 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:43:23.672 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:43:23.679 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:43:23.688 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:43:23.735 > [I][senddata.cpp:117] sendData(): Counter cleared
04:43:43.682 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:43:43.689 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:43:43.695 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:43:53.736 > [I][senddata.cpp:117] sendData(): Counter cleared
04:44:03.692 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:44:03.699 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:44:03.706 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:44:23.702 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:44:23.709 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:44:23.716 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:44:23.738 > [I][senddata.cpp:117] sendData(): Counter cleared
04:44:43.712 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:44:43.718 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:44:43.725 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:44:53.739 > [W][mqttclient.cpp:149] mqtt_enqueuedata(): MQTT sendqueue is full
04:44:53.745 > [I][senddata.cpp:117] sendData(): Counter cleared
04:45:03.721 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:45:03.727 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:45:03.734 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:45:23.731 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:45:23.738 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:45:23.744 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:45:23.751 > [W][mqttclient.cpp:149] mqtt_enqueuedata(): MQTT sendqueue is full
04:45:23.757 > [I][senddata.cpp:117] sendData(): Counter cleared
04:45:43.751 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:45:43.758 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:45:43.764 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:45:53.740 > [W][mqttclient.cpp:149] mqtt_enqueuedata(): MQTT sendqueue is full
04:45:53.746 > [I][senddata.cpp:117] sendData(): Counter cleared
04:46:03.761 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:46:03.767 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:46:03.774 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:46:23.741 > [W][mqttclient.cpp:149] mqtt_enqueuedata(): MQTT sendqueue is full
04:46:23.747 > [I][senddata.cpp:117] sendData(): Counter cleared
04:46:23.771 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:46:23.784 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:46:23.784 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:46:43.780 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:46:43.787 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:46:43.794 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:46:53.743 > [W][mqttclient.cpp:149] mqtt_enqueuedata(): MQTT sendqueue is full
04:46:53.749 > [I][senddata.cpp:117] sendData(): Counter cleared
04:47:03.790 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:47:03.797 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:47:03.803 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:47:23.744 > [W][mqttclient.cpp:149] mqtt_enqueuedata(): MQTT sendqueue is full
04:47:23.751 > [I][senddata.cpp:117] sendData(): Counter cleared
04:47:23.800 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:47:23.807 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:47:23.814 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:47:43.809 > [I][mqttclient.cpp:54] mqtt_connect(): MQTT name is paxcounter_ce154e9a
04:47:43.816 > [E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for public.cloud.shiftr.io
04:47:43.823 > [I][mqttclient.cpp:61] mqtt_connect(): Could not resolve public.cloud.shiftr.io
04:47:53.745 > [W][mqttclient.cpp:149] mqtt_enqueuedata(): MQTT sendqueue is full
04:47:53.752 > [I][senddata.cpp:117] sendData(): Counter cleared

My ota.conf


[ota]
OTA_WIFI_SSID = TestLab
OTA_WIFI_PASS = 12592075

[bintray]
BINTRAY_USER = MyBintrayUser
BINTRAY_REPO = MyBintrayRepo
BINTRAY_API_TOKEN = 3894a7a51d70c6523c1b7479261c34845ebf7878

My paxcounter.conf

// clang-format off

// ----- Paxcounter user config file ------
//
// --> adapt to your needs and use case <--
//
// Note: After editing, before "build", use "clean" button in PlatformIO!

// Verbose enables additional serial debug output
#define VERBOSE                         1       // set to 0 to silence the device, for mute use build option

// Payload send cycle and encoding
#define SENDCYCLE                       30      // payload send cycle [seconds/2], 0 .. 255
#define SLEEPCYCLE                      0       // sleep time after a send cycle [seconds/2], 0 .. 255; 0 means no sleep [default = 0]
#define PAYLOAD_ENCODER                 1       // payload encoder: 1=Plain, 2=Packed, 3=Cayenne LPP dynamic, 4=Cayenne LPP packed
#define COUNTERMODE                     1       // 0=cyclic, 1=cumulative, 2=cyclic confirmed

// MAC sniffing parameters
#define MACFILTER                       1       // set to 0 if you want to scan all devices, 1 to scan only devices with random MACs (aka smartphones) [default = 1]
#define BLECOUNTER                      0       // set to 0 if you do not want to install the BLE sniffer
#define WIFICOUNTER                     1       // set to 0 if you do not want to install the WIFI sniffer
#define MAC_QUEUE_SIZE                  50      // size of MAC processing buffer (number of MACs) [default = 50]

// BLE scan parameters
#define BLESCANTIME                     0       // [seconds] scan duration, 0 means infinite [default], see note below
#define BLESCANWINDOW                   80      // [milliseconds] scan window, see below, 3 .. 10240, default 80ms
#define BLESCANINTERVAL                 80      // [illiseconds] scan interval, see below, 3 .. 10240, default 80ms = 100% duty cycle

// Corona Exposure Notification Service(ENS) counter
#define COUNT_ENS                       0       // count found number of devices which advertise Exposure Notification Service
                                                // set to 1 if you want to enable this function [default=0]

// for additional sensors (added by some user)
#define HAS_SENSOR_1                    0       // set to 1 to enable data transfer of user sensor #1 (also used as ENS counter) [default=0]
#define HAS_SENSOR_2                    0       // set to 1 to enable data transfer of user sensor #2 [default=0]
#define HAS_SENSOR_3                    0       // set to 1 to enable data transfer of user sensor #3 [default=0]

/* Note: guide for setting bluetooth parameters
*
* |< Scan Window >       |< Scan Window >       | ... |< Scan Window >       |
* |<    Scan Interval   >|<    Scan Interval   >| ... |<    Scan Interval   >|
* |<                   Scan duration                                        >|
*
* Scan duration sets how long scanning should be going on, before starting a new scan cycle. 0 means infinite (default).
* Scan window sets how much of the interval should be occupied by scanning. Should be >= BLESCANINTERVAL.
* Scan interval is how long scanning should be done on each channel. BLE uses 3 channels for advertising.
* -> Adjust these values with power consumption in mind if power is limited.
* -> Scan interval can be changed during runtime by remote comammand.
*/

// WiFi scan parameters
#define WIFI_CHANNEL_MIN                1       // start channel number where scan begings
#define WIFI_CHANNEL_MAX                13      // total channel number to scan
#define WIFI_MY_COUNTRY                 "BR"    // select locale for Wifi RF settings
#define WIFI_CHANNEL_SWITCH_INTERVAL    50      // [seconds/100] -> 0,5 sec.

// LoRa payload default parameters
#define MEM_LOW                         2048    // [Bytes] low memory threshold triggering a send cycle
#define RETRANSMIT_RCMD                 5       // [seconds] wait time before retransmitting rcommand results
#define PAYLOAD_BUFFER_SIZE             51      // maximum size of payload block per transmit
#define PAYLOAD_OPENSENSEBOX            0       // send payload compatible to sensebox.de (swap geo position and pax data)
#define LORADRDEFAULT                   5       // 0 .. 15, LoRaWAN datarate, according to regional LoRaWAN specs [default = 5]
#define LORATXPOWDEFAULT                14      // 0 .. 255, LoRaWAN TX power in dBm [default = 14]
#define MAXLORARETRY                    500     // maximum count of TX retries if LoRa busy
#define SEND_QUEUE_SIZE                 10      // maximum number of messages in payload send queue [1 = no queue]

// Hardware settings
#define RGBLUMINOSITY                   15      // RGB LED luminosity [default = 30%]
#define DISPLAYREFRESH_MS               40      // OLED refresh cycle in ms [default = 40] -> 1000/40 = 25 frames per second
#define DISPLAYCONTRAST                 80      // 0 .. 255, OLED display contrast [default = 80]
#define DISPLAYCYCLE                    3       // Auto page flip delay in sec [default = 2] for devices without button
#define HOMECYCLE                       30      // house keeping cycle in seconds [default = 30 secs]

// Settings for BME680 environmental sensor
#define BME_TEMP_OFFSET                 5.0f    // Offset sensor on chip temp <-> ambient temp [default = 5°C]
#define STATE_SAVE_PERIOD               UINT32_C(360 * 60 * 1000) // update every 360 minutes = 4 times a day
#define BMECYCLE                        1       // bme sensor read cycle in seconds [default = 1 secs]

// OTA settings
#define USE_OTA                         1       // set to 0 to disable OTA update
#define WIFI_MAX_TRY                    20       // maximum number of wifi connect attempts for OTA update [default = 20]
#define OTA_MAX_TRY                     5       // maximum number of attempts for OTA download and write to flash [default = 3]
#define OTA_MIN_BATT                    50      // minimum battery level for OTA [percent]
#define RESPONSE_TIMEOUT_MS             60000   // firmware binary server connection timeout [milliseconds]

// settings for syncing time of node with a time source (network / gps / rtc / timeserver)
#define TIME_SYNC_LORAWAN               0       // set to 1 to use LORA network as time source, 0 means off [default = 1]
#define TIME_SYNC_LORASERVER            0       // set to 1 to use LORA timeserver as time source, 0 means off [default = 0]
#define TIME_SYNC_INTERVAL              60      // sync time attempt each .. minutes from time source [default = 60], 0 means off
#define TIME_SYNC_INTERVAL_RETRY        10      // retry time sync after lost sync each .. minutes [default = 10], 0 means off
#define TIME_SYNC_SAMPLES               1       // number of time requests for averaging, max. 255
#define TIME_SYNC_CYCLE                 60      // delay between two time samples [seconds]
#define TIME_SYNC_TIMEOUT               400     // timeout waiting for timeserver answer [seconds]
#define TIME_SYNC_COMPILEDATE           0       // set to 1 to use compile date to initialize RTC after power outage [default = 0]

// time zone, see https://github.com/JChristensen/Timezone/blob/master/examples/WorldClock/WorldClock.ino
#define DAYLIGHT_TIME                   {"CEST", Last, Sun, Mar, 2, 120}     // Central European Summer Time
#define STANDARD_TIME                   {"CET ", Last, Sun, Oct, 3, 60}      // Central European Standard Time

// Ports on which the device sends and listenes on LoRaWAN and SPI
#define COUNTERPORT                     1       // counts
#define MACPORT                         0       // network commands
#define RCMDPORT                        2       // remote commands
#define STATUSPORT                      2       // remote command results
#define CONFIGPORT                      3       // config query results
#define GPSPORT                         4       // gps - NOTE: set to 1 to send combined GPS+COUNTERPORT payload  
#define BUTTONPORT                      5       // button pressed signal
#define BEACONPORT                      6       // beacon alarms
#define BMEPORT                         7       // BME680 sensor
#define BATTPORT                        8       // battery voltage
#define TIMEPORT                        9       // time query and response
#define SENSOR1PORT                     10      // user sensor #1
#define SENSOR2PORT                     11      // user sensor #2
#define SENSOR3PORT                     12      // user sensor #3

// Cayenne LPP Ports, see https://community.mydevices.com/t/cayenne-lpp-2-0/7510
#define CAYENNE_LPP1                    1       // dynamic sensor payload (LPP 1.0)
#define CAYENNE_LPP2                    2       // packed sensor payload (LPP 2.0)
#define CAYENNE_GPS                     3       // full scale GPS payload
#define CAYENNE_ACTUATOR                10      // actuator commands
#define CAYENNE_DEVICECONFIG            11      // device period configuration
#define CAYENNE_SENSORREAD              13      // sensor period configuration
#define CAYENNE_SENSORENABLE            14      // sensor enable configuration

#define MQTT_ETHERNET 0 // select PHY: set 0 for Wifi, 1 for ethernet
#define MQTT_INTOPIC "paxin"
#define MQTT_OUTTOPIC "paxout"
#define MQTT_PORT 1883
#define MQTT_SERVER "public.cloud.shiftr.io"
#define MQTT_USER "public"
#define MQTT_PASSWD "public"
#define MQTT_RETRYSEC 20  // retry reconnect every 20 seconds
#define MQTT_KEEPALIVE 10 // keep alive interval in seconds
//#define MQTT_CLIENTNAME "my_paxcounter" // generated by default

My heltecv2.h

// clang-format off
// upload_speed 921600
// board heltec_wifi_lora_32_V2

#ifndef _HELTECV2_H
#define _HELTECV2_H

#include <stdint.h>

// Hardware related definitions for Heltec V2 LoRa-32 Board

//#define HAS_BME 1 // Enable BME sensors in general
//#define HAS_BME680 GPIO_NUM_4, GPIO_NUM_15 // SDA, SCL
//#define BME680_ADDR BME680_I2C_ADDR_PRIMARY // connect SDIO of BME680 to GND 
//#define HAS_BMP180
//#define BMP180_ADDR 0x77

#define HAS_LORA 0       // comment out if device shall not send data via LoRa
#define CFG_sx1276_radio 1

#define HAS_DISPLAY 1 // OLED-Display on board
#define HAS_LED LED_BUILTIN                           // white LED on board
#define HAS_BUTTON KEY_BUILTIN                        // button "PROG" on board

// caveat: activating ADC2 conflicts with Wifi in current arduino-esp32
// see https://github.com/espressif/arduino-esp32/issues/3222
// thus we must waiver of battery monitoring 
//#define BAT_MEASURE_ADC ADC2_GPIO13_CHANNEL  // battery probe GPIO pin
//#define BAT_MEASURE_ADC_UNIT 2 // ADC 2
//#define BAT_VOLTAGE_DIVIDER 2 // voltage divider 220k/100k on board

#define EXT_POWER_SW Vext // switches battery power, Vext control 0 = on / 1 = off
#define EXT_POWER_ON    0
//#define EXT_POWER_OFF   1

// Pins for I2C interface of OLED Display
#define MY_DISPLAY_SDA SDA_OLED
#define MY_DISPLAY_SCL SCL_OLED
#define MY_DISPLAY_RST RST_OLED

// Pins for LORA chip SPI interface come from board file, we need some
// additional definitions for LMIC
// #define DISABLE_BROWNOUT 1
#define HAS_MQTT 1
#define LORA_IRQ DIO0
#define LORA_IO1 DIO1
#define LORA_IO2 DIO2
#define LORA_SCK GPIO_NUM_5
#define LORA_MISO MISO
#define LORA_MOSI MOSI
#define LORA_RST RST_LoRa
#define LORA_CS SS

#define OTA_WIFI_SSID = TestLab
#define OTA_WIFI_PASS = 12592075

#endif
My platformio.ini
; 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

[board]
halfile = heltecv2.h

[platformio]
default_envs = usb
description = Paxcounter is a device for metering passenger flows in realtime. It counts how many mobile devices are around.

[common]
release_version = 2.2.0
debug_level = 3
extra_scripts = pre:build.py
otakeyfile = ota.conf
lorakeyfile = loraconf.h
lmicconfigfile = lmic_config.h
platform_espressif32 = espressif32@2.1.0
monitor_speed = 115200
upload_speed = 115200
display_library = 
lib_deps_lora = 
    mcci-catena/MCCI LoRaWAN LMIC library @ ^3.3.0
lib_deps_display = 
    bitbank2/OneBitDisplay @ 1.9.0
    bitbank2/BitBang_I2C @ ^2.1.3
    ricmoo/QRCode @ ^0.0.1
    bodmer/TFT_eSPI @ ^2.3.51
lib_deps_ledmatrix = 
    seeed-studio/Ultrathin_LED_Matrix @ ^1.0.0
lib_deps_rgbled = 
    roboticsbrno/SmartLeds @ ^1.2.1
lib_deps_gps = 
    mikalhart/TinyGPSPlus @ ^1.0.2
lib_deps_sensors = 
    adafruit/Adafruit Unified Sensor @ ^1.1.4
    adafruit/Adafruit BME280 Library @ ^2.1.1
    adafruit/Adafruit BMP085 Library @ ^1.1.0
    boschsensortec/BSEC Software Library @ 1.6.1480
    https://github.com/ricki-z/SDS011.git
lib_deps_basic = 
    https://github.com/SukkoPera/Arduino-Rokkit-Hash.git
    bblanchon/ArduinoJson @ ^6
    jchristensen/Timezone @ ^1.2.4
    makuna/RTC @ ^2.3.5
    spacehuhn/SimpleButton
    lewisxhe/AXP202X_Library @ ^1.1.2
    geeksville/esp32-micro-sdcard @ ^0.1.1
    256dpi/MQTT @ ^2.4.7
lib_deps_all = 
    ${common.lib_deps_basic}
    ${common.lib_deps_lora}
    ${common.lib_deps_display}
    ${common.lib_deps_rgbled}
    ${common.lib_deps_gps}
    ${common.lib_deps_sensors}
    ${common.lib_deps_ledmatrix}
build_flags_basic = 
    -include "src/hal/${board.halfile}"
    -include "src/paxcounter.conf"
    '-DCORE_DEBUG_LEVEL=${common.debug_level}'
    '-DLOG_LOCAL_LEVEL=${common.debug_level}'
    '-DPROGVERSION="${common.release_version}"'
    '-Wno-unknown-pragmas'
    '-Wno-unused-variable'
build_flags_sensors = 
    -Llib/Bosch-BSEC/src/esp32/
    -lalgobsec
build_flags_all = 
    ${common.build_flags_basic}
    ${common.build_flags_sensors}
    -mfix-esp32-psram-cache-issue

[env]
lib_ldf_mode = deep
framework = arduino
board = esp32dev
board_build.partitions = min_spiffs.csv
upload_speed = ${common.upload_speed}
platform = ${common.platform_espressif32}
lib_deps = ${common.lib_deps_all}
build_flags = ${common.build_flags_all}
upload_protocol = ${common.upload_protocol}
extra_scripts = ${common.extra_scripts}
monitor_speed = ${common.monitor_speed}
monitor_filters = 
    time
    esp32_exception_decoder
    default

[env:ota]
upload_protocol = custom

[env:usb]
upload_protocol = esptool

[env:dev]
upload_protocol = esptool
build_type = debug
platform = https://github.com/platformio/platform-espressif32.git#develop
cyberman54 commented 3 years ago

MQTT over Wifi is not (yet) supported, you need a PHY with Ethernet. So you can't use this option with a Heltec V2 LORA board. Use the MQTT connector of your LORAWAN network server instead.

dsandels commented 1 year ago

Hi,

I have a ESP32-Paxcounter LoRa32 Bluetooth WiFi Module 915MHZ module. How do I find the APP EUI and the APP Key for operation on the Helium network ?

Thanks !

cyberman54 commented 1 year ago

@dsandels Please open new thread in github tab "discussion" and post your question there.

dsandels commented 1 year ago

Thanks for the advice !Unfortunately, I am totally new to GitHub and cannot find the “discussion tab”. Where do I go from here ?Thanks in advance !Sent from my iPhoneDavid Sandel iNeighborhoods.usSt. Louis, MO.Austin, TX.EinsteinDesigns.center314-435-3658On May 12, 2023, at 6:48 PM, Verkehrsrot @.***> wrote: @dsandels Please open new thread in github tab "discussion" and post your question there.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>