Programming :: Open /dev/ttyS0 Hangs
Nov 29, 2010
I have a problem with programming serial port lines. my issue is that i must toggle and read single lines like rts and cts. but my program stops at the line when i open the port. here my sampe:
Code:
int port;
int i;
port = open("/dev/ttyS0", O_RDWR);
[Code].....
when I start the program it hangs on the open-function. I have tried ps with grep for ttyS0 but there is nothig found. Why hangs this function and gives me no error?
If I use ttyS1, it works. where is the problem and why I can't get an error?
target is an embedded system with busybox.
View 2 Replies
ADVERTISEMENT
May 17, 2010
I'm using Hardy and am having trouble with a ppp connection on ttyS0. I'm using pon with my own peer. My peer in /etc/ppp/peers is:
/dev/ttyS0
19200
demand
idle 60
connect /etc/ppp/chatScr.sh
90.0.0.2:90.0.0.1
[Code]...
Using plog, I see that the connect script is always failing. Using pppstats indicates nothing is being sent or received. ttyS0 looks okay in setserial (I think). Luckily, my host has a removable hard drive. When I remove the Hardy disk and use my Solaris 10 x86 disk (without touching any h/w) the connection works properly and the device on the other end of my serial cable responds correctly. The only difference with the Solaris configuration is that it has a 'noident' option as well as those above.
View 1 Replies
View Related
Mar 10, 2010
i want to install serial ttys0 to use gbox.how con i install it? ubuntu 9.04
View 2 Replies
View Related
Jun 12, 2010
CentOS 5 on a DSEB-DG motherboard. I am having trouble communicating with my APC UPS on /dev/ttyS0.
What I do know: UPS and cables are ok they work ok on my other server CentOS on a Intel S3210SH M/B Comparing the serial ports in the Hardware browser I notice that the Working system (Intel) is listed as such
Code:
The non working system lists
Code:
So I can see why the system does not work.
What I do NOT know: How can I correct this problem. Do I need to re-install the drivers? if so HOW.
View 1 Replies
View Related
May 13, 2011
We are running CentOS 5.3 on a Logic Supply PT109, a ruggedized PC. For some reason the serial ports don't work when the IRQ is configured (i.e. setting IRQ to 0 makes it work, but performance suffers with the polling).
I've used minicom, picocom, and plain old cat and echo talk to the port both with a loopback connector and to another PC. statserial shows the control lines changing as I change the various settings and connect the loopback connector. I am confident that the hardware is fine as DOS diagnostics show the COMx ports working with various baud rates. I have tried changing the IRQ from the default of 11 to 3 and 4, turning flow control on/off, and tried another PT109.
strace shows data being written, but none being received, so my theories are either the interrupts aren't being generated (doubtful since the ports tested okay with DOS) or the serial driver isn't handling the interrupt. The serial handler shows up in /proc/interrupts when the port is opened. The interrupt counts do go up slowly, but not in response to activity that I can correlate:
[Code]...
View 4 Replies
View Related
Dec 10, 2009
I am using F12 and whenever i open the firewall program it hangs. Is this common or is it just me?
View 5 Replies
View Related
May 25, 2010
I'm running Ubuntu 10.04 Server x86 64-bit and installed likewise-open, which I think is version 5.4. I can authenticate with Active Directory credentials, but it seems to hang when I log in. I can press Ctrl-C and break out of the hang, but was interested to see what was causing the behavior. I noticed lsassd was taking up about 99% of CPU while in this hung state. I then did a
Code:
tail -f /var/log/syslog and discovered lsassd was doing some type of query for what appeared to by every user in our Active Directory as I saw hundreds of entries like this being added to the syslog:
Code:
May 25 14:21:27 coe-web lsassd[1225]: 0x7f5bc72c1710:The user attributes in the cache data for 'domainjohndoe' are invalid. The cache database or user data in Active Directory could be corrupt.
Is there some setting I can change so it doesn't do this?
View 7 Replies
View Related
Feb 1, 2011
Running Maverick on my desktop. Had a strange happening sometime last night. I generally leave the computer on all the time. When I got up this morning, I saw that my computer had rebooted and it said that it wanted to check for disc errors and that there was a problem with /home It checked until about 70%, at which point it stopped advancing for a half hour, so I did a hard reboot and choose "I"gnore when I got the message again.
The computer booted fine. The disc manager gui seemed to think my hard drive is fine, but I didn't do the full, slow check. My hard drive is about a month old. When I opened "open office" there as a document to recover, indicating that the thing did in fact crash sometime last night. The next odd thing- my "Opera" web browser doesn't open the browser. The command it is calling up is "/usr/bin/opera %U" Doesn't do anything, nothing shows up as running in the status monitor. Rebooting doesn't change anything with opera, and I still get the request to do a disc scan and to try to fix errors.
I uninstalled and reinstalled the latest version of opera. I uninstalled that and installed an earlier version of opera. Then, I reinstalled the latest version of opera. In terminal, typing "opera" gives me the message: Could not initialize Opera. Typing "sudo opera" opens Opera. Using the icon to open opera still points to the same place, and still doesn't work. So, here are my questions:
1- How do I get a logfile of the crash that happened last night?
2- How do I figure out if there is a problem with the /home folder or a problem otherwise with my hard disc? How do I fix that?
3- Where would I point the "opera" icon so it opens normally?
4- Is there any way to recover the information that I previously had in Opera, such as passwords? I used "my opera" to recover my latest bookmarks, but that doesn't save passwords. I'm thinking maybe those files are still around, even though I uninstalled and reinstalled opera.
View 3 Replies
View Related
Apr 5, 2011
Using Ubuntu 11 64 bit. I tried to install a netgear driver, it didn't work so I deleted it, now every time I try to run Wireless Network Drivers the program hangs and I can't do anything with it. I have to force quit. I have removed and installed it a few times now to no avail.
View 1 Replies
View Related
Aug 14, 2010
Dear experts,I have a question about open() function of gcc3.4.6.I write a example:
Code:
using namespace std;
#include<iostream>
#include<fstream>
int main()
{
[Code].....
It can be compiled and ran.The statement file=txt_stream_file is in order to change char* to const char*. But open() function is not work,and out: can not open plots/results.txt The open() function of gcc3.4.6 is:
[Code]....
View 4 Replies
View Related
Jan 14, 2010
When I start my shell it hangs (somehow, it's being put to sleep) and I always have to control-cancel the shell before using it. Anyone know of a way to figure out what gets started on a typical shell session?
View 1 Replies
View Related
Jan 19, 2010
So I wrote a function in a class that logs the user in:
public function UserLogIn($username,$password){
if (!isset($username) || !isset($password)) {
header(Location: ../dev/index.php);
}
[Code]....
I've tested it on Linux (Ubuntu and Debian) and it works perfectly on Firefox 3 and Opera 9.5 on those two distributions. On Mac however, it hangs on both Firefox 3 and Safari. I have also tested it on Windows using Internet Explorer 7 and Firefox 3. why it hangs on Mac?
View 1 Replies
View Related
May 5, 2009
I have developed a proprietary multithreaded application using Qt library version 4.2.1 on RHEL 4 platform. The application communicates with different external interfaces using serial communication using well defined protocols. For each system I have a thread that handles data acquisition and processing, it sets an update flag which is read by the GUI thread to update GUI after specified number of seconds. The incoming data from external systems is processed and updated on GUI at certain intervals. Each system update rate on GUI is different. Generally it is 1 second. Their rate of sending data is different and is generally 1Hz, 5 Hz and 10 Hz. For systems with string data I have no issues. But some systems send raw data and I have to process every byte of the entire packet, for which I have to use for loops. Now my problem is if I keep the update rate of GUI for such systems less than a fixed number of seconds (which I have to calculate by hit and trial) the application hangs after sometime. I have tested this system exlusively by switching of all other systems and it hangs standalone.
This leads me to conclude that timing of GUI update is what is causing the application to hang. Also I read somewhere on the net that in multithreading application timers play an important role and slight variation in timing can lead to hung applications. As of now I have kept 5 seconds as the GUI update time and app runs fine. Can somebody suggest something else which might be the cause?Note that I have used mutexes, wait conditions and all necessary tools which are used in multithreading app. But it is only the timer on which I could pin down the issue.
View 6 Replies
View Related
Oct 28, 2010
A thread-aware version of gdb receives a system notification when a thread starts in the app it is debugging. GTK+ has hidden threads associated with loading icons into menus. So trying to debug a GTK+ program, even one that is apparently single-threaded, can produce a deadlock between gdb, the app and XWindows. The app (actually GdkPixbufLoader) grabs the focus, the mouse and the keyboard and then starts a thread when a menu is opened. If gdb has trouble with threads, it leaves the app blocked but still holding the mouse, et. al. Then you can't talk to gdb or any other GUI interface. To make gdb happy, all GTK+ apps need to be linked with -pthread, if you have the source. If not, gdb cannot be used. In order to break the deadlock, you need a non-GUI shell. If your /etc/inittab starts agetty, mingetty, or the like, and you can get to it with <CRTL><ALT><F3...F6>, you can do a kill -KILL <pid> on the offending app, recover and then go back to XWindows with <CTRL><ALT> <F1/F2>. Otherwise it's reboot time.
View 3 Replies
View Related
May 16, 2014
The script below doesn't stop sickbeard, and just hangs. I really can't figure out why.
#!/bin/sh
### BEGIN INIT INFO
# Provides: SickBeard
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
[Code] ...
View 1 Replies
View Related
Jul 23, 2011
My program is creating 4 threads per transaction. Threads doing nothing but simply sleeping.
Now, when transaction ends, I want to wake up all the threads from sleeping. For this I am using pthread_kill() to wake up the threads using signal SIGUSR2.
Problem raises when I put more transactions(eg. 100 trans). My process gets hangup.
View 3 Replies
View Related
Jul 16, 2010
I'm writing a Bash script to take IPTC keywords from a text file and write them, via Exiv2, to several (first batch is 100) JPEG files in a single directory. The script has one while loop inside another while loop, both terminated, but I'm pretty sure that's not my problem. I think it's how I'm incrementing the "counter" variable, although it could also be the method of parsing the text lines from the file (using cut with delimiters that have worked fine in simpler scripts).
Here's the code as I've worked it up to this point.
Code:
And yes, "keywords" checks out in Crimson Editor, Emacs GUI and nano as an ASCII file with UNIX line endings. No issues on that score.
Feeding each line consecutively into a terminal (excepting the exiv2 command) works fine: each variable echoes with the part of the text line used as a variable value as it should, even when the b variable is incremented the quick&dirty way (up arrow three commands and hit enter).
Running the above script in eval mode (sh -x) stalls after setting the b variable to one and reading in the first line of text. I'd like to know why. I'd also like some advice on another reliable method of parsing the read-in lines.
View 14 Replies
View Related
Feb 15, 2011
I am trying to install Ubuntu 10.10 x64 on a HP Pavilion p6565uk.
My PC is x64 compatible, although ubuntu will not install.
I don't get to any gui, it says ubuntu will continue install in 5 seconds, at 0, nothing happens. The CPU light is flashing, but nothing happens.
After about 10 minutes, it reboots, but when the HP splash screen shows (Before the boot selection screen) it just hangs. I have to do a hard shutdown to boot back up.
I am using wubi for install.
View 1 Replies
View Related
Feb 27, 2009
I've been learning C recently and have used Vim to write my code, however switching between tabs to compile and run annoys me so i was wondering if it would be possible to have a terminal in the bottom half of the screen inside vim. similar to most text editors.
View 1 Replies
View Related
May 19, 2011
I wish to start development for the open source projects. And going to start working on some project in C/C++ and shell/python scripts. I wish to know the best suitable development environment for this purpose? What about eclipse? I will be interacting with git, make and other open source utilities.
View 2 Replies
View Related
Jan 2, 2011
I refuse to use .net for any of my apps since I hate using proprietary code that wont work on other platforms without using emulation.
However, I do like how all the hard work is done for you and you can spend more time implementing, then actually coding stuff like socket classes, date/time classes and other wrappers to make the complex C/C++ code easier to use and tie with each other I have a custom library that I've been adding to as I need stuff, but then I got thinking, there must be something out there with everything I need to code applications, that is easy to use and more reliable and efficient then anything I'd ever make.
Does such framework exist?
View 5 Replies
View Related
Sep 1, 2010
I'm using C serial in a program to open and use a serial port but the port won't open for one reason or another. The program successfully runs on a different computer and when using RealTerm: Serial Capture Program, I can connect through the serial port with the same settings as I'm attempting through my c code. Anyone have any idea why it might be failing? I know this is still pretty vague, so let me know if there's other things I can tell you that might help to finding a solution
View 3 Replies
View Related
Jun 12, 2011
I created a dbf file via a code but the file does'nt seems to open.
Quote:
Code is running file and the file emaster.dbf and etran.dbftoo is created in the home directory but it does'nt opens(Libre Office 3 can't open it).
How to open the file.? I want to add information to the database file(Dbf) file. But until it opens how will I achieve my purpose?
View 3 Replies
View Related
Jun 8, 2011
I wanted to write the script which runs at startup and opens the terminal window the moment desktop screen appears(GNU linux).
View 3 Replies
View Related
Feb 10, 2010
i want to open and read /dev/pts/o file as a user how can i open? using normal fopen and fread functions? is it possible to open lik dat ? it der any alternate way to open and read the device files in ubuntu
View 6 Replies
View Related
Feb 18, 2010
i am creating program that gets 'key' string and directory path and finds if key string is present in any file under given path, everything seemed OK but when i put path like "/" after 5 mins i get error : Too many opened files. I've minimalized opened File object at the same time as much as posible, tried to call System.gc(),tried to close every stream every opened file, google but i still cannot search in bigger directories.
Algorithm (mine one is much bigger so i tried to make it as small as possible:
read 'path';
read 'key'(set as public);
#&
call method get('path') {
[Code]....
why I always get that runtime error ? (I need it to search hundreds of GB so when my 40GB partition do this what will bigger one do )
View 7 Replies
View Related
Dec 12, 2010
How do I use bash to open a file, (file name as first parameter) cut n char from begin of each line, and write shortened lines to new file (outputfile name as the second parameter, n as the third parameter)
View 3 Replies
View Related
Jun 30, 2011
I am not a programmer. But I feel safe enough to edit a file (afteracking it up of course.)I am using Arch with Enlightenment (E17.) I installed fwbuilder. Now when I click on the tutorial button it would not start my browser at all. The terminal gave this error;
Code:
/usr/bin/xdg-open: line 478: firefox: command not found
/usr/bin/xdg-open: line 478: mozilla: command not found
[code]....
View 2 Replies
View Related
Jan 7, 2010
I'm taking a course in school on computer graphics and we are using Linux as the main operating system. I myself am more accustomed to using windows but have always wanted to give Linux a try. So the other day I dual-booted my laptop with Fedora 12 and so far I'm liking it. I do have one main question however. I need to install Mesa to do my OpenGL programming with but I'm not sure how to install it. I have downloaded a tar.gz file from the Mesa website and have tried running it from the terminal by using these commands: (note: the commands are from the Linux Newbie Guide i found on google)
cd /Tudor's Home/local
tar -xvzf /Tudor's Home/MESA/MesaLib-7.7.tar.gz
cd "the new directory it was extracted to" (gets changed to the actual extraction folder)
./configure
make
make install
Now, I'm not sure why this doesn't work. The extracting doesn't even work so I'm not sure whether these commands are the same in Fedora or what I am doing wrong? I have installed aMSN from an rpm file and it worked perfectly but I'm not sure how to install using makeFiles. Any good tutorials on makeFiles and how to install them? or a link to Mesa as an rpm file? So I can start learning OpenGL.
View 8 Replies
View Related
Jul 9, 2010
I have a small board that has a static ram board attached to it. I have two different programs that each write to a byte of memory in the static ram board. I get a file descriptor to the device memory with the following code:
int phymemfd;
phymemfd=open("dev/mem, O_RDWR | O_SYNC);
This opens the physical memory for both reading and writing. Next I get a pointer to the beginning of my ram board.
volatile unsigned char *novram;
novram = (unsigned char *) mmap(0, getpagesize() * 31,
PROT_READ|PROT_WRITE, MAP_SHARED, phymemfd, 0x11AA0000);
I do this same code in two processes that are both running and this works fine. Now, if I take out the O_SYNC parameter, one of the programs gets into some sort of weird state.My understanding of the O_SYNC parameter is that it cause the process accessing the memory location to block, not allow another process to run, until the first process has finished writing to it.I can see that if my program doesn't block, I wouldn't really know what was in the memory location, but would I can't see how it would cause any other type of system problem.
View 1 Replies
View Related