After connecting with the REPL using screen on OSX Mavericks,
I'm not able to exit as I would typically do with the Python REPL.
What is the preferred way to exit the REPL?
Thanks
exiting from the REPL
Re: exiting from the REPL
Well, you don't exit the REPL, except by telling the pyboard to execute something.
You can exit from your terminal emulator (i.e. screen) using whatever technique that progam uses. But the REPL will continue to run on the pyboard until its powered off, or its told to run something else.
You can exit from your terminal emulator (i.e. screen) using whatever technique that progam uses. But the REPL will continue to run on the pyboard until its powered off, or its told to run something else.
Re: exiting from the REPL
dhylands wrote:Well, you don't exit the REPL, except by telling the pyboard to execute something.
You can exit from your terminal emulator (i.e. screen) using whatever technique that progam uses. But the REPL will continue to run on the pyboard until its powered off, or its told to run something else.
Thanks.
Can I get commit rights to update the docs?
It sure would be good to know this up front
Re: exiting from the REPL
The way that you go about getting something commited is that you fork the micropython repository, create a branch and put your changes on the branch and push them to your own repository (which you'll have fiull rights to) and then you can create a Pull Request.
Your PR will be reviewed by Damien (who is the owner of the official micropython repository) and he'll either merge your change in or tell you what he would like to see changed/improved.
https://guides.github.com/introduction/flow/
Your PR will be reviewed by Damien (who is the owner of the official micropython repository) and he'll either merge your change in or tell you what he would like to see changed/improved.
https://guides.github.com/introduction/flow/
Re: exiting from the REPL
Indeed, you could, by: a) reading "screen" manual; b) by following MicroPython tutorial which gives you that hint: http://docs.micropython.org/en/latest/p ... l#mac-os-xcappy2112 wrote:It sure would be good to know this up frontdhylands wrote: You can exit from your terminal emulator (i.e. screen) using whatever technique that progam uses.
Also, please use better forum subsection for your posts - if your questions are about Pyboard, please post to the corresponding section. All your messages are moved there.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: exiting from the REPL
I'm sure I read that- some time ago. However, when you're used to exiting the REPL in the typical way ...pfalcon wrote: Indeed, you could, by: a) reading "screen" manual; b) by following MicroPython tutorial which gives you that hint: http://docs.micropython.org/en/latest/p ... l#mac-os-x
Will dopfalcon wrote: Also, please use better forum subsection for your posts - if your questions are about Pyboard, please post to the corresponding section. All your messages are moved there.
Thanks
Re: exiting from the REPL
Reset ttyUSB0 on Xubuntu 20.04.
I'm a beginner with this stuff and no programmer at all. I was searching for a way to exit REPL, of course I didn't find one cause the REPL will continue to run on the pyboard until its powered off or disconnected from the USB port. So why not resetting the USB port where your board is connected?
* I'm not responsible for dead boards, dead USB devices, dead PCs
* thermonuclear war, Corona ,or you getting fired because you are
* as bad in programming as me. Please do some research if you have
* any concerns about features included in this proceeding before
* using it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up any of your devices, I
* will laugh at you.
(borrowed from XDA and adapted)
I use dmesg command to find where ttyUSB0 was enumerated by the host. The USB-TTL converter on my board is a CP2104.
Requirements:
R/w rights on ttyUSB0.
To get them, add yourself to the dialout group and you should have permission to that device all the time. sudo gpasswd -a <username> dialout. Log out/in to make this working.
sudo chmod 666 /dev/ttyUSB0
Open 2 shells. Connect to REPL in one shell and use the 2nd to run the scripts.
Run permission_to_reset_ttyUSB0.sh, it gives permission to reset. You have to do this before first resetting and of course when you connected your board to another USB port.
To reset ttyUSB0 run ttyUSB0_reset.sh. I don't need root rights to run the script, which I don't really understand cause dmesg needs those usually.
This was tested with a cheap USB stick in another port and than changing the ports around.
* I suggest, just use your pyboard, mouse, and keyboard for a 1st testing!!!!!
I didn't encounter any problems, but this is just a starter for those who might be interested.
You may change USB device enumeration!
permission_to_reset_ttyUSB0.sh
I'm a beginner with this stuff and no programmer at all. I was searching for a way to exit REPL, of course I didn't find one cause the REPL will continue to run on the pyboard until its powered off or disconnected from the USB port. So why not resetting the USB port where your board is connected?
* I'm not responsible for dead boards, dead USB devices, dead PCs
* thermonuclear war, Corona ,or you getting fired because you are
* as bad in programming as me. Please do some research if you have
* any concerns about features included in this proceeding before
* using it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up any of your devices, I
* will laugh at you.
(borrowed from XDA and adapted)
I use dmesg command to find where ttyUSB0 was enumerated by the host. The USB-TTL converter on my board is a CP2104.
Requirements:
R/w rights on ttyUSB0.
To get them, add yourself to the dialout group and you should have permission to that device all the time. sudo gpasswd -a <username> dialout. Log out/in to make this working.
sudo chmod 666 /dev/ttyUSB0
Open 2 shells. Connect to REPL in one shell and use the 2nd to run the scripts.
Run permission_to_reset_ttyUSB0.sh, it gives permission to reset. You have to do this before first resetting and of course when you connected your board to another USB port.
To reset ttyUSB0 run ttyUSB0_reset.sh. I don't need root rights to run the script, which I don't really understand cause dmesg needs those usually.
This was tested with a cheap USB stick in another port and than changing the ports around.
* I suggest, just use your pyboard, mouse, and keyboard for a 1st testing!!!!!
I didn't encounter any problems, but this is just a starter for those who might be interested.
You may change USB device enumeration!
permission_to_reset_ttyUSB0.sh
- #!/bin/bash
sudo chmod 666 /sys/bus/usb/devices/3-1.4/authorized
sudo chmod 666 /sys/bus/usb/devices/3-1.3/authorized
sudo chmod 666 /sys/bus/usb/devices/3-1.2/authorized
- #!/bin/bash
ttyUSB=$(dmesg | grep "cp210x converter now attached to ttyUSB0" | tail -1 | cut -c 20-24)
echo $ttyUSB
if [ $ttyUSB == "3-1.4" ]; then
sh -c "echo 0 > /sys/bus/usb/devices/3-1.4/authorized"
sh -c "echo 1 > /sys/bus/usb/devices/3-1.4/authorized"
elif [ $ttyUSB == "3-1.3" ]; then
sh -c "echo 0 > /sys/bus/usb/devices/3-1.3/authorized"
sh -c "echo 1 > /sys/bus/usb/devices/3-1.3/authorized"
elif [ $ttyUSB == "3-1.2" ]; then
sh -c "echo 0 > /sys/bus/usb/devices/3-1.2/authorized"
sh -c "echo 1 > /sys/bus/usb/devices/3-1.2/authorized"
fi