Giter Site home page Giter Site logo

bch-firmware-tool's People

Contributors

blavka avatar hubmartin avatar hubpav avatar janakj avatar kybermonty avatar muhlpachr avatar pexmor avatar smejkaljakub avatar worepix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

cynerd

bch-firmware-tool's Issues

Installation Error

Issue

While installing bcf, an error occurs and bcf can't be used. See description underneath.

Environment:

OS: Manjaro Linux 21.2.6
Kernel: Linux 5.16.2-1-MANJARO
Python 3.10.4
pip 22.1.2 from /usr/lib/python3.10/site-packages/pip (python 3.10)

Reproduction Steps

sudo pip3 install --upgrade --no-cache-dir bcf
echo 'eval "$(_BCF_COMPLETE=source bcf)"' >> ~/.bashrc
source ~/.bashrc

Error Message:

Traceback (most recent call last):
  File "/usr/bin/bcf", line 33, in <module>
    sys.exit(load_entry_point('bcf==1.8.1', 'console_scripts', 'bcf')())
  File "/usr/bin/bcf", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3.10/site-packages/bcf/cli.py", line 61, in <module>
    def command_create(name, no_git, _from, depth):
  File "/usr/lib/python3.10/site-packages/click/decorators.py", line 308, in decorator
    _param_memo(f, OptionClass(param_decls, **option_attrs))
  File "/usr/lib/python3.10/site-packages/click/core.py", line 2495, in __init__
    super().__init__(param_decls, type=type, multiple=multiple, **attrs)
TypeError: Parameter.__init__() got an unexpected keyword argument 'autocompletion'

Confusing behavior of bcf log and --raw not working

I just realized, in a hard way, that bcf log supressess log lines that do not start with the character '#':

def print(self, line):
if line[0] == '#' and line.endswith('\r\n'):
line = line[1:].strip()
index = line.find("<")
if index < 0:
return
time = self.get_time_str()
if self._record_file:
self._record_file.write(time + line + os.linesep)
self._record_file.flush()
if self._no_color:
click.echo(time + line)
else:
if index < 0:
click.echo(time + line)
else:
color = ""
try:
level_char = line[index + 1]
color = log_level_color_lut[level_char]
except Exception as e:
pass
click.echo(color + time + line[:index + 3] + Style.RESET_ALL + line[index + 3:])
elif self._raw:
time = self.get_time_str()
if self._record_file:
self._record_file.write(time + line)
self._record_file.flush()
click.echo(time + line.rstrip())

I then tried to use --raw, but that option doesn't appear to be working. Even with bcf log --raw -d /dev/ttyUSB0 I am still not seeing lines that do not match the pattern.

Case in point: When I perform a hard reboot in my firmware, the first character of the first log line that is produced after the reboot is garbage:

pi@rover:~/lora/firmware2 $ tail -f /dev/ttyUSB0
�# 0.00 <I> LoRa Module v1.1.1-37-gfa069eeb (modified) [LoRaMac v4.6.0-25-gae588f35] built on 2022-Jun-15 10:21:16 EDT
# 0.00 <D> part: Opened block 0x20000b50 (6144 B), 8 parts of 8
# 0.00 <D> Restoring system configuration from NVM
# 0.00 <D> LoRaMac: Initializing for region US915, regional parameters RP002-1.0.1
...

but bcf log --raw -d /dev/ttyUSB0 throws the entire line away:

pi@rover:~/lora/firmware2 $ bcf log --raw -d /dev/ttyUSB0
0.00 <D> part: Opened block 0x20000b50 (6144 B), 8 parts of 8
0.00 <D> Restoring system configuration from NVM
0.00 <D> LoRaMac: Initializing for region US915, regional parameters RP002-1.0.1
...

This is, in my opinion, very confusing behavior. Would it be possible to modify bcf log to always display all output so that there would be no need for --raw?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.