- Community Home
- >
- Servers and Operating Systems
- >
- HPE 9000 and HPE e3000 Servers
- >
- Can't set modem control lines on the serial port /...
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-29-2016 12:58 PM
06-29-2016 12:58 PM
Can't set modem control lines on the serial port /dev/tty1p2 on an rp4440
Hi Folks,
I'm attempting to set the control lines on the /dev/tty1p2 port on an rp4440 with no luck.
The HP SE's told me it wasn't possible to activate the "remote" port on the rear of the rp4440 and that the "console" port was the only way to get any terminal or modem access. I got it to work quite easily by simply adding a line in the /etc/inittab file to start up a getty on /dev/tty1p2.
However, my real goal is to be able to set and get the status of the control lines, DTR, CTS, RTS, etc. My C program does allow me to open the tty using ioctl and allows me to set the control lines but when I get the status they are always zero.
My C program:
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
#include <termios.h>
#include <sys/modem.h>
static int fd = 0;
int main() {
int state = 0;
char *tty = "/dev/tty1p2";
/* Open the serial port or die */
fd = open(tty, O_RDWR | O_NOCTTY | O_NDELAY);
if (fd < 0)
{
fprintf(stderr, "ERROR: can not open \"%s\"\n", tty);
exit(2);
}
/* Set DTR on the port. */
ioctl(fd, TIOCMSET, TIOCM_DTR);
/* Get the status of the port. */
ioctl(fd, TIOCMGET, &state);
close(fd);
printf("Port -> %011x\n", state);
return (0);
When I run the program I always get the following output regardless of what I set:
./tty
Port -> 00000000000
I know the port is working as I put an HP terminal on it and I'm able to log in.
Yes! I have an HP terminal 700/96 that I still use on my servers in emergencies. ;o)
As always, thanks in advance for any insight, suggestions, recommendations, etc. ;o)
kev
- Tags:
- modem
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP