Command Line Adventures
doggiedoc
Posts: 2,243
In a concurrent thread I mentioned get a Linux system together. Mostly as an exercise I have chosen to forego a GUI.
At this point I have successfully installed and tested a basic 'hello world.c' and using bstc I have compiled and run a simple toggle program written in spin.
My current brick wall is how to produce terminal output from spin. I can do it in c but I'm stumped on how to approach this from the command line of a bare bones Linux box.
Thanks for any insight.
Doc
At this point I have successfully installed and tested a basic 'hello world.c' and using bstc I have compiled and run a simple toggle program written in spin.
My current brick wall is how to produce terminal output from spin. I can do it in c but I'm stumped on how to approach this from the command line of a bare bones Linux box.
Thanks for any insight.
Doc
Comments
minicom is a widely used old standard program for talking to serial ports. It may be installed already, if not, you can find it in the Ubuntu Software library. Google "minicom tutorial" and you will be a guru in no time at all.
Did you find the "man" command yet?
Jeff
Just by moments!!
Paul, as a WARNING, having a Linux system is a Pandora's box full of distraction and diversion for someone with our enhanced powers of attention deficit!! There is so much to play with and so many rabbit holes to chase down....it's an AWESOME playground!!!!
That's OK, I only took time to write it because I was downloading things to take off on the PropJS adventure that heater started me on! Gotta run.....there's something shiny off in the distance!
But... I can't seem to get minicom to exit ... having to resort to killing power
Remember you can open multiple log ons using the alt-Fn key sequence. If you had say done an alt-f2, started minicom and then same but different Fnn key, you could do write compile run in one cmd screen, then alt-Fnn to the screen with minicom to watch/interact with the result. I have not tried this yet, but you should be able to set fdx object to different pins to use so as to have multiple serial channels running.
That said, I have on occasion had a program lock up the current window without the ability to do an alt-Fnn. The way to get out of this bind is to have ssh enabled (BUT NOT AS ROOT). That way you can ssh into the box as you or a maint account. Then do
Ps - ef. to find your process id. May need to use more/less if too much scrolls by then
Kill -9 nnnnnn where process id is the id of the program or terminal session you want ended.
Don't make a habit of doing this as root. If you get the PID wrong you can take down the box and loose any unsaved work. Just remember that as root the machine will think you are god. It will obey with little or no hesitation. It will rarely ask are you sure. Just think what this could do:
/# rm -rf * (the / is current directory and # is the prompt). The man page and google are your friends.
Yep, all gone..... This will give you the rare are you sure question, unless it was aliased out..... Then simply enter and all goes by- by...
Normally it tells you.
I want to try this, but I don't want to screw up my system.
EDIT - HEY! I think I already did this when setting up simpleIDE, and it works! Go figure. I should pay more attention.
While I was dinking around I also compiled Roy's Open-source-spin-compiler. It compiles spin files without problem. Didn't find any provision for loading... but didn't look to hard.
Lastly I thought the day wouldn't be complete unless I made it do minecraft. So I compiled java and set up a minecraft server. I might start liking Linux if I'm not careful.
Or I guess BSTL.
-Phil
Yes, I use Perl on Linux, too!!! :0) (another amazing tool that will drive you to madness!!!)
yeah.
If you can identify minicom's process number, you can use that number to kill the process rather than power down.
When all else fails, just type 'MAN minicom' and read the documentation.
Perhaps you are having problems with minicom thinking its talking to a modem and wanting to hangup or reset it on exit. I seem to remember having some issue like that years ago. Except mine was the opposite, minicom would appear to not start.
Try
$sudo minicom -s
Select "modem and dialing" from the menu.
Make sure the Init and Reset strings are empty. You can probably empy everything there without harm I guess you don't use a modem
On the way out select "Save setup as dfl" to make the changes stick.
Exit minicom and try again as your normal user.
-Tor
@Heater - thanks for the pointers... as it turns out, I wasn't pressing the keys properly. Minicom wants command key sequences not combinations as I was doing. :cool:
@Tor - Yes, I have that book and I like it too. My interests seem to follow different paths these days.
Use 'kill' to kill a process, but take a look at 'man kill' for how to do so.
The command line in Linux is extremely powerful when compare to Windows. And mostly so because the 'man -k (keyword)' will take you to available documentation for most of what is installed and available.
Of course, since you have to first start 'minicom' to get a PID, you have to open a second terminal window to do these things.
@doggiedoc
I use command line in Linux a lot, but haven't the courage to run a headless server.
Check out the nohup command. http://en.wikipedia.org/wiki/Nohup
Allows you to logout and leave things running. Not the best solution but has worked very well for us.
EDIT: Quick test = seems to work fine.
It is definetly NOT Ubuntu Linux.. probably Debian of sorts. No Xwindows, very small amount of storage and SRAM.