Wifi/BLE Paxcounter Project with ESP32 boards

#paxcounter now available as a complete package @aliexpress.com
https://de.aliexpress.com/store/product/TTGO-ESP32-Paxcounter-LoRa32-V2-1-1-6-version-433-868-915MHZ-LoRa-ESP-32-OLED/2090076_32915894264.html?spm=a2g0x.search0104.3.1.53f477562tNXFK&ws_ab_test=searchweb0_0,searchweb201602_1_10320_10152_5724111_10065_10151_10344_10068_10342_10547_5724211_10343_10340_10341_10548_5724311_10696_5724011_10084_10083_10618_10304_10307_10820_10821_10302_10843_10059_100031_10319_10103_5725011_10624_10623_10622_10621_10620_5724911,searchweb201603_55,ppcSwitch_2&algo_expid=669cacb6-3134-4a95-8c3f-bdebb97d5d7a-0&algo_pvid=669cacb6-3134-4a95-8c3f-bdebb97d5d7a&transAbTest=ae803_2&priceBeautifyAB=0

1 Like

It should work, you can easily disable OLED support in paxcounter.conf as a build option.

Is it possible to set counter mode in paxcounter.conf to default 1 and perhaps turn off the bright led on TTGOv2.1?

You can edit paxcounter.conf on yourself before building the code.

The annoying bright LEDs on TTGO v2.1 as well as T-Beam are hardwired to chinese battery loader chip and thus cannot be controlled by software.

There is no define line in paxcounter.conf for counter mode.
I had to change the value in configmanager.cpp and send factory setting remote command.
The old value was still in ram after factory reset it works.
Because of the led I have to look.

Hello!

What do i need to change to get a oled running on the t-beam with the actual pax counter version? I get it without the display, data is transfered via lorawan/ttn (used gpio33 for DIO1 like in the other thread suggested). What do i need to change in the configs to get a ā€œnormalā€ ssd1306 oled running?

Thank you very much!

You only need to define the display driver and the display interfacing GPIOs in file /src/hal/ttgobeam.h

In /src/hal/ttgov2.h you find an example what lines are needed for an OLED display which is connected via I2C bus.

#define HAS_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C
//#define DISPLAY_FLIP 1 // uncomment this for rotated display

// Hardware pin definitions for TTGO V2 Board with OLED SSD1306 0,96" I2C Display
#define OLED_RST U8X8_PIN_NONE // connected to CPU RST/EN
#define OLED_SDA GPIO_NUM_21 // ESP32 GPIO21 ā€“ SD1306 D1+D2
#define OLED_SCL GPIO_NUM_22 // ESP32 GPIO22 ā€“ SD1306 D0

1 Like

Got it working now - helps to ā€œcleanā€ before building again after you make bigger changes =)

1 Like

Been there, done that: yes, dependencies are not fully handled and changes in include files do not trigger complete re-buildā€¦ (It is documented in the include file thoughā€¦)

The README states:

0x09 reset functions (send this command with confirmed ack only to avoid boot loops!)

Why would an unconfirmed downlink cause a boot loop? (And would it always do that, or in only in some circumstances?)

You hit the point, i need to explore this further. I discovered that in some circumstances the reset command is resent by the network after the node rebooted and rejoined, which then causes a boot loop.

1 Like

Iā€™m struggling to figure out how to send the data to Cayenne. Iā€™ve configured the following:

  • paxcounter.conf: #define PAYLOAD_ENCODER 3 (3=CayenneLPP dynamic)
  • In TTN Application Iā€™ve changed the Payload Format to: Cayenne LPP
  • In TTN Integration Iā€™ve selected Cayenne
  • In Cayenne Iā€™ve created a new project, selected Lora for the device, TTN as category and selected the generic device in the top (1M2M ED1608 Generic with many sensors and connectors)

But no data is coming through to Cayenne. I can of course confirm that payloads are received in TTN

You must select generic LPP device in Cayenne, otherwise it wonā€™t work.

Looks quite good - what do you use for visualisation?

Thanks! It made a difference!

I store the data in InfluxDB and use Grafana for visualisation

Hi,

First Iā€™d like to thank the authors of this software. From installing Atom to a working Paxcounter on a T-Beam took me just a few hours!

One thing regarding wiring is not clear. I hope someone can enlighten me.

In ttgobeam.h I see the following lines regarding battery voltage:

#define HAS_BATTERY_PROBE ADC1_GPIO35_CHANNEL // battery probe GPIO pin -> ADC1_CHANNEL_7
#define BATT_FACTOR 2 // voltage divider 100k/100k on board

Does this mean that the voltage divider is already installed and I can safely solder a wire between GPIO35 and the battery + to get it working? Iā€™d rather not fry the T-Beam with 4.2V.

Steven

T-Beam has the voltage divider on board an it is connected to GPIO35. You donā€™t need to wire anything. Just use the above defines and you get the voltage.

I created a new, very useful, paxcounter appliance, of course connected to TTN.IMG_20181110_211951 :sunglasses:

2 Likes

I purchased a TTGO T3_V1.6 LoRa module with OLED display to use as PAX counter.
Which environment shall be configured in ā€œplatformio.iniā€?
Options are:

;env_default = ttgov1
;env_default = ttgov2
;env_default = ttgov21new
;env_default = ttgov21old
;env_default = ttgobeam
1 Like