bcm-cfedump
bcm-cfedump copied to clipboard
TypeError: '<' not supported between instances of 'int' and 'bytes'
Tested with python3.8, it throws this error:
[dani@tool bcm-cfedump]$ python -m bcm_cfedump -D /dev/ttyUSB0 -O nand.img -t 0.02 nand
Waiting for a prompt...
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/bcm-cfedump/bcm-cfedump/bcm_cfedump.py", line 477, in <module>
main()
File "/bcm-cfedump/bcm-cfedump/bcm_cfedump.py", line 457, in main
c.wait_for_prompt()
File "/bcm-cfedump/bcm-cfedump/bcm_cfedump.py", line 328, in wait_for_prompt
self._read(b"\r\n")
File "/bcm-cfedump/bcm_cfedump.py", line 314, in _read
return self.ser.read(*a, **kw)
File "/usr/lib/python3.8/site-packages/serial/serialposix.py", line 481, in read
while len(read) < size:
TypeError: '<' not supported between instances of 'int' and 'bytes'
[dani@tool bcm-cfedump]$
However the commit 6d61613a175b229e11fb20eddfbe4480c337cbb7 works ok
Hi, it looks like the serial library changed their API https://github.com/Depau/bcm-cfedump/blob/master/bcm_cfedump.py#L328
I can't test it, if you can send a pull request it would be great.
What version of pyserial did you use when this was written? I'm hoping a quick fix would be to use that version instead.
What version of pyserial did you use when this was written? I'm hoping a quick fix would be to use that version instead.
try my commits in my forked branch. tested with ASUS AC86U in CFE console (MX30LF2G18AC 256MB flash). i'll make a PR later.
my python version: 3.6 pyserial version: latest release (for this moment 2020/11/18)
use "nand" command to dump memory, the nand_bulk still has problem it can't work correctly.
ps. Dumpping over serial console is really slow. It took 37hr for a 256MB nand flash in 1.2Bytes/s avg speed with 115200 bps baudrate
Hi!
I've got python 3.9 & pyserial 3.4 and get the same error:
`$ python3 bcm_cfedump.py -D /dev/ttyUSB0 -O nand.bin -t 0.01 nand
Waiting for a prompt...
Traceback (most recent call last):
File "/home/.../Routers/bcm-cfedump-master/bcm_cfedump.py", line 478, in
Am I on the right track?
I already said
I can't test it, if you can send a pull request it would be great
Ok, let me try it. Be patient. Dummy here.
I've forked the repository into my account, and, well... where to go from here? I haven't made any change at all to compare with. If I ask for a PR from my fork it says we're obviously even.
What version of pyserial did you use when this was written? I'm hoping a quick fix would be to use that version instead.
try my commits in my forked branch. tested with ASUS AC86U in CFE console (MX30LF2G18AC 256MB flash). i'll make a PR later.
my python version: 3.6 pyserial version: latest release (for this moment 2020/11/18)
use "nand" command to dump memory, the nand_bulk still has problem it can't work correctly.
ps. Dumpping over serial console is really slow. It took 37hr for a 256MB nand flash in 1.2Bytes/s avg speed with 115200 bps baudrate
Already created a virtual environment with python36 and current pyserial version 3.5 and no dice. Same error.
Let me keep trying.
What version of pyserial did you use when this was written? I'm hoping a quick fix would be to use that version instead.
try my commits in my forked branch. tested with ASUS AC86U in CFE console (MX30LF2G18AC 256MB flash). i'll make a PR later. my python version: 3.6 pyserial version: latest release (for this moment 2020/11/18) use "nand" command to dump memory, the nand_bulk still has problem it can't work correctly. ps. Dumpping over serial console is really slow. It took 37hr for a 256MB nand flash in 1.2Bytes/s avg speed with 115200 bps baudrate
Already created a virtual environment with python36 and current pyserial version 3.5 and no dice. Same error.
Let me keep trying.
Does the pull request i made not working for u ? https://github.com/Depau/bcm-cfedump/pull/3
Please lmk if merging #3 fixes it.
I hadn't tried it... what was I thinking?
I just did. It does solve the "int and bytes" issue... but i'm not sure this is the result we are expecting:
=== terminal: $ python ./bcm-cfedump-master-hpo14/bcm-cfedump-master/bcm_cfedump.py -D /dev/ttyUSB0 -O nand.img -t 0.01 nand
Waiting for a prompt...
Error caused by line: '**Exception 32: EPC=80A4BB28, Cause=0000801C (BusErrWr )' Block 0 page 0 read failed, retrying.
Traceback (most recent call last): File "./bcm-cfedump-master-hpo14/bcm-cfedump-master/bcm_cfedump.py", line 280, in read_pages yield self.read_page(block, page) File "./bcm-cfedump-master-hpo14/bcm-cfedump-master/bcm_cfedump.py", line 261, in read_page addr, buf_temp = parse_serial_line(line.decode()) File "./bcm-cfedump-master-hpo14/bcm-cfedump-master/bcm_cfedump.py", line 30, in parse_serial_line addr = int(m.group('addr'), 16) AttributeError: 'NoneType' object has no attribute 'group'
=== end terminal
Those last three 'File' lines repeat themselves eight times, and there are no output files.