-
Notifications
You must be signed in to change notification settings - Fork 32
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
can't set serial port #20
Comments
Can you see if you can open the serial port with a terminal program logged in as the same user? e.g. miniterm, using /dev/ttyACM0 Also can you paste the contents here of your portscan.cache file that is in the same directory as counter.py Finally, can you run it in debug mode like this:
and paste the output here Thanks |
P.S. debug is triggered from this line, so just put the word 'debug' on the command line and it will output more verbose debug info to the console. https://github.com/whaleygeek/bitio/blob/master/src/microbit/__init__.py#L28
|
I could connect using "screen" but I didn't see anything outgoing (but I imagine I need to push commands before)
|
I have no portscan.cache file, nowhere... I tried to add one with a simple |
I wanted to understand what was wrong and I tried to launch counter.py from PyCharm and put a breakpoint in getSerial in init guess I need to learn pdb or other command line debugger to see what's different when I launch from my shell Edit: arglll, you're hard with my novice skills : step into or put breakpoint in init of a module that is triggered at import... It's a bit too high for me :) |
Woooooow, that is weird. |
Perhaps you don't have create access to the folder where it is trying to store portscan.cache? That file would normally be created in the same folder as the script (counter.py), although that does assume that the current working directory is there too. I usually open a terminal and cd to the folder where counter.py is, and run it from there, to be sure that cwd is where you expect it to be. What was the output from adding debug to the command line, in the failing case? |
I managed to get it to work on Ubuntu 18.04 by adding a print statement telling me what the exceptions were. First I had error 13 (PermissionError), which was fixed with:
Then I had 16 (device or resource busy). This was because the built in dial up modem support was claiming the device. This was fixed with:
(Note, don't do this if you need to use a real dial up modem.) Hope that helps anyone that gets to this issue on Google as I did. xx |
Super, thanks @zeth this is great detective work! |
Thanks Zeth, had the same issue and this sorted it right out. Cheers! |
(Ubuntu 17.04, user added to dialout group)
After flashing bitio.hex I launched counter.py but it loops through a cycle:
The text was updated successfully, but these errors were encountered: