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

-p/--port option seems broken #161

Closed
6wheels opened this issue Mar 15, 2024 · 16 comments
Closed

-p/--port option seems broken #161

6wheels opened this issue Mar 15, 2024 · 16 comments

Comments

@6wheels
Copy link

6wheels commented Mar 15, 2024

Hi guys,

I'm trying to flash my Sonoff dongle version P as usual, but it fails with this error:

cc2538-bsl.py: error: argument -p/--port: invalid int value: '/dev/ttyUSB1'

Here is the command I use (using docker):

docker run --rm --device /dev/ttyUSB1:/dev/ttyUSB1 -e FIRMWARE_URL=https://github.com/Koenkk/Z-Stack-firmware/raw/Z-Stack_3.x.0_coordinator_20230507/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_coordinator_20230507.zip ckware/ti-cc-tool -ewv -p /dev/ttyUSB1 --bootloader-sonoff-usb

I double checked the port on which the Sonnoff dongle is connected.

After reading the commit history, I can see some changes have been made to use argparse (f42a2e2#diff-9d6356e73eb9065e1b5a72ad6cfd71d5c08cd22b7be6cb08d6318aa51885a93eR1061)

The option expects an int value and port seems to be dynamically retrieved from /dev/.
So I tried several things, but it always fails.

Any help appreciated.
Thanks.

@joshfedo
Copy link

I just ran into this as well. Use the number of the usb:
ie ../../ttyUSB0 = -p 0
../../ttyUSB1 = -p 1

@6wheels
Copy link
Author

6wheels commented Mar 15, 2024

Hi @joshfedo,
Thanks for answering, unfortunately, I already tested this, and I get another error, which is:

docker run --rm --device /dev/ttyUSB1:/dev/ttyUSB1 -e FIRMWARE_URL=https://github.com/Koenkk/Z-Stack-firmware/raw/Z-Stack_3.x.0_coordinator_20230507/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_coordinator_20230507.zip ckware/ti-cc-tool -ewv -p 1 --bootloader-sonoff-usb
Downloading firmware from https://github.com/Koenkk/Z-Stack-firmware/raw/Z-Stack_3.x.0_coordinator_20230507/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_coordinator_20230507.zip
Firmware source: 'CC1352P2_CC2652P_launchpad_coordinator_20230507.zip'
Firmware file:   'CC1352P2_CC2652P_launchpad_coordinator_20230507.hex'
ERROR: "port" must be None or a string, not <class 'int'>

So int or string? Make a choice! 😆

@sendcard
Copy link

i have run this
python cc2538-bsl.py -p --com3 -e -v -w --bootloader-sonoff-usb
CC1352P2_CC2652P_launchpad_coordinator_20230507.hex

Same error
usage: cc2538-bsl.py [-h] [-q] [-V] [-f] [-e] [-E ERASE_PAGE] [-w] [-W] [-v] [-r] [-l LEN] [-p PORT] [-b BAUD]
[-a ADDRESS] [-i IEEE_ADDRESS] [--bootloader-active-high] [--bootloader-invert-lines]
[--bootloader-sonoff-usb] [-D] [--version]
file
cc2538-bsl.py: error: argument -p/--port: expected one argument

@0sy
Copy link

0sy commented Mar 16, 2024

Same here:

cc2538-bsl.py: error: argument -p/--port: invalid int value: 'COM5'

@Yogy42
Copy link

Yogy42 commented Mar 16, 2024

First time user:
Same problem
cc2538-bsl.py: error: argument -p/--port: invalid int value: '/dev/ttyUSB0'

@accordxtc
Copy link

Add me to the list for having the same issues. What are the odds I go to change my zigbee setup and now can't flash it because of this issue. Any idea on a fix?

@git-developer
Copy link
Contributor

You can use the previous image ckware/ti-cc-tool:2024-01-28 as a workaround.

git-developer added a commit to git-developer/cc2538-bsl that referenced this issue Mar 17, 2024
@git-developer
Copy link
Contributor

I think that the change introducing this behavior in #155 was not meant on purpose.

@vjuergens
Copy link

The patch "Fix broken port arg #163" is working for me, unfortunealy I am facing now issue #162 "force_speed"

git-developer added a commit to git-developer/cc2538-bsl that referenced this issue Mar 17, 2024
@alesms
Copy link

alesms commented Mar 17, 2024

any news @JelmerT @git-developer?

@git-developer
Copy link
Contributor

No need to run out of patience:

Subscribe the PRs and you will be notified on any change.

@accordxtc
Copy link

I can confirm using the previous version I was able to update with no issues. Thanks for the quick work around.

@git-developer
Copy link
Contributor

To minimize further irritations, I updated the latest tag of image ckware/ti-cc-tool to point to the last working version 2024-01-28.

@JelmerT
Copy link
Owner

JelmerT commented Mar 18, 2024

Fixed with #163 👍
Thanks for reporting @6wheels

@JelmerT JelmerT closed this as completed Mar 18, 2024
@git-developer
Copy link
Contributor

The container image is updated.

@6wheels
Copy link
Author

6wheels commented Mar 18, 2024

Many thanks for this fast fix!

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

No branches or pull requests

10 participants