Giter VIP home page Giter VIP logo

Comments (29)

wavesoft avatar wavesoft commented on May 25, 2024

Hello @ArtemTomin ,
it looks that the script cannot communicate with your Arduino on the port you specified.

I just pushed some changes on master that enable auto-detection. This means that cc_*.py scripts will now auto-detect where is the CCLib_proxy connected. Can you try updating to the current latest version and trying again, without specifying any -p or CC_SERIAL environment variable?

from cclib.

ArtemTomin avatar ArtemTomin commented on May 25, 2024

Dear @wavesoft,
The some problem, but o lil bit different error:
ERROR: Could not detect a CCLib_proxy connected on any serial port

from cclib.

wavesoft avatar wavesoft commented on May 25, 2024

Hey @ArtemTomin ,
It looks that there is a problem with the pyserial library. I think I have fixed it on the current master (just pushed another commit) can you try it and let me know?

from cclib.

ArtemTomin avatar ArtemTomin commented on May 25, 2024

Hi @wavesoft,
Thank you for such urgent help. But, unfortunately, it still doesn't work. Now, after ./cc_info.py or ./cc_info.py -p /dev/cu.usbmodem1411 just no reaction. Just is blinked cursor.

from cclib.

ArtemTomin avatar ArtemTomin commented on May 25, 2024

default

from cclib.

wavesoft avatar wavesoft commented on May 25, 2024

Hey @ArtemTomin , do you see the Arduino LED standing still? If yes, can you try unplugging & plugging it again?

Also, try to use the latest Arduino library. I just pushed some changes that prohibits this lockdown from happening again.

from cclib.

ArtemTomin avatar ArtemTomin commented on May 25, 2024

Hi @wavesoft,
Should I try with connected CC device, such as BLE112? Now, the some trouble. But i didn't connect any device, only arduino UNO. Did you see my screenshot?

from cclib.

wavesoft avatar wavesoft commented on May 25, 2024

Hey @ArtemTomin , unfortunately I can't see your screenshot.
You don't have to have a CC device connected to get a handshake confirmation. You should get a warning regarding wrong wiring. Are you sure the Arduino sketch is the correct?

from cclib.

ArtemTomin avatar ArtemTomin commented on May 25, 2024

Hi @wavesoft, I use simple Arduino UNO, I've uploaded your sketch from Example folder without any changes.

from cclib.

wavesoft avatar wavesoft commented on May 25, 2024

Ok, that's interesting. I from the port name I guess you are on Mac OSX? Which version? And which Python version are you using?

from cclib.

wavesoft avatar wavesoft commented on May 25, 2024

Can you also try to do a manual ping to see if there is something wrong? You can type the following:

~$ dd if=/dev/cu.usbmodem1411 bs=3 count=1 | hexdump -C&
~$ echo -ne '\xF0\x01\x01\x01' >  /dev/cu.usbmodem1411

If everything goes well you should see something like this:

[1] 12345
1+0 records in
1+0 records out
3 bytes transferred in 4.939679 secs (1 bytes/sec)
00000000  01 00 00                                          |...|
00000003
[1]+  Done                    dd if=/dev/cu.usbmodem1411 bs=3 count=1 | hexdump -C

If not, something is wrong with your set-up.

from cclib.

ArtemTomin avatar ArtemTomin commented on May 25, 2024

I see this:
[1] 24406
iMac-Artem:~ Artem$ 1+0 records in
1+0 records out
3 bytes transferred in 0.000024 secs (125829 bytes/sec)
00000000 41 69 38 |Ai8|
00000003

[1]+ Done dd if=/dev/cu.usbmodem1411 bs=3 count=1 | hexdump -C

from cclib.

ArtemTomin avatar ArtemTomin commented on May 25, 2024

When I try to connect with ./cc_info.py -p /dev/cu.usbmodem1411 I see just frozen cursor. If i disconnect Arduino, i see immediately ERROR: Could not find CCLib_proxy device on port /dev/cu.usbmodem1411

from cclib.

wavesoft avatar wavesoft commented on May 25, 2024

The response that I see there does not really look like the one that I would expect from the sketch. Are you sure that's the correct port? Could it be that there are 2 ports for the arduino board? One for the bootloader and one for the serial port?

I haven't used an Arduino UNO, so I can't say for sure.

from cclib.

ArtemTomin avatar ArtemTomin commented on May 25, 2024

