Wifi/BLE Paxcounter Project with ESP32 boards

(Verkehrsrot) #185

You should clone the github repo in PlatformIO, and use source code control to keep your code synched with the repo. Do not copy anything by hand.


ok I will google that, thanks for the hint

(Verkehrsrot) #187

you need to install git as platformIO extension.
Then git init and git clone.


Would that be with this?
No that’s not it. I just installed a git addon into atom. No git init or git clone menu to be found, will try to figure this out later, have real work to do… :wink:
Have a nice day all!

(Verkehrsrot) #189

New paxcounter version 1.3.82 released.
Now supporting 3 different payload formats:

  • Plain: json fields, LSB
  • Packed: json fields, MSB
  • CayenneLPP

Plain and packed generate fields latitude, longitude and hdop requried by ttnmapper. So you can have a simple tracker just by activating the ttnmapper integration in TTN console.


a future PAX counter perhaps?

(michellamie) #191

If you think about alternatives check this

P.s. it is off topic, no way this can be a real alternative price wise.

(Verkehrsrot) #192

Product placement is, indeed, other thread.
Paxcounter is a counter, and intentionally not a people tracking approach.

(Amedee) #193


My TTGO V2.1 eventually rebooted this morning after 19 days of operation and 6679 packets successfully received – Not too bad!
(Might be due to temperature, it is quite hot these days and the device is behind the window, exposed to the sun…)

(Verkehrsrot) #194

I currently have around 2 months uptime with a LoPy, around 15.000 packets.
The LoPy runs on an USB power plug, backed by small LiIon battery.
No reboots seen yet.

Seems the software is now running stable.

(Gry Kyo) #195

So I installed Atom and PlatformIO ahead of my Pycom first experiments but failed abysmally to even get Paxcounter onto a Heltec WiFi Lora 32 board. Multiple library and deps issues (I am a better welder than programmer, seriously!) preventing the build.
I was hoping to get a feel for the editor, platformio etc but just want to walk away now! Any hints? Issues seem to be principally Bluetooth related, libs and deps missing for the board type which is set up in the .ini file. Am I missing a large piece of something?

thx, G

(Verkehrsrot) #196

Any needed prerequisits should be automatically downloaded by PlatformIO. Sure, that you use actual PlatformIO version, AND downloaded the actual paxcounter software from branch master branch, not development?

(Verkehrsrot) #197

Paxcounter & TTN integrated in a real world passenger station display of Germany Railway.

Works like a sharm, smooth OTAA join to TTN, without external antenna :slight_smile:

Next step: put this outside on a railway station, then looking closer to the gathered count data.


(Gry Kyo) #198

And now it works! Not sure how but everything restarted and all as I thought it would be but without the hours of head scratching! Build and upload without a hitch…

Thanks @Verkehrsrot, now to learn how to use my new Paxcounter! Reading 0 but I shall RTFM :stuck_out_tongue_winking_eye:

Thanks again! G

(Verkehrsrot) #199

I am now working to make the paxcounter software more flexible. It shall operate on all ESP32 boards, whether or not they have LoRa chip and display. For boards without LoRa chip data shall be provided at a SPI or I2C interface.

So we can have a passenger flow sensor on a simple small WeMos D32 or Lilon board. Easy to use like a PIR sensor, but much smaller and cheaper.

Look in the development branch of repo for current development version. Contributors and pull requests are welcome!


very cool !


Do you mean ESP32 boards without on-board LoRa support and adding a separate LoRa tranceiver via SPI or I2C?
If so, do there exist any I2C based LoRa tranceiver boards, or do you mean Serial (UART) based boards like RN2483?

(Verkehrsrot) #203

Not necessary for adding external LoRa transceiver (but might be a use case, too), just to have a “standard” sensor which outputs the data on a wired interface, and can be integrated in any type of device.

What would be the better interfacing option for this purpose: I2C, SPI or simple serial?

Any hints to open source code with implementation of a I2C or SPI slave on a sensor?

(Verkehrsrot) #204

Paxcounter sensor with SPI interface, on a LoLin32-Lite board. Power consumption ~740mW while continously counting Wifi and Bluetooth.



And it has I2C and UART too. :slightly_smiling_face:
Other possible options are to send data wireless over WiFi (REST API or MQTT), BLE or send data via Serial over USB. (Not sure if BLE is possible, depending on how the BT tranceiver is already used in Paxcounter.)

The simplest to implement will be Serial. I2C will be possible because ESP32 supports I2C slave mode. SPI will be less practical. Its interface requires more wires and a dedicated CS signal and a faster synchronous interface like SPI will not be required for Paxcounter.