473,805 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I have to unplug and plug my USB device every time to communicate :(

2 New Member
I am using a linux machine with an USB port and I have to communicate with a temperature controller which has an UART port and for this I am using a USB to UART Serial Adapter.
port name on my machine is /dev/ttyUSB0
Expand|Select|Wrap|Line Numbers
  1. $port = "/dev/ttyUSB0";
  2. open(SERIALPORT,"+>$port") || die("ERROR SENDING DATA\n");
  3. SERIALPORT->autoflush();
  4.  
  5. ## in between I am sending data 
  6.  
  7. print $FILEHANDLE $data;
  8.  
and receiving back from that temperature controller ##

after all that process I am closing that file handle.
Expand|Select|Wrap|Line Numbers
  1. close(SERIALPORT);
  2.  
code is working fine one time . I am getting correct result .

but when I am trying to run the script second time then it hands at the step when I am sending data to temperature controller
Expand|Select|Wrap|Line Numbers
  1.  
  2. print $FILEHANDLE $data;
  3.  
and for this I have to unplug and plug that USB serial adapter again.after that it is working fine.

I am unable to find out what is the problem.
Can u people figure out what may be the possible reasons for it.

Thanks for your reply in advance.
Aug 19 '09 #1
2 3115
KevinADC
4,059 Recognized Expert Specialist
@ashishchauhan
What is the filehandle you are using? Is it $FILEHANDLE or SERIALPORT
Aug 19 '09 #2
ashishchauhan
2 New Member
oh sorry . it is SERIALPORT .
Aug 20 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2792
by: kamarudin samsudin | last post by:
Hi all, Im new to linux and very very new to python. But i have to write a program to communicate with a devide. The device will send a data after i send something to it. Any suggestion and help. Maybe something where i can start it. many thanx.
2
2991
by: Federico Caselli | last post by:
Is it possible write a program to communicate with an external device via bluetooth using visual basic .net (of course for windows xp sp1 or later)? I tryed to read MSDN library about System.Net.Sockets.Socket, but I'm not expert enough to see if it supports bluetooth connections. Can you please tell me if it does? If not, could you please show me how to wrap bluetooth functions in winsock api using VB.net? Thank you.
1
3033
by: Paul Tremblay | last post by:
Hi All, I am writing an application framework which consists of classes mainApp and childApp (parent, child resp). My intention is to make childApp a base class to be extended by applications that want to be plugins of mainApp. *Note*: The plugin itself is an application. So this is slightly different from the normal plug-in framework - we now have to contend with IPC (I am enforcing the restriction that the apps run on the same...
6
2955
by: Gary James | last post by:
This may not be a direct C# question, but since I'll be using using C# for development, I thought I'd pose the question here. I'll soon be involved in the design of a new software product that will employ a software "Plug-In" architecture. Taking the plug-in route will give us a design that can adapt to, as yet, undefined future requirements (within the scope of the plug-in interface spec of course). In the past I've done this with...
1
1441
by: mundra | last post by:
Can anyone help me by letting me know if there are third party libraries which i can use to commincate between a desktop and a symbian device. I know how to communicate between the desktop and a windows mobile device using the rapi interfaces. I am able to create files, delete files and so on using rapi for a windows mobile. But for a symbaim device iam helpless. Someone please help me. -thanxs in advance
0
4427
by: Chris Herring | last post by:
I am writing a WinForms app that will integrate a handheld voting device system into the app. The handhelds communicate to the PC via a USB connection. The USB device has no manufacturer driver, it simply uses the built in MS HID srv driver. It sends the results as keyboard commands. I have 2 ways to catch this data as I see it: 1) I can read the keyboard commands as they come in. In order to make sure that I get the commands even when my...
1
2279
by: Anoj | last post by:
Hi All, Is there any system event in .net through which it can be detected that a USB device is attached to the computer or deattched. If yes kindly help me with some sample code in C#? Regards, Anoj Kumar
1
1298
by: Koichi | last post by:
Hi, I'm now making a plug-in for a CG software. I embed Python in a plugin and it works. The problem is that it conflicts with other plugins that also embeds Python because it runs in the same thread. I don't know when Py_Initialize() and Py_Finalize() are executed because I don't know when user loads/unloads a plugin that embeds Python. Is there any right way to embed Python in a plug-in under the following conditions? If not, what...
2
1968
by: paridaG | last post by:
Hi Can any one help me ? I have connected a HID reader to my serial port. It is working fine through my c++ program. Is it possible to connect one more device to serial port and need to work at time. If yes ,how it is possible? Thanks in advance.
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10613
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10363
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4327
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3846
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.