I use OS X El Capitan. Python 3.
Yes, this is correct port, i use it other my application with arduino and it works fine. There is only one port. My Mac see this port and bluetooth, that all.

from cclib.

wavesoft avatar wavesoft commented on May 25, 2024

Hey @ArtemTomin , that looks like ASCII output. Can you try connecting using the Arduino Serial Monitor, type something random and hit enter? We might get something more useful out of it.

from cclib.

ArtemTomin avatar ArtemTomin commented on May 25, 2024

Hi @wavesoft !
I did it, speed is 9600. Response is just ????????? Unreadable symbols.

from cclib.

Ivening avatar Ivening commented on May 25, 2024

Hello, @wavesoft, I have the same problem as @ArtemTomin, but I use OS Windows for this.
The symptoms are the same - when I launch cc_info.py I get a frozen cursor and when disconnect USB cable out of Arduino UNO, it says ERROR: Could not find CCLib_proxy device on port com14. I use Python 2.7, Win7 x64, Arduino UNO, the sketch is without any modifications - as in your library.
I am going to flash BLE113 - so I could test the solution for CC2541. Urgently need help. Thank you.

from cclib.

maartendamen avatar maartendamen commented on May 25, 2024

Did you ever get this resolved?
I am running into the same issues. It seems that the proxy is ok when I send manual commands using Realterm. Maybe this in the version of pyserial that is used.

Before digging further, did anyone get this resolved?

from cclib.

vogler avatar vogler commented on May 25, 2024

I have the same problem using a Wemos D1 mini. Tried two different MacBooks and different versions of pyserial. How can I debug this?

❯ dd if=/dev/cu.wchusbserial1410 bs=3 count=1 | hexdump -C&
[1] 84442 84443

1+0 records in
1+0 records out
00000000  01 00 00                                          |...|
00000003
3 bytes copied, 0.000429 s, 7.0 kB/s
[1]  + 84442 done       dd if=/dev/cu.wchusbserial1410 bs=3 count=1 |
       84443 done       hexdump -C
~/zigbee/CCLib/Python master*
❯ echo -ne '\xF0\x01\x01\x01' > /dev/cu.wchusbserial1410

❯ python cc_info.py -p /dev/cu.wchusbserial1410
ERROR: Could not find CCLib_proxy device on port /dev/cu.wchusbserial1410

from cclib.

vogler avatar vogler commented on May 25, 2024

The originally raised IOError is ERROR: CCDebugger responded with an unknown status (0xa4) where the status changes (b4, c8, c8, ca, b4, b2, 30, ...).
Tried pyserial 3.0.1 and 3.4. Python is 2.7.15.

from cclib.

vogler avatar vogler commented on May 25, 2024

Tried it on my Windows PC and it works 🤔
At least the Wemos D1 mini replied correctly right away.
For it to be able to talk to the CC2531, I had to add the -E option - before that I just got No chip found. Check your connection and/or wiring!.

from cclib.

tido- avatar tido- commented on May 25, 2024

@vogler, can you explain or write the whole line where you used the -E?

@wavesoft, I have spent a few hours, but all I get on my Arduino Mega is this:
ERROR: Could not detect a CCLib_proxy connected on any serial port
I just flashed the BLINK-code to make sure the Arduino works, it does.
When I call cc_info.py the LED flashes like 2,5 times and then dark. Here ^CERROR: I hit Ctrl+c after couple seconds.
How could I dig deeper to see at which level it gets stuck?
Another way to debug?

Ubuntu Mate 18.04 - Arduino Mega 2560 - CC2531 Stick

crw-rw---- 1 root dialout 166, 0 Mai 29 19:29 /dev/ttyACM0

python-serial  3.4-2  all pyserial - module encapsulating access for the serial port


Python 2.7.15rc1

python cc_info.py
NOTE: Performing auto-detection (use -p to specify port manually)
INFO: Checking /dev/ttyACM0
^CERROR: Could not detect a CCLib_proxy connected on any serial port

sudo python cc_info.py 
NOTE: Performing auto-detection (use -p to specify port manually)
INFO: Checking /dev/ttyACM0
^CERROR: Could not detect a CCLib_proxy connected on any serial port


Python 3.6.7

python3 cc_info.py
NOTE: Performing auto-detection (use -p to specify port manually)
INFO: Checking /dev/ttyACM0
ERROR: Could not detect a CCLib_proxy connected on any serial port

