Search Results

Search found 4296 results on 172 pages for 'serial ports'.

Page 6/172 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • front usb wont mount harddrives, internal usb ports do

    - by Thesgsuser
    I have noticed something in my new build, i am using Ubuntu desktop newest version my motherboard is the asus f1a75-m pro R2.0 with the usb ports in the back all my NTFS hard disks or usb sticks work fine, but then.. when i put them in the front usb ports of my chassis (silverstone milo ml-03) they wont mount... I have 2 usb 3.0 ports in front of the case connected with a internal usb 3.0 header. But i verified that the usb 3.0 ports on the back do mount the harddisk so it has nothing to do with usb 3.0 i think. The strange thing is, my mouse works fine on the front usb ports. Every usb hardware piece seems to work except if it has any memory inside it :( What seems to be the problem?

    Read the article

  • What ports do I allow over my internal firewall interface?

    - by blsub6
    I have a Cisco ASA that I have VPN tunnels to connect my internal Windows network. I ran into some trouble logging into my domain so I unblocked all the ports on that internal interface. On a previous question posted here, the general consensus was that I should be blocking ports on my inside interface but my question is: what ports should I unblock? I've tried unblocking ports 88, 139, 135, 389, and 445 and Windows logins still give me problems. Is there some MS documentation somewhere that tells me what I need to unblock to allow Windows logins and other things?

    Read the article

  • Ruby Mobile Ports

    - by Nathan Campos
    I'm now learning Ruby because I saw it's a very powerfull language, but now I want to know what mobile ports of Ruby we have and for what devices. PS: I have a HTC S711, HP iPAQ Hx2, Nokia E61, Nokia N95, Palm T|X, Palm Z22, HP Jornada 720..., it's better if I can use it on these platforms, but I'm open to buy other devices, as I'm a mobile addict.

    Read the article

  • MySQL on two ports using IPTables - self-access

    - by b0rman
    I trying to make MySQL available by 2 ports: 3306 and 3339 I added rule to iptables: iptables -t nat -A PREROUTING -i bond0 -p tcp --dport 3339 -j REDIRECT --to-port 3306 and everythin is great for remote connections. But if I'm trying to connect it locally, I'm getting an error: mysql -u username -ppassword --port=3339 -h Host.Name ERROR 2003 (HY000): Can't connect to MySQL server on 'Host.Name' (111) Any ideas how can I edit iptables to get local access via 3339 port?

    Read the article

  • BizTalk: Internals: the Partner Direct Ports and the Orchestration Chains

    - by Leonid Ganeline
    Partner Direct Port is one of the BizTalk hidden gems. It opens simple ways to the several messaging patterns. This article based on the Kevin Lam’s blog article. The article is pretty detailed but it still leaves several unclear pieces. So I have created a sample and will show how it works from different perspectives. Requirements We should create an orchestration chain where the messages should be routed from the first stage to the second stage. The messages should not be modified. All messages has the same message type. Common artifacts Source code can be downloaded here. It is interesting but all orchestrations use only one port type. It is possible because all ports are one-way ports and use only one operation. I have added a B orchestration. It helps to test the sample, showing all test messages in channel. The Receive shape Filter is empty. A Receive Port (R_Shema1Direct) is a plain Direct Port. As you can see, a subscription expression of this direct port has only one part, the MessageType for our test schema: A Filer is empty but, as you know, a link from the Receive shape to the Port creates this MessageType expression. I use only one Physical Receive File port to send a message to all processes. Each orchestration outputs a Trace.WriteLine(“<Orchestration Name>”). Forward Binding This sample has three orchestrations: A_1, A_21 and A_22. A_1 is a sender, A_21 and A_22 are receivers. Here is a subscription of the A_1 orchestration: It has two parts A MessageType. The same was for the B orchestration. A ReceivePortID. There was no such parameter for the B orchestration. It was created because I have bound the orchestration port with Physical Receive File port. This binding means the PortID parameter is added to the subscription. How to set up the ports? All ports involved in the message exchange should be the same port type. It forces us to use the same operation and the same message type for the bound ports. This step as absolutely contra-intuitive. We have to choose a Partner Orchestration parameter for the sending orchestration, A_1. The first strange thing is it is not a partner orchestration we have to choose but an orchestration port. But the most strange thing is we have to choose exactly this orchestration and exactly this port.It is not a port from the partner, receive orchestrations, A_21 or A_22, but it is A_1 orchestration and S_SentFromA_1 port. Now we have to choose a Partner Orchestration parameter for the received orchestrations, A_21 and A_22. Nothing strange is here except a parameter name. We choose the port of the sender, A_1 orchestration and S_SentFromA_1 port. As you can see the Partner Orchestration parameter for the sender and receiver orchestrations is the same. Testing I dropped a test file in a file folder. There we go: A dropped file was received by B and by A_1 A_1 sent a message forward. A message was received by B, A_21, A_22 Let’s look at a context of a message sent by A_1 on the second step: A MessageType part. It is quite expected. A PartnerService, a ParnerPort, an Operation. All those parameters were set up in the Partner Orchestration parameter on both bound ports.     Now let’s see a subscription of the A_21 and A_22 orchestrations. Now it makes sense. That’s why we have chosen such a strange value for the Partner Orchestration parameter of the sending orchestration. Inverse Binding This sample has three orchestrations: A_11, A_12 and A_2. A_11 and A_12 are senders, A_2 is receiver. How to set up the ports? All ports involved in the message exchange should be the same port type. It forces us to use the same operation and the same message type for the bound ports. This step as absolutely contra-intuitive. We have to choose a Partner Orchestration parameter for a receiving orchestration, A_2. The first strange thing is it is not a partner orchestration we have to choose but an orchestration port. But the most strange thing is we have to choose exactly this orchestration and exactly this port.It is not a port from the partner, sent orchestrations, A_11 or A_12, but it is A_2 orchestration and R_SentToA_2 port. Now we have to choose a Partner Orchestration parameter for the sending orchestrations, A_11 and A_12. Nothing strange is here except a parameter name. We choose the port of the sender, A_2 orchestration and R_SentToA_2 port. Testing I dropped a test file in a file folder. There we go: A dropped file was received by B, A_11 and by A_12 A_11 and A_12 sent two messages forward. The messages were received by B, A_2 Let’s see what was a context of a message sent by A_1 on the second step: A MessageType part. It is quite expected. A PartnerService, a ParnerPort, an Operation. All those parameters were set up in the Partner Orchestration parameter on both bound ports. Here is a subscription of the A_2 orchestration. Models I had a hard time trying to explain the Partner Direct Ports in simple terms. I have finished with this model: Forward Binding Receivers know a Sender. Sender doesn’t know Receivers. Publishers know a Subscriber. Subscriber doesn’t know Publishers. 1 –> 1 1 –> M Inverse Binding Senders know a Receiver. Receiver doesn’t know Senders. Subscribers know a Publisher. Publisher doesn’t know Subscribers. 1 –> 1 M –> 1 Notes   Orchestration chain It’s worth to note, the Partner Direct Port Binding creates a chain opened from one side and closed from another. The Forward Binding: A new Receiver can be added at run-time. The Sender can not be changed without design-time changes in Receivers. The Inverse Binding: A new Sender can be added at run-time. The Receiver can not be changed without design-time changes in Senders.

    Read the article

  • Reading from serial port with Boost Asio?

    - by trikri
    Hi! I'm going to check for incoming messages (data packages) on the serial port, using Boost Asio. Each message will start with a header that is one byte long, and will specify which type of the message has been sent. Each different type of message has an own length. The function I'm about to write should check for new incoming messages continually, and when it finds one it should read it, and then some other function should parse it. I thought that the code might look something like this: void check_for_incoming_messages() { boost::asio::streambuf response; boost::system::error_code error; std::string s1, s2; if (boost::asio::read(port, response, boost::asio::transfer_at_least(0), error)) { s1 = streambuf_to_string(response); int msg_code = s1[0]; if (msg_code < 0 || msg_code >= NUM_MESSAGES) { // Handle error, invalid message header } if (boost::asio::read(port, response, boost::asio::transfer_at_least(message_lengths[msg_code]-s1.length()), error)) { s2 = streambuf_to_string(response); // Handle the content of s1 and s2 } else if (error != boost::asio::error::eof) { throw boost::system::system_error(error); } } else if (error != boost::asio::error::eof) { throw boost::system::system_error(error); } } Is boost::asio::streambuf is the right thing to use? And how do I extract the data from it so I can parse the message? I also want to know if I need to have a separate thread which only calls this function, so that it get called more often? Isn't there a risk for loosing data in between two calls to the function otherwise, because so much data comes in that it can't be stored in the serial ports memory? I'm using Qt as a widget toolkit and I don't really know how long time it needs to process all it's events.

    Read the article

  • Serial Communication between Java RXTX and Arduino

    - by SharpBarb
    I'm trying to communicate between my PC (Windows 7 using Netbeans and RXTX) with an Arduino Pro, using the serial port. The Arduino is actually connected to the PC using an FTDI cable. The code is based on the Java SimpleRead.Java found here. Currently the Arduino simply prints out a string when it starts up. My Java program should print the number of bytes that have been read and then print out the contents. The Java program works, sort of... If the string is long (10 bytes or so) the output will get broken up. So if on the Arduino I print Serial.println("123456789123456789"); //20 bytes including '\r' and '\n' The output of my Java program may look something like: Number of Bytes: 15 1234567891234 Number of Bytes: 5 56789 or Number of Bytes: 12 1234567891 Number of Bytes: 8 23456789 I'm thinking it's a timing problem, because when I manually go through the code using the debugger, the result string is always what it should be: one 20 byte string. I've been messing with various things but I haven't been able to fix the problem. Here is the part of the code that is giving me problems: static int baudrate = 9600, dataBits = SerialPort.DATABITS_8, stopBits = SerialPort.STOPBITS_1, parity = SerialPort.PARITY_NONE; byte[] readBuffer = new byte[128]; ... ... public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { if (input.available() > 0) { //Read the InputStream and return the number of bytes read numBytes = input.read(readBuffer); String result = new String(readBuffer,0,numBytes); System.out.println("Number of Bytes: " + numBytes); System.out.println(result); } } catch (IOException e) { System.out.println("Data Available Exception"); } }

    Read the article

  • Thread to receive the messages from serial port is not working using c#

    - by karthik
    I am using Serial port to receive the messages. The below function is running in a thread. When i debug i find that the thread is running properly. But "if (sp.IsOpen)" is always false, due to which the code is not executing inside the IF condition at all. It says the Port is closed. I will be having multiple serial ports in my system and i will not know, which port will receive the message. So i need to listen to all the ports in one Thread. How can i solve my problem here ? private void ListenerPorts() { log.Info("Listening Thread Started"); while (true) { //foreach (SerialPort sp in storeport) foreach (SerialPort sp in comPortsList) { if (sp.IsOpen) { sp.ReadTimeout = readTimeoutInMs; sp.WriteTimeout = writeTimeoutInMs; try { string msg = sp.ReadLine(); this.GetMessageRichTextBox("Message : " + msg + "\n"); sp.WriteLine(sp.PortName); if (msg.Contains("COM")) { // is AutoScan receiverPortName = sp.ReadLine(); this.updateLblStatusRichTextBox(sp.PortName + " is connected to " + msg + "\n"); } else { //standalone is uppercase ReceiverPortName = sp.ReadLine(); this.updateLblStatusRichTextBox(sp.PortName + " is connected to " + ReceiverPortName + "\n"); } } catch (Exception ex) { // no data System.Diagnostics.Debug.WriteLine(sp.PortName + " : " + ex.Message); } } } } }

    Read the article

  • Sms via a nokia phone over a serial port

    - by abigblackman
    Hi, I'm trying to send a sms via a Nokia phone over serial which is easy enough via putty. The commands from the nokia documentation works fine. However, trying to send the same commands from a c# application fails miserably. I've run Sysinternals PortMon and can see the commands come through OK, the only difference I can see is in the way it connects but I am having trouble finding the commands that would iron out those differences. The code I'm running looks a little bit like this using (SerialPort port = new SerialPort(comPort, 9600, Parity.None, 8, StopBits.One)) { port.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived); port.ErrorReceived += new SerialErrorReceivedEventHandler(port_ErrorReceived); //port.ReceivedBytesThreshold = 1; port.DtrEnable = true; port.RtsEnable = true; port.ReadTimeout = 1; port.Handshake = Handshake.XOnXOff; try { port.Open(); port.WriteLine("AT"); port.WriteLine("AT+CMGF=1"); port.WriteLine("AT+CMGS=\"" + number + "\""); port.WriteLine(message); port.Write(new byte[] { (byte)26 }, 0, 1); } finally { if (port.IsOpen) { port.Close(); } } The differences I'm seeing in the trace from the serial port are At the start 0.00001844 aspnet_wp.exe IOCTL_SERIAL_SET_HANDFLOW USBSER001 SUCCESS Shake:1 Replace:43 XonLimit:4096 XoffLimit:4096 And at the very end 0.00061153 aspnet_wp.exe IOCTL_SERIAL_PURGE USBSER001 SUCCESS Purge: RXABORT RXCLEAR 0.00004442 aspnet_wp.exe IOCTL_SERIAL_PURGE USBSER001 SUCCESS Purge: TXABORT TXCLEAR Has anyone got any tips on how to iron out these issues? I also notice that the phone is not responding back to the application with any acknowledgement when I issue a command so I suspect the problem is with the connection, not those messages at the end.

    Read the article

  • How to remap Fn key combinations (Lenovo G500)

    - by Anatoli
    I am running Kubuntu 13.10 on a Lenovo G500 laptop. My question is similar to this one: How can I remap my F keys on my HP laptop? That is to say, my F1-F12 keys are mapped to certain special functions, and only holding down the Fn key restores access to the standard F1-F12 keys. How do I remap certain keys? I would like to know if there is a way to remap Fx to Fn+Fx and vice-versa. As per the instructions of #87043 I checked my BIOS and there is no option to switch the Fx/Fn key functionality. Googling through Leonovo's support forums indicates a BIOS update enabling this is in the works, but there's no indication of when it will be complete. Using xev I was able to see what X sees when F1-F12 are pressed. Some send separate keycodes, but some are somehow mapped to key combinations or other unknown things: F1 - XF86AudioMute F2 - XF86AudioVolumeLower F3 - XF86AudioVolumeRaise F4 - Alt_L + F4 F5 - F5 F6 - Disables touchapd, cannot quite understand what xev tells me is happening, reenables if disabled (Kernel log reveals these have well-defined scancodes not assigned to any keycodes) F7 - XF86WLAN F8 - Alt_L + Ctrl_L + Tab F9 - Turns off LCD backlight, xev sees nothing F10 - Super_L + p F11 - XF86MonBrightnessLower F12 - XF86MonBrightnessRaise Following the instrusctions on this page: How do I remap certain keys? I remapped all the keys that have definite keycodes (F1, F2, F3, F5, F7, F11, F12) This still leaves the F4, F6, F8, F9, F10 keys not functioning properly. This is especially frustarting since F4, F6, F9 now kill the current window, the touchpad and screen, respectively. Any help on remapping these keys to their proper functions would be much appreciated! -Anatoli xev output for these 5 keys: F4 KeyPress event, serial 40, synthetic NO, window 0x4800001, root 0x9d, subw 0x0, time 3674037, (228,298), root:(911,321), state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False FocusOut event, serial 40, synthetic NO, window 0x4800001, mode NotifyGrab, detail NotifyAncestor FocusIn event, serial 40, synthetic NO, window 0x4800001, mode NotifyUngrab, detail NotifyAncestor KeymapNotify event, serial 40, synthetic NO, window 0x0, keys: 4294967197 0 0 0 0 0 0 0 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 KeyRelease event, serial 40, synthetic NO, window 0x4800001, root 0x9d, subw 0x0, time 3674040, (228,298), root:(911,321), state 0x8, keycode 70 (keysym 0xffc1, F4), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False KeyRelease event, serial 40, synthetic NO, window 0x4800001, root 0x9d, subw 0x0, time 3674042, (228,298), root:(911,321), state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False ClientMessage event, serial 40, synthetic YES, window 0x4800001, message_type 0x12a (WM_PROTOCOLS), format 32, message 0x12b (WM_DELETE_WINDOW) F6 disabling touchpad MappingNotify event, serial 40, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 8, count 248 FocusOut event, serial 40, synthetic NO, window 0x4600001, mode NotifyGrab, detail NotifyAncestor FocusIn event, serial 40, synthetic NO, window 0x4600001, mode NotifyUngrab, detail NotifyAncestor KeymapNotify event, serial 40, synthetic NO, window 0x0, keys: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 MappingNotify event, serial 41, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 8, count 248 F6 enabling touchpad MappingNotify event, serial 42, synthetic NO, window 0x0, request MappingKeyboard, first_keycode 8, count 248 FocusOut event, serial 42, synthetic NO, window 0x4600001, mode NotifyGrab, detail NotifyAncestor FocusIn event, serial 42, synthetic NO, window 0x4600001, mode NotifyUngrab, detail NotifyAncestor KeymapNotify event, serial 42, synthetic NO, window 0x0, keys: 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 MappingNotify event, serial 43, synthetic NO, window 0x0, request MappingPointer, first_keycode 0, count 0 F8 doing whatever it is F8 does KeyPress event, serial 40, synthetic NO, window 0x4600001, root 0x9d, subw 0x0, time 3508985, (13,-12), root:(696,11), state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False KeyPress event, serial 40, synthetic NO, window 0x4600001, root 0x9d, subw 0x0, time 3508986, (13,-12), root:(696,11), state 0x8, keycode 37 (keysym 0xffe3, Control_L), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False KeyPress event, serial 40, synthetic NO, window 0x4600001, root 0x9d, subw 0x0, time 3508988, (13,-12), root:(696,11), state 0xc, keycode 23 (keysym 0xff09, Tab), same_screen YES, XLookupString gives 1 bytes: (09) " " XmbLookupString gives 1 bytes: (09) " " XFilterEvent returns: False KeyRelease event, serial 40, synthetic NO, window 0x4600001, root 0x9d, subw 0x0, time 3508989, (13,-12), root:(696,11), state 0xc, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False KeyRelease event, serial 40, synthetic NO, window 0x4600001, root 0x9d, subw 0x0, time 3508991, (13,-12), root:(696,11), state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False KeyRelease event, serial 40, synthetic NO, window 0x4600001, root 0x9d, subw 0x0, time 3508994, (13,-12), root:(696,11), state 0x0, keycode 23 (keysym 0xff09, Tab), same_screen YES, XLookupString gives 1 bytes: (09) " " XFilterEvent returns: False F9 gives no output to xev F10 doing whatever it is F10 does KeyRelease event, serial 40, synthetic NO, window 0x4600001, root 0x9d, subw 0x0, time 3586076, (9,-14), root:(692,9), state 0x0, keycode 10 (keysym 0x31, 1), same_screen YES, XLookupString gives 1 bytes: (31) "1" XFilterEvent returns: False KeyPress event, serial 40, synthetic NO, window 0x4600001, root 0x9d, subw 0x0, time 3586552, (9,-14), root:(692,9), state 0x0, keycode 133 (keysym 0xffeb, Super_L), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False KeyPress event, serial 40, synthetic NO, window 0x4600001, root 0x9d, subw 0x0, time 3586554, (9,-14), root:(692,9), state 0x40, keycode 33 (keysym 0x70, p), same_screen YES, XLookupString gives 1 bytes: (70) "p" XmbLookupString gives 1 bytes: (70) "p" XFilterEvent returns: False KeyRelease event, serial 40, synthetic NO, window 0x4600001, root 0x9d, subw 0x0, time 3586557, (9,-14), root:(692,9), state 0x40, keycode 33 (keysym 0x70, p), same_screen YES, XLookupString gives 1 bytes: (70) "p" XFilterEvent returns: False KeyRelease event, serial 40, synthetic NO, window 0x4600001, root 0x9d, subw 0x0, time 3586560, (9,-14), root:(692,9), state 0x40, keycode 133 (keysym 0xffeb, Super_L), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False

    Read the article

  • C: cross-platform RS232 serial library?

    - by Hamza
    Hi folks, I am looking for an open source cross-platform library for working with the serial port in C, something along the lines of the awesome pyserial library (Unfortunately I have to use C for this application) I have only found this one: http://www.teuniz.net/RS-232/ and that doesn't seem to have mention OSX compatibility. Any recommendations/comments would be greatly appreciated. Thanks.

    Read the article

  • Monitor serial port already open

    - by Cristiano
    Hi, I am try to read data over serial port already open. I have used C# and c++ library for use microsoft api (overlapped and not overlapped I/O), but not work. I can use same windows api? or other?? Thanks in advance for your availability, Cristiano http://bugbusters.altervista.org/index.php

    Read the article

  • serial port in C

    - by user222820
    I have written a program in C to send a byte to serial port (com). I have used BIOSCOM to send data but I guess that it doesn't open the port. Please tell how I can open and close a com port in C. My code is here: #define COM1 1; bioscom (1 , 65 , COM1); Please help me...

    Read the article

  • Robust and easy to implement serial bus (automotive application)

    - by JcMaco
    What serial communication bus would you use in a automotive embedded system if your main selection criteria were: * Electrically robust * Slow speed (32 kb/s) * Easy to program * Easy to interface with microcontrollers It won't be transferring much data, but it will need to be transferred periodically at high speed (100 - 500 Hz). I find that RS-232 is just not reliable enough if you have noise in your ground line. CAN-bus seems interesting, but I have no experience with it. We are currently interested in a combination of AVR AT90CAN128 microcontrollers.

    Read the article

  • C# check if a COM (Serial) port is already open

    - by TK
    Is there an easy way of programmatically checking if a serial COM port is already open/being used? Normally I would use: try { // open port } catch (Exception ex) { // handle the exception } However, I would like to programatically check so I can attempt to use another COM port or some such.

    Read the article

  • Reopening serial port fails if not closed properly with CloseHandle

    - by superg
    I am working with USB device on Windows that is seen as a virtual serial port. I can communicate with the device using CreateFile and ReadFile functions, but in some cases my application does not call CloseHandle (when my application in development crashes). After that all calls to CreateFile fail (ERROR_ACCESS_DENIED), and the only solution is to log in to my computer again. Is there any way to force closing the open handle (or reopening) programmatically?

    Read the article

  • Converting serial port data to TCP/IP in a linux environment

    - by Doug
    Thank you in advance. I need to get data from the serial port of a linux system and convert it to TCP/IP to send to a server. Is this difficult to do? I have some basic programming experience but not much experience with Linux. Are there any open source applications that do this? Again thank you for any help.

    Read the article

  • EnOcean -> USB Serial Communication (C++)

    - by regorianer
    I guess it is not the right place to ask here for enocean specific details, but maybe I am doing something wrong by using serial connections and you can help me no matter if there is knowledge about this technology or not. I have a problem to communicate with the RCM152 Module. I have written a C++ program to communicate with the RCM152 by emulating packets of the PTM 200. I teach the RCM152 to listen to the following packets: [06/19/12 04:21:44.546] INFO: SENDING BYTE : 55 <-- start byte [06/19/12 04:21:44.546] INFO: SENDING BYTE : 00 <-- head begin [06/19/12 04:21:44.546] INFO: SENDING BYTE : 07 [06/19/12 04:21:44.546] INFO: SENDING BYTE : 07 [06/19/12 04:21:44.546] INFO: SENDING BYTE : 01 <-- head end [06/19/12 04:21:44.546] INFO: SENDING BYTE : 7a <-- CRC Check [06/19/12 04:21:44.546] INFO: SENDING BYTE : f6 <-- packet type [06/19/12 04:21:44.546] INFO: SENDING BYTE : 20 <-- My action (00 and 10 -> OFF, 20 and 30 -> ON) [06/19/12 04:21:44.546] INFO: SENDING BYTE : 00 <-- serial.byte 3 [06/19/12 04:21:44.546] INFO: SENDING BYTE : 24 <-- serial.byte 2 [06/19/12 04:21:44.546] INFO: SENDING BYTE : 21 <-- serial.byte 1 [06/19/12 04:21:44.546] INFO: SENDING BYTE : 87 <-- serial.byte 0 [06/19/12 04:21:44.546] INFO: SENDING BYTE : 30 <-- status [06/19/12 04:21:44.546] INFO: SENDING BYTE : 03 <-- 03 for send, 01 for receiver [06/19/12 04:21:44.546] INFO: SENDING BYTE : ff <-- begin destination [06/19/12 04:21:44.546] INFO: SENDING BYTE : ff [06/19/12 04:21:44.546] INFO: SENDING BYTE : ff [06/19/12 04:21:44.546] INFO: SENDING BYTE : ff <-- end destination [06/19/12 04:21:44.546] INFO: SENDING BYTE : ff <-- Transmission quality (sender ff) [06/19/12 04:21:44.546] INFO: SENDING BYTE : 00 [06/19/12 04:21:44.547] INFO: SENDING BYTE : 10 <-- CRC Check A PTM200 Device or a SG-FUS-24-230 Device are sending equivalent packets like: [06/19/12 04:30:31.106] INFO: Received Byte: 55 [06/19/12 04:30:31.106] INFO: Received Byte: 00 [06/19/12 04:30:31.106] INFO: Received Byte: 07 [06/19/12 04:30:31.106] INFO: Received Byte: 07 [06/19/12 04:30:31.106] INFO: Received Byte: 01 [06/19/12 04:30:31.106] INFO: Received Byte: 7a [06/19/12 04:30:31.106] INFO: Received Byte: f6 [06/19/12 04:30:31.106] INFO: Received Byte: 40 [06/19/12 04:30:31.106] INFO: Received Byte: 00 [06/19/12 04:30:31.106] INFO: Received Byte: 24 [06/19/12 04:30:31.106] INFO: Received Byte: 6c [06/19/12 04:30:31.106] INFO: Received Byte: 2f [06/19/12 04:30:31.106] INFO: Received Byte: 30 [06/19/12 04:30:31.106] INFO: Received Byte: 01 [06/19/12 04:30:31.106] INFO: Received Byte: ff [06/19/12 04:30:31.106] INFO: Received Byte: ff [06/19/12 04:30:31.108] INFO: Received Byte: ff [06/19/12 04:30:31.108] INFO: Received Byte: ff [06/19/12 04:30:31.108] INFO: Received Byte: 37 [06/19/12 04:30:31.108] INFO: Received Byte: 00 [06/19/12 04:30:31.108] INFO: Received Byte: d1 I can control the device connected to the RCM152 like I want to with my sending packets (thats a good fact and means that the RCM152 has learned my packets and can use them. Also the actions (0x10 - ON, 0x30 - OFF) are working fine), but the problem is, that no matter which serial I choose, the RCM152 reacts to these packets. I only want to have actions if the teached-in serial is send and all other packets with different serials to be ignored. The RCM152 is not reacting to the packets sent by the PTM200 nor by the SG-FUS-24-230 because these are not teached-in. Thats exactly what I want to have with the packets created myself. What am I doing wrong? The libraries I am using are these for C++ http://pvbrowser.de/pvbrowser/sf/manual/rllib/html/ The enocean EEP says: For this purpose of a determined relationship between transmitter and receiver each transmitting device has a unique Sender-ID which is part of each radio telegram. The receiving device detects from the Sender-ID whether the device is known, i.e., was already learned, or unknown. A telegram with unknown Sender-ID is disregarded.

    Read the article

  • Windows CE Programming Serial Port - Getting Garbled Output

    - by user576639
    I am programming a Windows CE 6 device (Motorola MC3100 scanner Terminal). Using Lazarus FPC to compile it. After 3 weeks work I reluctantly post here in the hope someone can suggest why I am getting garbled output from the serial port. The code I am using is posted below. This is the standard code I have found from several places. The OpenPort works OK. When I send the string using SendString('ABCDEF') I get garbled input to the PC Serial port such as: 4[#131][#26][#0][#0][#0][#0] (the bracketed data indicates that it is a non-printable character ASCII Code) Obviously it is connecting to the port OK AND it is sending the correct no of characters (7). I have tried all combinations of Baud Rate, Data Bits, Parity and Stop Bits without any joy. Also tried changing cable, on a different PC etc. Could it be I need to set something else in the DCB? Any help or suggestions would be GREATLY appreciated. unit Unit1; {$mode objfpc}{$H+} interface uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls, Windows, LResources; type { TForm1 } TForm1 = class(TForm) Button1: TButton; Button2: TButton; Label1: TLabel; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); function OpenPort(ComPort:String;BaudRate,ByteSize,Parity,StopBits:integer):String; procedure SendString(str:String); private { private declarations } public { public declarations } end; var Form1: TForm1; cc:TCOMMCONFIG; Connected:Boolean; implementation {$R *.lfm} var F: TextFile; var hComm: THandle; str: String; lrc: LongWord; { TForm1 } function OpenPort(ComPort:String;BaudRate,ByteSize,Parity,StopBits:integer):String; var cc:TCOMMCONFIG; SWide:WideString; Port:LPCWSTR; begin SWide:=ComPort; Port:=PWideChar(SWide); result:=''; if (1=1) then begin Connected:=False; hComm:=CreateFile(Port, GENERIC_READ or GENERIC_WRITE,0, nil,OPEN_EXISTING,0,0); if (hComm = INVALID_HANDLE_VALUE) then begin ShowMessage('Fail to Open'); exit; end; GetCommState(hComm,cc.dcb); cc.dcb.BaudRate:=BaudRate; cc.dcb.ByteSize:=ByteSize; cc.dcb.Parity:=Parity; cc.dcb.StopBits:=StopBits; if not SetCommState(hComm, cc.dcb) then begin result:='SetCommState Error!'; CloseHandle(hComm); exit; end; Connected:=True; end; end; procedure TForm1.Button1Click(Sender: TObject); begin OpenPort('COM1:',9600,8,0,0); end; procedure TForm1.Button2Click(Sender: TObject); begin SendString('ABCDEFG'); end; procedure TForm1.SendString(str:String); var lrc:LongWord; begin if (hComm=0) then exit; try if not PurgeComm(hComm, PURGE_TXABORT or PURGE_TXCLEAR) then raise Exception.Create('Unable to purge com: '); except Exit; end; WriteFile(hComm,str,Length(str), lrc, nil); end; end.

    Read the article

  • Looking for best practise for writing a serial device communication app in C#

    - by cdotlister
    I am pretty new to serial comms, but would like advise on how to best achieve a robust application which speak to and listens to a serial device. I have managed to make use of System.IO.serialport, and successfully connected to, sent data to and recieved from my device. The way things work is this. My application connects to the Com Port and opens the port.... I then connect my device to the com port, and it detects a connectio to the PC, so sends a bit of text. it's really just copyright info, as well as the version of the firmware. I don't do anything with that, except display it in my 'activity' window. The device then waits. I can then query information, but sending a command such as 'QUERY PARAMETER1'. It then replies with something like: 'QUERY PARAMETER1\r\n\r\n76767\r\n\r\n' I then process that. I can then update it by sending 'SET PARAMETER1 12345', and it will reply with 'QUERY PARAMETER1\r\n\r\n12345\r\n\r\n'. All pretty basic. So, what I have done is created a Communication Class. this call is called in it's own thread, and sends data back to the main form... and also allows me to send messages to it. Sending data is easy. Recieving is a bit more tricky. I have employed the use of the datarecieved event, and when ever data comes in, I echo that to my screen. My problem is this: When I send a command, I feel I am being very dodgy in my handling. What I am doing is, lets say I am sending 'QUERY PARAMETER1'. I send the command to the device, I then put 'PARAMETER1' into a global variable, and I do a Thread.Sleep(100). On the data recieved, I then have a bit of logic that checks the incoming data, and sees if the string CONTAINS the value in the gloabl variable. As the reply may be 'QUERY PARAMETER1\r\n\r\n76767\r\n\r\n', it sees that it contains my parameter, parses the string, and returns the value I am looking for, but placing it into another global variable. My sending method was sleeping for 100ms. It then wakes, and checks the returned global variable. If it has data... then I'm happy, and I process the data. Problem is... if the sleep is too short.. it will fail. And I feel it's flakey.. putting stuff into variables.. then waiting... The other option is to use ReadLine instead, but that's very blocking. So I remove the datarecieved method, and instead... just send the data... then call ReadLine(). That may give me better results. There's no time, except when we connect initially, that data comes from the device, without me requesting it. So, maybe readline will be simpler and safer? Is this known as 'Blocking' reads? Also, can I set a timeout? Hopefully someone can guide me.

    Read the article

  • Looking for best practise for writing a serial device communication app

    - by cdotlister
    I am pretty new to serial comms, but would like advise on how to best achieve a robust application which speak to and listens to a serial device. I have managed to make use of System.IO.SerialPort, and successfully connected to, sent data to and recieved from my device. The way things work is this. My application connects to the Com Port and opens the port.... I then connect my device to the com port, and it detects a connection to the PC, so sends a bit of text. it's really just copyright info, as well as the version of the firmware. I don't do anything with that, except display it in my 'activity' window. The device then waits. I can then query information, but sending a command such as 'QUERY PARAMETER1'. It then replies with something like: 'QUERY PARAMETER1\r\n\r\n76767\r\n\r\n' I then process that. I can then update it by sending 'SET PARAMETER1 12345', and it will reply with 'QUERY PARAMETER1\r\n\r\n12345\r\n\r\n'. All pretty basic. So, what I have done is created a Communication Class. this call is called in it's own thread, and sends data back to the main form... and also allows me to send messages to it. Sending data is easy. Recieving is a bit more tricky. I have employed the use of the datarecieved event, and when ever data comes in, I echo that to my screen. My problem is this: When I send a command, I feel I am being very dodgy in my handling. What I am doing is, lets say I am sending 'QUERY PARAMETER1'. I send the command to the device, I then put 'PARAMETER1' into a global variable, and I do a Thread.Sleep(100). On the data received, I then have a bit of logic that checks the incoming data, and sees if the string CONTAINS the value in the global variable. As the reply may be 'QUERY PARAMETER1\r\n\r\n76767\r\n\r\n', it sees that it contains my parameter, parses the string, and returns the value I am looking for, but placing it into another global variable. My sending method was sleeping for 100ms. It then wakes, and checks the returned global variable. If it has data... then I'm happy, and I process the data. Problem is... if the sleep is too short.. it will fail. And I feel it's flaky.. putting stuff into variables.. then waiting... The other option is to use ReadLine instead, but that's very blocking. So I remove the data received method, and instead... just send the data... then call ReadLine(). That may give me better results. There's no time, except when we connect initially, that data comes from the device, without me requesting it. So, maybe ReadLine will be simpler and safer? Is this known as 'Blocking' reads? Also, can I set a timeout? Hopefully someone can guide me.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >