Wifi/BLE Paxcounter Project with ESP32 boards

(bluesensing) #247

#paxcounter now available as a complete package @aliexpress.com

(Verkehrsrot) #248

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

(Milbrot) #249

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

(Verkehrsrot) #250

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.

(Milbrot) #251

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.



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!

(Verkehrsrot) #253

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


Got it working now - helps to “clean” before building again after you make bigger changes =)

(Amedee) #255

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…)

(Arjan) #256

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?)

(Verkehrsrot) #257

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.

(Bolding) #258

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

(Verkehrsrot) #259

You must select generic LPP device in Cayenne, otherwise it won’t work.

(Bolding) #260

Looks quite good - what do you use for visualisation?

(Bolding) #261

Thanks! It made a difference!

(Amedee) #262

I store the data in InfluxDB and use Grafana for visualisation

(Hdcasey) #263


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.


(Verkehrsrot) #264

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.

(Verkehrsrot) #265

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

(Remko) #266

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