sudo python3 cc_info.py
NOTE: Performing auto-detection (use -p to specify port manually)
INFO: Checking /dev/ttyACM0
ERROR: Could not detect a CCLib_proxy connected on any serial port

python3 cc_info.py -p /dev/ttyACM0
ERROR: unicode strings are not supported, please encode to bytes: 'ð\x00\x00\x00'
 - on github issue #5


Manual Ping:
$ dd if=/dev/ttyACM0 bs=3 count=1 | hexdump -C&
[1] 13599
$ 0+0 Datensätze ein
0+0 Datensätze aus
0 Bytes kopiert, 0.00838095 s, 0.0 kB/s

echo -ne '\xF0\x01\x01\x01' >  /dev/ttyACM0
[1]+  Fertig                  dd if=/dev/ttyACM0 bs=3 count=1 | hexdump -C```

from cclib.

vogler avatar vogler commented on May 25, 2024

@tido Since Windows' cmd doesn't persist history I can't look it up, but I think it was just what I wrote above, i.e., python2 cc_info.py -E.
I tried to get it to work on macOS before, but that somehow didn't work.

https://github.com/wavesoft/CCLib/blob/master/Python/cclib/ccproxy.py#L134
From your output it seems like with Python 2 this line blocks, while with Python 3 it throws. Maybe print those exceptions to debug.

from cclib.

tido- avatar tido- commented on May 25, 2024

@vogler, thank you for your quick reply. I tried it with your line.. still doesn't work.
Line 134, you mean to change the python code so, that it prints more details, than just the line @wavesoft defined?
How would you change the code ... I only read a book about C.

It looks like that wavesoft has abandoned, this neat work of his, two open commits are not merged.. if I am not wrong.
I looked now at the FORKS and this: https://github.com/kirovilya/CCLib was reForked a couple times and even in 2019 accepted commits.

from cclib.

vogler avatar vogler commented on May 25, 2024

Then I would try this fork - the commits say it's adjusted for Python 3.
https://github.com/wavesoft/CCLib/blob/master/Python/cclib/ccproxy.py#L138-L143
You could just remove this try/catch to see which exception was thrown originally.

from cclib.

tido- avatar tido- commented on May 25, 2024

if you have a Raspberry Pi (I am not a fan) you can just connect it and flash it. I wasted hours on the Arduino /ESP32 ideas. This just worked: https://github.com/jmichault/flash_cc2531

from cclib.

connermacleod69 avatar connermacleod69 commented on May 25, 2024

Hi,
I also struggled some time with this problem (Windows 10 64 bits)
Pyserial is installed!
python C:\Users\etadmin\Downloads\CCLib-master\CCLib-master\Python\cc_info.py
NOTE: Performing auto-detection (use -p to specify port manually)
INFO: Checking COM11
ERROR: Could not detect a CCLib_proxy connected on any serial port

This starts python3 on my computer!
After installing pyserial for Python27
C:\Python27\python.exe -m pip install pyserial==3.0.1
(updating pip C:\Python27\python.exe -m pip install --upgrade pip)

it works
C:\Python27\python.exe C:\Users\etadmin\Downloads\CCLib-master\CCLib-master\Python\cc_info.py -p COM11
INFO: Found a CC2530 chip on COM11

Chip information:
Chip ID : 0xa524
Flash size : 16 Kb
Page size : 2 Kb
SRAM size : 1 Kb
USB : No

Device information:
IEEE Address : 000000000000
PC : 0000

Debug status:
[ ] CHIP_ERASE_BUSY
[ ] PCON_IDLE
[X] CPU_HALTED
[ ] PM_ACTIVE
[ ] HALT_STATUS
[X] DEBUG_LOCKED
[X] OSCILLATOR_STABLE
[ ] STACK_OVERFLOW

Debug config:
[ ] SOFT_POWER_MODE
[ ] TIMERS_OFF
[ ] DMA_PAUSE
[ ] TIMER_SUSPEND

With this resolved I could follow the instructions on
https://github.com/arendst/Tasmota/wiki/Zigbee

Regards

from cclib.

rvt avatar rvt commented on May 25, 2024

On OSX I could solve this by adding:

self.ser.reset_input_buffer()
self.ser.reset_output_buffer()

after time timeout in the routine that opens the serial port.

Apparently there are some characters in the input/output buffers. The current code does´t know how to 'align' itself so clearing the buffers helps here.

from cclib.

Related Issues (20)

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.