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

Payload send cycle has no effect #828

Closed wally2511 closed 2 years ago

wally2511 commented 2 years ago

I've tried setting the send cycle using remote commands (0A 96) and locally via the SENDCYLCE variable (followed by NVRAM flush/version increment). It seems to have no effect on the transmission interval. I'm seeing payloads as often as every 40 seconds.

Any thoughts?

image

cyberman54 commented 2 years ago

This should now be fixed by https://github.com/cyberman54/ESP32-Paxcounter/commit/9d7d0da7374f320fc92622fd43fa56eb5c4669cc and https://github.com/cyberman54/libpax/commit/1ddf5598ab7f3e3835b05e2355b92ffbf134da3c

Could you please retest and report here? Make sure that libpax API is updated in platformio.

cyberman54 commented 2 years ago

I verified it, this was indeed a bug which came in with new libpax api, which used uint16_t for millisecond sendcycle value. What happened is:

0x0a 0x96 -> 0x96 / 2 send cycle secs = 300 seconds = 300000 milliseconds

300000 = 0x493e0, casted to uint16_t this value is cropped to 0x93e0 = 37856 ms = 38 secs, and this is the cycle time you see.

The bugfix switches the libpax api from millseconds to seconds, this should now work as expected.

wally2511 commented 2 years ago

I pulled the latest version and tested it today. The send cycle is working perfectly. 👌

On Sun, 29 Aug 2021 at 19:50, Verkehrsrot @.***> wrote:

Closed #828 https://github.com/cyberman54/ESP32-Paxcounter/issues/828.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cyberman54/ESP32-Paxcounter/issues/828#event-5222546844, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHEOZ7AHC4SAX7ONS6MOWJLT7H7H3ANCNFSM5C2WZDGA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.