From: Gordon D. <go...@pr...> - 2006-11-20 21:28:30
|
Hi Dave, Thanks for the response. I am new to Linux and the Gumstix and am trying to setup the Gumstix/Robostix as the controller for a small mobile robot. I was intending to get the Gumstix to login so that I could just use shell commands to input/output data from the robot (interacting with a host program written in C++). I only have a Gumstix basix 200 at the moment and can only use serial when I have it connected to the Robostix. I guess this is not the most elegant way of doing it, but should get the project going. Thanks, Gordon ------------------------------ Message: 3 Date: Mon, 20 Nov 2006 07:49:43 -0800 From: "Dave Hylands" <dhy...@gm...> Subject: Re: [Gumstix-users] Auto Root Login To: "General mailing list for gumstix users." <gum...@li...> Message-ID: <c32...@ma...> Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Hi Gordon, > How would I set the Gumstix to automatically login as 'root' at start-up? I > can run "su ? root" at start-up, but have not been able to get it to enter a > password? I guess I'll ask, what are you trying to accomplish? Are you trying to have stuff run automatically at startup? Do you just want to not have to enter a username/password? Or something else? -- Dave Hylands Vancouver, BC, Canada <https://helios.eee.strath.ac.uk/exchweb/bin/redir.asp?URL=http://www.DaveHylands.com/>http://www.DaveHylands.com/ <https://helios.eee.strath.ac.uk/exchweb/bin/redir.asp?URL=http://www.DaveHylands.com/> |
From: Dave H. <dhy...@gm...> - 2006-11-20 22:20:49
|
Hi Gordon, > Thanks for the response. I am new to Linux and the Gumstix and am > trying to setup the Gumstix/Robostix as the controller for a small > mobile robot. > > I was intending to get the Gumstix to login so that I could just use > shell commands to input/output data from the robot (interacting with a > host program written in C++). I only have a Gumstix basix 200 at the > moment and can only use serial when I have it connected to the > Robostix. I guess this is not the most elegant way of doing it, but > should get the project going. So you just want the autologin, so your host program doesn't have to? If that's the case, then you can change this line in the /etc/inittab file on the gumstix from: ::respawn:/sbin/getty -L ttyS0 115200 vt100 to be: ::respawn:/bin/sh This will launch a shell, instead of launching getty. getty is what prompts for the username and password. You may want to add --login to the /bin/sh. The --login option to /bin/sh causes sh to treat this as a login shell. This means that it will execute /etc/profile and ~/.profile to do shell setup stuff. -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |
From: Hossein G. N. <hgn...@gm...> - 2006-11-25 08:13:23
|
Dave, I have done: ----------------------------------------------------------------------------------------------------- So you just want the autologin, so your host program doesn't have to? If that's the case, then you can change this line in the /etc/inittab file on the gumstix from: ::respawn:/sbin/getty -L ttyS0 115200 vt100 to be: ::respawn:/bin/sh -------------------------------------------------------------------------------------------------------- and I am having a problem here. I have added a file in my /etc/init.d/ called S99gps containing : gpsd /dev/ttyS2 cd /root/ ./cgps but every time that I reboot my gumstix at the very end I get: Error opening terminal: vt102. and then: # what is my problem here? Your help is greatly appreciated. Happy Holidays, HoSsEiN |
From: Dave H. <dhy...@gm...> - 2006-11-25 08:41:10
|
Hi Hossein, > and I am having a problem here. > > I have added a file in my /etc/init.d/ called S99gps containing : > > gpsd /dev/ttyS2 > cd /root/ > ./cgps So cgps is an interactive program and requires a tty. The S99gps script will run without a tty. It's fine to start gpsd from the S99gps script because its a daemon. (although note that S99gps will also be called with the stop parameter when you shutdown) To start cgps, you'll need to create a /root/.profile file which start cgps, and also add --login to the respawn line for bin/sh in /etc/inittab -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |
From: Hossein G. N. <hgn...@gm...> - 2006-11-25 11:41:52
|
Dave, I did take a look into my bin/sh but it had many characters and I could not make anything out of it. If you don't mind, can I see the files that you might have created, like your bin/sh and /root/.profile. I have not done much of this kind of work and I don't want to take my system down because of small errors. Your help would be greatly appreciated. Happy Holidays, HoSsEiN |
From: Dave H. <dhy...@gm...> - 2006-11-25 17:03:34
|
Hi Hossein, > I did take a look into my bin/sh but it had many characters and I could not > make anything out of it. > > If you don't mind, can I see the files that you might have created, like > your bin/sh and /root/.profile. I have not done much of this kind of work > and I don't want to take my system down because of small errors. It shouldn't because that's an executable program. I said that you need to add --login to the line in inttab that launched yor bin/sh. You said that you put in: ::respawn:/bin/sh I was saying you need to change it to: ::respawn:/bin/sh --login This will cause /root/.profile to be executed at startup. You put something like: echo Executing /root/.profile cgps in it. -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |
From: Hossein G. N. <hgn...@gm...> - 2006-11-26 03:26:01
|
Dave, Thanks for your response. I sure did misunderstand you. Thanks for clearing it up! I will change my: ::respawn:/bin/sh to: ::respawn:/bin/sh --login and Hopefully everything will be fine. Best Regards, HoSsEiN |
From: Hossein G. N. <hgn...@gm...> - 2006-11-26 04:44:37
|
Dave, I am still having the "Error opening terminal: vt102." I did add ::respawn:/bin/sh --login then ::respawn:/bin/login -f root but it didn't work maybe I am misuderstanding the : "To start cgps, you'll need to create a /root/.profile file which start cgps, " Best Regards, HoSsEiN |
From: Chris D. <cg...@co...> - 2006-11-26 04:52:37
|
Hossein, You must do the following: 1. Remove the call to cgps from the /etc/init.d/S99gps script 2. Put the line with /bin/sh --login back in /etc/inittab 3. Create a file /root/.profile that starts cgps just like you'd start it from the command line. If you'd start it by typing ./cgps, put that in the file. cgps requires a tty, or "teletypewriter". This name is from the really old days of Unix, when the device you would use to interact with the system was, in fact, an electronically-controlled typewriter. Nowadays tty just means a serial port or ssh login or some other interactive user session. The scripts in init.d run without a tty. You need to run cgps with a tty; thus, it must be started from a login shell on a console. Starting /bin/sh --login starts a login shell on the serial console. Login shells will execute the user's .profile file. Thus, cgps will get started. If you encounter any problems, I kindly suggest you reread this entire thread carefully. best, -chris |
From: Dave H. <dhy...@gm...> - 2006-11-26 05:03:05
|
HI Hossein, On 11/25/06, Hossein Ghaffari Nik <hgn...@gm...> wrote: > Dave, > > I am still having the "Error opening terminal: vt102." Ahh. It seems that when you use the /bin/sh that it doesn't goto the correct home directory. I did some experimenting and a better thing to use it this: ::respawn:/bin/login -f root and then put export TERM=vt100 in your .profile file before running cgps -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |
From: Hossein G. N. <hgn...@gm...> - 2006-11-26 05:15:24
|
Dave and Chris, I thank you both a bunch. It worked like a charm! and I did have to put in: "export TERM=vt100" in m .profile You have no Idea how happy I am that I made this working, and I wish you both best of lucks. Best Regards, HoSsEiN |
From: Hossein G. N. <hgn...@gm...> - 2006-11-29 10:31:55
|
Dave, I am having some problems again! I have done my auto root and the gumstix is set to start gpsd and then send my cgps data down to my serial ttyS2 port of breakout-gs. - GPS is connected to my ttyS2 RX and its inputs and will be read with gpsd and cgps. - RF transmitter (Radiometrix TX2) is connected to the TX of ttyS2. - they all share the same ground with Gumstix or the - side of my battery. - they all share the same power source, the back of the power jack with AC adapter or the V-batt of the breakout-gs. I have the 5V AC adapter and I am powering with 4.98V off of my batteries. Now every time that I power my Gumstix on battery or AC adapter the first time the cgps will be running but it will not output to my RF transmitter on ttyS2. If I do ctrl+c and then run ./cgps | tee /dev/ttyS2 everything will work for AC adapter or batteries. any suggestions? Your help is greatly appreciated. Best Regards, HoSsEiN |
From: Dave H. <dhy...@gm...> - 2006-11-29 15:01:12
|
HI Hossein, > Now every time that I power my Gumstix on battery or AC adapter the first > time > the cgps will be running but it will not output to my RF transmitter on > ttyS2. If I do ctrl+c and then run ./cgps | tee /dev/ttyS2 everything will > work for AC adapter or batteries. > > any suggestions? I'm not sure. You could try putting a sleep of few seconds before starting cgps. I suspect that the problem is somehow related to the fact that you've got two processes opening /dev/ttyS2. I also believe that gpsd may write stuff to /dev/ttyS2. I know it does autobaud and some other things. The gpsd guys have put a feture freeze on and are getting ready to release 2.34 which has a bunch of new features, like the ability to configure it to not do baud switching, and better support for the uBlox. I guess as a hacky workaround, you could always do somehing like launch cgps in the background, sleep for a few seconds, kill it and launch cgps again. -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |
From: Hossein G. N. <hgn...@gm...> - 2006-11-29 19:53:24
|
Dave, I wish I could wait for the new release of gpsd, but I have to do a delivery of my project, so they wont be much of a help for now ... but This sounds good! I guess as a hacky workaround, you could always do somehing like > launch cgps in the background, sleep for a few seconds, kill it and > launch cgps again. > how can I do this? in my /root/.profile I just have: gpsd /dev/ttyS2 ./cgps | tee /dev/ttyS2 - How can I start cgps in the background after some sleep and delays and terminate it so that I can restart cgps for the second time? - Also, I have noticed ... with the .profile that I have now, if cgps is running and I want to reboot (using the button on the board) the gumstix hangs up and I have to reset with power connection. How can I make cgps to finish and gumstix reboot with the reset button on the gumstix board! Your help is greatly appreciated. Best Regards, HoSsEiN |
From: Dave H. <dhy...@gm...> - 2006-11-29 20:05:38
|
Hi Hossein, > I wish I could wait for the new release of gpsd, but I have to do a delivery > of my project, so they wont be much of a help for now ... > > but This sounds good! > > > I guess as a hacky workaround, you could always do somehing like > > launch cgps in the background, sleep for a few seconds, kill it and > > launch cgps again. > > > > how can I do this? > > in my /root/.profile I just have: > gpsd /dev/ttyS2 > ./cgps | tee /dev/ttyS2 > > How can I start cgps in the background after some sleep and delays and > terminate it so that I can restart cgps for the second time? You can do something like this ( ./cgps | tee /dev/ttyS2 ) & cgps_pid=$! sleep 3 kill $cgps_pid You may find that just doing: gpsd /dev/ttyS2 sleep 3 ./cgps | tee/dev/ttyS2 is all that's required. This gives gpsd a chance to get initialized before starting cgps. > Also, I have noticed ... with the .profile that I have now, if cgps is > running and I want to reboot (using the button on the board) the gumstix > hangs up and I have to reset with power connection. How can I make cgps to > finish and gumstix reboot with the reset button on the gumstix board! Are you talking about the reset button on the gumstix board? If so, it will reset the processor regardless of what's running. Or are you talking about some other button? What do you mean by the "gumstix hangs up"? Hangs up where? What was output to the console? -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |
From: Hossein G. N. <hgn...@gm...> - 2006-11-30 01:54:04
|
Dave, Thanks for your reply. I did try the gpsd /dev/ttyS2 > sleep 3 > ./cgps | tee/dev/ttyS2 > and it seems to be working fine right now! thanks for your help and suggestions. When I have the gumstix running and cgps is also working and outputting to my RF transmitter (this is when in the hyperterminal I have to type in "ctrl+c" then r"eboot"), I tried to reboot using the reset button on the gumstix board but nothing happened and Hyperterminal stooped responding to any keyboard inputs and I had to unplug the power. It might have been something that happened then. I will retry it again tonight ... I thought there should be a command that I need to assign so that every time the reset button is pressed, it would stop cgps and reboot the gumstix. your help is greatly appreciated. Best Regards, HoSsEiN |
From: Dave H. <dhy...@gm...> - 2006-11-30 02:28:13
|
Hi Hossein, > It might have been something that happened then. I will retry it again > tonight ... > I thought there should be a command that I need to assign so that every time > the reset button is pressed, it would stop cgps and reboot the gumstix. As far as I know, that's a hardware reset (as far I know). Pressing it basically pulls the rug out from underneath any code running. -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |