can I change or eliminate default text console for ubuntu












0














I am using an embedded ubuntu based processor as a machine vision system. It communicates over 2 serial ports with an associated flight controller.



My problem is that one of these ports (/dev/ttyS2) is also designated by the system as the default text console. Under some circumstances the dual use causes problems. Most notably, the normal open(), close() calls supporting the vision<->flight controller communications cause stdin calls (fgets(), scanf(), etc) to fail.



I log in to the ubuntu system using ssh over wifi. I configure this by altering the installed rootfs - so never have a need for the serial console.



Is there a way to either disable this port's use as the default console, or programatically reassign stdin to the ssh/wifi console?



thanks










share|improve this question









New contributor




sneiman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • "Reading suggests that stty sets stdin to the port being configured" - not in my experience. What should happen is that stty configures the line attached to its stdin. I've also known systems reset the line characteristics when all file descriptors to that device are closed (effectively negating a naive stty ... </dev/ttyXX but I have no way of confirming if that also applies to Linux-based systems.
    – roaima
    2 hours ago












  • roaima's comment regarding stdin being set seem correct to me. I took my interpretation from man stty - but it clearly says something different than my original interpretation. I have edited question to avoid confusion.
    – sneiman
    1 hour ago
















0














I am using an embedded ubuntu based processor as a machine vision system. It communicates over 2 serial ports with an associated flight controller.



My problem is that one of these ports (/dev/ttyS2) is also designated by the system as the default text console. Under some circumstances the dual use causes problems. Most notably, the normal open(), close() calls supporting the vision<->flight controller communications cause stdin calls (fgets(), scanf(), etc) to fail.



I log in to the ubuntu system using ssh over wifi. I configure this by altering the installed rootfs - so never have a need for the serial console.



Is there a way to either disable this port's use as the default console, or programatically reassign stdin to the ssh/wifi console?



thanks










share|improve this question









New contributor




sneiman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • "Reading suggests that stty sets stdin to the port being configured" - not in my experience. What should happen is that stty configures the line attached to its stdin. I've also known systems reset the line characteristics when all file descriptors to that device are closed (effectively negating a naive stty ... </dev/ttyXX but I have no way of confirming if that also applies to Linux-based systems.
    – roaima
    2 hours ago












  • roaima's comment regarding stdin being set seem correct to me. I took my interpretation from man stty - but it clearly says something different than my original interpretation. I have edited question to avoid confusion.
    – sneiman
    1 hour ago














0












0








0







I am using an embedded ubuntu based processor as a machine vision system. It communicates over 2 serial ports with an associated flight controller.



My problem is that one of these ports (/dev/ttyS2) is also designated by the system as the default text console. Under some circumstances the dual use causes problems. Most notably, the normal open(), close() calls supporting the vision<->flight controller communications cause stdin calls (fgets(), scanf(), etc) to fail.



I log in to the ubuntu system using ssh over wifi. I configure this by altering the installed rootfs - so never have a need for the serial console.



Is there a way to either disable this port's use as the default console, or programatically reassign stdin to the ssh/wifi console?



thanks










share|improve this question









New contributor




sneiman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I am using an embedded ubuntu based processor as a machine vision system. It communicates over 2 serial ports with an associated flight controller.



My problem is that one of these ports (/dev/ttyS2) is also designated by the system as the default text console. Under some circumstances the dual use causes problems. Most notably, the normal open(), close() calls supporting the vision<->flight controller communications cause stdin calls (fgets(), scanf(), etc) to fail.



I log in to the ubuntu system using ssh over wifi. I configure this by altering the installed rootfs - so never have a need for the serial console.



Is there a way to either disable this port's use as the default console, or programatically reassign stdin to the ssh/wifi console?



thanks







linux ubuntu serial-console






share|improve this question









New contributor




sneiman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




sneiman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 42 secs ago







sneiman













New contributor




sneiman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 3 hours ago









sneimansneiman

61




61




New contributor




sneiman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





sneiman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






sneiman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • "Reading suggests that stty sets stdin to the port being configured" - not in my experience. What should happen is that stty configures the line attached to its stdin. I've also known systems reset the line characteristics when all file descriptors to that device are closed (effectively negating a naive stty ... </dev/ttyXX but I have no way of confirming if that also applies to Linux-based systems.
    – roaima
    2 hours ago












  • roaima's comment regarding stdin being set seem correct to me. I took my interpretation from man stty - but it clearly says something different than my original interpretation. I have edited question to avoid confusion.
    – sneiman
    1 hour ago


















  • "Reading suggests that stty sets stdin to the port being configured" - not in my experience. What should happen is that stty configures the line attached to its stdin. I've also known systems reset the line characteristics when all file descriptors to that device are closed (effectively negating a naive stty ... </dev/ttyXX but I have no way of confirming if that also applies to Linux-based systems.
    – roaima
    2 hours ago












  • roaima's comment regarding stdin being set seem correct to me. I took my interpretation from man stty - but it clearly says something different than my original interpretation. I have edited question to avoid confusion.
    – sneiman
    1 hour ago
















"Reading suggests that stty sets stdin to the port being configured" - not in my experience. What should happen is that stty configures the line attached to its stdin. I've also known systems reset the line characteristics when all file descriptors to that device are closed (effectively negating a naive stty ... </dev/ttyXX but I have no way of confirming if that also applies to Linux-based systems.
– roaima
2 hours ago






"Reading suggests that stty sets stdin to the port being configured" - not in my experience. What should happen is that stty configures the line attached to its stdin. I've also known systems reset the line characteristics when all file descriptors to that device are closed (effectively negating a naive stty ... </dev/ttyXX but I have no way of confirming if that also applies to Linux-based systems.
– roaima
2 hours ago














roaima's comment regarding stdin being set seem correct to me. I took my interpretation from man stty - but it clearly says something different than my original interpretation. I have edited question to avoid confusion.
– sneiman
1 hour ago




roaima's comment regarding stdin being set seem correct to me. I took my interpretation from man stty - but it clearly says something different than my original interpretation. I have edited question to avoid confusion.
– sneiman
1 hour ago










1 Answer
1






active

oldest

votes


















0














If all you want to do is to set the terminal line characteristics and have them stick, try this



# Serial line
tty=/dev/ttyS1

# Open the serial port and hold it open
sleep 300 <$tty &
slpid=$!

# Set the characteristics and run the serial port code
stty 19200... <$tty
/run/your/program

# Clean up
kill $slpid 2>/dev/null





share|improve this answer





















  • Thanks for this. It works of course, but is not my actual problem. The more I think about it, I think the kernel has stolen /dev/ttyS2 for its default text console, and I just have to figure out how to change that. There are no grub files unfortunately. I am going to close the question, and ask a better one, unless you object. seth
    – sneiman
    15 mins ago











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






sneiman is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f493094%2fcan-i-change-or-eliminate-default-text-console-for-ubuntu%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














If all you want to do is to set the terminal line characteristics and have them stick, try this



# Serial line
tty=/dev/ttyS1

# Open the serial port and hold it open
sleep 300 <$tty &
slpid=$!

# Set the characteristics and run the serial port code
stty 19200... <$tty
/run/your/program

# Clean up
kill $slpid 2>/dev/null





share|improve this answer





















  • Thanks for this. It works of course, but is not my actual problem. The more I think about it, I think the kernel has stolen /dev/ttyS2 for its default text console, and I just have to figure out how to change that. There are no grub files unfortunately. I am going to close the question, and ask a better one, unless you object. seth
    – sneiman
    15 mins ago
















0














If all you want to do is to set the terminal line characteristics and have them stick, try this



# Serial line
tty=/dev/ttyS1

# Open the serial port and hold it open
sleep 300 <$tty &
slpid=$!

# Set the characteristics and run the serial port code
stty 19200... <$tty
/run/your/program

# Clean up
kill $slpid 2>/dev/null





share|improve this answer





















  • Thanks for this. It works of course, but is not my actual problem. The more I think about it, I think the kernel has stolen /dev/ttyS2 for its default text console, and I just have to figure out how to change that. There are no grub files unfortunately. I am going to close the question, and ask a better one, unless you object. seth
    – sneiman
    15 mins ago














0












0








0






If all you want to do is to set the terminal line characteristics and have them stick, try this



# Serial line
tty=/dev/ttyS1

# Open the serial port and hold it open
sleep 300 <$tty &
slpid=$!

# Set the characteristics and run the serial port code
stty 19200... <$tty
/run/your/program

# Clean up
kill $slpid 2>/dev/null





share|improve this answer












If all you want to do is to set the terminal line characteristics and have them stick, try this



# Serial line
tty=/dev/ttyS1

# Open the serial port and hold it open
sleep 300 <$tty &
slpid=$!

# Set the characteristics and run the serial port code
stty 19200... <$tty
/run/your/program

# Clean up
kill $slpid 2>/dev/null






share|improve this answer












share|improve this answer



share|improve this answer










answered 1 hour ago









roaimaroaima

42.9k551116




42.9k551116












  • Thanks for this. It works of course, but is not my actual problem. The more I think about it, I think the kernel has stolen /dev/ttyS2 for its default text console, and I just have to figure out how to change that. There are no grub files unfortunately. I am going to close the question, and ask a better one, unless you object. seth
    – sneiman
    15 mins ago


















  • Thanks for this. It works of course, but is not my actual problem. The more I think about it, I think the kernel has stolen /dev/ttyS2 for its default text console, and I just have to figure out how to change that. There are no grub files unfortunately. I am going to close the question, and ask a better one, unless you object. seth
    – sneiman
    15 mins ago
















Thanks for this. It works of course, but is not my actual problem. The more I think about it, I think the kernel has stolen /dev/ttyS2 for its default text console, and I just have to figure out how to change that. There are no grub files unfortunately. I am going to close the question, and ask a better one, unless you object. seth
– sneiman
15 mins ago




Thanks for this. It works of course, but is not my actual problem. The more I think about it, I think the kernel has stolen /dev/ttyS2 for its default text console, and I just have to figure out how to change that. There are no grub files unfortunately. I am going to close the question, and ask a better one, unless you object. seth
– sneiman
15 mins ago










sneiman is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















sneiman is a new contributor. Be nice, and check out our Code of Conduct.













sneiman is a new contributor. Be nice, and check out our Code of Conduct.












sneiman is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f493094%2fcan-i-change-or-eliminate-default-text-console-for-ubuntu%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

CARDNET

Boot-repair Failure: Unable to locate package grub-common:i386

濃尾地震