Wifi/BLE Paxcounter Project with ESP32 boards


(bluesensing) #247

#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


(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.


#252

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!


(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


#254

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

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


(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: