OpenWrt Forum Archive

Topic: Fon 2100 Reset button and Init for Serial Console?

The content of this topic has been archived on 20 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi ppl,

I'm working on a project of creating an Fon 2100 Kismet Server with GPS logger.
For that, I did already give the Fon an Serial as well as an TTL Console with Phantompower for the GPS, as well as an SD-Card Mod.

But I ran into some problems and would need your help.

Biggest idea is I want to use the reset button to toggle the serial console of the fonera to "GPS Modus" or "Serial Console Modus".

GPS Modus should be following:
- no attached console
- 4800 baud

Serial Modus:
- ttyS0 with login / ash console to work on the fon in case of an emergency / lock out
- 9600 baud


My first idea is following to change from one mode to the other.
I boot with following /etc/inittab:
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K stop
tts/0::askfirst:/bin/ash --login
#ttyS0::askfirst:/bin/ash --login
#tty1::askfirst:/bin/ash --login
(thats the "gps" one)

i created two other inttabs
inittab.nc (no console)
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K stop
#tts/0::askfirst:/bin/ash --login
#ttyS0::askfirst:/bin/ash --login
tty1::askfirst:/bin/ash --login
stty -F /dev/ttyS0 4800


inttab.co (console)
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K stop
tts/0::askfirst:/bin/ash --login
ttyS0::askfirst:/bin/ash --login
tty1::askfirst:/bin/ash --login
stty -F /dev/ttyS0 9600


to swap the mode i simply do following
cp /etc/inttab.co /etc/inittab
init -q

with that i get into "console mode"


cp /etc/inttab.nc /etc/inittab
init -q
this starts "no console / gps mode"
problem is: the console on the serial port just doesn'T close!

i would need to enter "exit" on the serial console myself - i just can'T close it!
even doin' stuff like echo "exit" >> /dev/ttyS0 doesn't work at all...


My questions
a) anyone got an idea how to close the serial console on the serial port without manual action
b) anyone got an better idea how to solve my problem at all because that here is really quick 'n dirty
c) how do i use the reset button on the fonera to switch between both modes?
i saw an /etc/config/system file that usses the reset button. but on the fon2100 it looks like the reset button doesn'T work at all - i can press it all the time and time worths defined there - nothing happens.


thank you very much!!!

deusex

EDIT: The Serial Port Speed change in the inttab does NOT work T_T'... any ideas on that?

(Last edited by DeusExMachina on 19 Dec 2009, 18:58)

ok, in the meantime i got around the problem of changing the serial port speed.
but the other 3 problems are still there. any ideas?
thanks

deusex

The discussion might have continued from here.