Skip to content

Conversation

@juergenRe
Copy link

Overview of changes and motivation

  1. Adding "is_unmessagable" to config
    Idea was first to add the "is_unmessagable" flag to the export/import of configurations. This seemed to be a straight forward change not touching too much functions.

  2. Problems with smoke test
    After implementing this and starting with the smoke test, I found that 50% of those tests did not pass - far too much for me to be acceptable.

There have been several reasons for those problems:

  • the radios are quite slow and especially a reboot takes lot of ressources for a certain time. This might block the communication. Especially the RAK device also cuts the serial line during the reboot which leads to time-outs.
  • The tests rely on a radio status set when successfully finishing a test. When the test fails, the status might be different, thus the next test(s) will also fail. Proper setup often is missing.
  • Missing functions to validate the channel status and to set it to a given state.
  • Packets not behaving the same when used in tests (tabulate, yaml)
  1. Changes induced by smoke test
    In order to get smoke test running correctly, I had to add some missing functions, mainly on the node side and for channel handling. It turned out, that there is no (internal) function at all to reset all channels - which is at least needed when a configuration is loaded.

Test Results

  • Unit tests pass 100%
  • integration test pass 100%
  • smoke test 1 pass 100% for HelTec running in Win/Lin, also 100% for RAK in Windows. RAK device gets blocked in Linux from time to time.
  • Build: no tested, environment not ready.

Design Problems to be discussed further

  1. When to clear secondary channels: when loading a config only or there are other occasions?
  2. Updating channel config on radio: reversed updates from the latest to the first channel to avoid writing an existent set on another index. This might have side effects. To be reviewed.
  3. Semantics of URL: In the info there are 2 URLs given. One for the primary channel and one for the whole setting. When applying the URL for the primary channel, it will overwrite it with these settings and not touching the secondary channels. Is this the right interpretation?
    What is then the function of the second, full URL? Will it overwrite just the channels which are defined and not touch the others? There might be users expecting that such an URL will just erase everything and set new occording to the URL. Has this been discussed already?
  4. In some cases, settings are not transferred correctly to the radio and the CLI does not recognize this. I encountered this problem mostly on Linux, in Windows it seems to work so far. I will open an issue later on this with some additional analysis.

Detailed Changes

  • "main.py"
    • read/write is_unmessagable from/to configuration file
    • refactor args.configure: extract common code, call setOwner() once with all user settings. Ensure, that reading of yaml also works within pytest (read first text, then pass to yaml)
    • add "--ch-info" parameter to export a full channel set including deleted and disabled channels
    • args.showNodes: add parameter printFmt to be able to force a json output circumventing table generation which always fails during test
    • logging: add capability (parameter --logTo) to log debug messages to a file for easier analysis of output. Adding timestamp, full command line and "orientation marks" to be able to visually navigate in a larger debug file
    • export_config(): refactoring, adding types, cleaning code
  • "node.py": extend showChannels() to show everything, add function to delete all secondary channels (used in args.config). Rewriting of a new channel list now starts at the end, so that the radio does never get double channel definitions during the update. Removing logger.info() calls to streamline CLI output.
  • "test_smoke1.py": create helper functions for reboot, set URL and check qr. Especially, check that the communication is back after a reboot. Add capability to pass --debug flag during the tests to store a debug log for later analysis. Store the current config temporarly and reload it at the end to avoid accidential operation in wrong region and to have the device always with a valid configuration. Reviewed all tests and improved/refined where necessary. Added a special configuration to reset channels to a known state before testing.
  • "test_node.py": add a helper function to initialize the channel set to a known, empty state with one primary channel. Will be used within the tests of main to mock a local node.
  • "test_main.py": Changes to reflect the additions in main.py. Rework test functions test_main_configure_with_snake_case() and test_main_configure_with_camel_case_keys() to do a real test (actually it did nothing because the config was not read correctly)
  • example configurations: added "is_unmessagable" setting for testing

juergenRe and others added 15 commits October 29, 2025 18:07
rename variables and methods using camel case for uniformity within module
- simplifying code, removing copy/paste parts
- configure "is_unmessagable" entry value
…and example.yaml

- configuring channels via URL will delete all channel prior to load the new settings.
- adding --fmt parameter for --nodes, otherwise pytest will always fail (problem seems to be located within tabulate library)
- minor editing to avoid mix of camel and snake case
…ks also with WSL using serial line. (You have to auto-attach serial within WSL USB Manager)
…ux testing within WSL. We should have no special approach when testing on Linux.

Moving send text message to a later point and using a private channel to not disturb everybody.
…ddional checks and waiting times to ensure that RAK can sustain those many requests and will able to finish internal operations.

Improving logging: add capability to log into file, add timestamp of call and the command itself and visually clear separations of call to CLI.
Deleting channels in the mid had some strange effects, added work-around to handle this case correctly. However, this might have side-effects when using deprecated admin channel. To be checked further!
…nly happens when reading a config.

Adding additional protobuf files as exclusion to linter
Smoke test 1: finalizing DEBUG/VERBOSE switches. Validating URL and QR functions in the right order. Systematic setup of test conditions.
…ne with snake_case

first try to solve unit test issues - not finished
- mock node completely to be able to run configuration unit test
- reset smoketest1 DEBUG settings
fix bug in url splitted over 2 lines
minor changes in formatting
@CLAassistant
Copy link

CLAassistant commented Nov 22, 2025

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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