Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rationalisation of logs and removal of duplicate codes (it should fix also #931) #1093

Merged
merged 3 commits into from
Nov 2, 2021

Conversation

Odyno
Copy link
Contributor

@Odyno Odyno commented Oct 27, 2021

Description:

Rationalisation of logs with removal of duplicate codes (it should fix also #931)

Checklist:

  • The pull request is done against the latest development branch
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • I accept the DCO.

@Odyno Odyno mentioned this pull request Oct 27, 2021
main/main.ino Outdated Show resolved Hide resolved
@1technophile
Copy link
Owner

One next step could be to rework the pubMQTT calls leveraging the toChar functions added.

@Odyno
Copy link
Contributor Author

Odyno commented Oct 28, 2021

Unfortunately the problem is in the to_char because: if I put the prefix "static char xxx[yy]" they are not thread safe, but if I don't put it they are subject to the stack clean when the function exits.

@Odyno Odyno force-pushed the features/log_review branch from 4c36ff9 to c0bdcd0 Compare October 28, 2021 22:19
@Odyno
Copy link
Contributor Author

Odyno commented Oct 28, 2021

@1technophile I've updated the code but had to put it back inline. I agree with you to make a review of the 30 or so versions of pubMQTT, maybe it would be useful to create an ad hoc class (maybe an extension of "client") that also manages the connection.

@1technophile
Copy link
Owner

maybe it would be useful to create an ad hoc class (maybe an extension of "client") that also manages the connection.

Indeed It would be interesting to have something more modular and that can be extended to further protocols

@1technophile
Copy link
Owner

Could you rebase it from development please, and I think we are good to go

@1technophile 1technophile added this to the v0.9.9 milestone Nov 1, 2021
@Odyno
Copy link
Contributor Author

Odyno commented Nov 1, 2021

@1technophile I have a problem now... the current development branch for me is out of size

....
Linking .pio/build/az-delivery/firmware.elf
Retrieving maximum program size .pio/build/az-delivery/firmware.elf
Checking size .pio/build/az-delivery/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
Error: The program size (1479456 bytes) is greater than maximum allowed (1310720 bytes)
RAM:   [=         ]  11.7% (used 62276 bytes from 532480 bytes)
Flash: [===*** [checkprogsize] Explicit exit, status 1
=======]  112.9% (used 1479456 bytes from 1310720 bytes)
============================================================ [FAILED] Took 51.47 seconds ============================================================

Environment    Status    Duration
-------------  --------  ------------
az-delivery    FAILED    00:00:51.469
======================================================= 1 failed, 0 succeeded in 00:00:51.469 =======================================================
The terminal process "platformio 'run'" terminated with exit code: 1.

I have this configuration

[platformio]
default_envs = az-delivery

[env:az-delivery]
lib_ldf_mode =  deep+
platform = espressif32
board = az-delivery-devkit-v4
check_tool = cppcheck, clangtidy
check_flags =
  cppcheck: -v
  clangtidy: -fix-errors -format-style=mozilla

lib_deps =
  ${env:esp32dev-all-test.lib_deps}
build_flags =
  ${env:esp32dev-all-test.build_flags}
  '-DZgatewayBT="BT"'
  '-DZgatewayRF="RF"'
  '-DLED_RECEIVE=2'
  '-DLED_RECEIVE_ON=0'
  '-DpubUnknownBLEServiceData=false'
  '-DsimpleReceiving=true'
  '-DZmqttDiscovery="HADiscovery"'
  '-DGateway_Name="OMG_BTRF_Latest"'
  '-DESPWifiManualSetup=true'
  '-Dwifi_ssid="+++++"'
  '-Dwifi_password="+++++"'
  '-DMQTT_PORT="+++++"'
  '-DMQTT_USER="+++++"'
  '-DMQTT_PASS="+++++"'
  '-DMQTT_SERVER="+++++"'
  #'-DOMG_VERSION="0.9.6-4"'
  '-DLOG_LEVEL=LOG_LEVEL_VERBOSE'  ; Enable trace level logging
  '-DvalueAsASubject=true'

do you have suggestion?

@1technophile
Copy link
Owner

1technophile commented Nov 2, 2021

do you have suggestion?

Maybe by identifying the difference with this one,
one issue also could be that Arduino_json is duplicated into the binary due to the call from decoder library and the direct call to it.
I have tried to avoid it but it may be the case

@Odyno Odyno force-pushed the features/log_review branch from 0dab0b3 to 24ec23f Compare November 2, 2021 18:09
@Odyno
Copy link
Contributor Author

Odyno commented Nov 2, 2021

@1technophile fixed, just used ${com-esp.build_flags} instead of ${env:esp32dev-all-test.build_flags}

@1technophile
Copy link
Owner

Thanks

@1technophile 1technophile merged commit bdda5df into 1technophile:development Nov 2, 2021
@Odyno Odyno deleted the features/log_review branch November 3, 2021 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants