Jump to content

sniffing serial communication (RS232 or USB)


Recommended Posts

Is any solution to sniff serial communication on PC (windows XP or Win7) between PC and attached device?

Like do portmon.exe from sysinternals....

I need to catch traffic between two devices (multimeter and PC) and write to PC or send data over internet...

Link to comment
Share on other sites

  • Moderators

microera,

Take a look at martin's Serial port UDF - might be useful. :oops:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Due to delays in processing interception with AutoIt code, the best bet if you work at high Baud rate is to use stock multiport board and route signals (Y connection) to one or two new ports.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

@Melba

I know about this UDF but this is direct connecting to device (in this example multimeter)!

I need to sniff in paralel betwen device and PC SW.....

like this sw:

http://technet.microsoft.com/en-us/sysinternals/bb896644

@jchd

You mean hardware multi port? No, no,.... At this example are baudrate slow ... I think bellow 115kbaud!

And I know that exist sw wich can sniff in background and visualise data wich are recived/transmitted between "external device" and PC!

But is possible make this job with autoit? I think YES because autoit is VERY GOOD tool! :oops:

But I dont know how! :bye:

Edited by microera
Link to comment
Share on other sites

I do know there are such programs, but the thing is that first AutoIt is by itself too high-level to intercept serial I/O without disturbing the running program and _could_ be too slow for the actual situation.

If you want to intercept serial activity reliably, you have to monitor timewise signals and data I/O. That's normally the job of a driver, which precludes simultaneous multiple use of a given port. I don't say it can't be done at all, I simply don't expect it can be done reliably by using AutoIt only. Should you have a fast DLL (typically in C) with monitoring support built-in, then yes it would probably be possible. I'm not aware of any such DLL (but it may exists somewhere).

Look at the portmon page and read "How it Works: WinNT" section. Now while this works with a fast dev language, it's very unclear that AutoIt will be fast enough to keep up with the use pace. We aren't simply getting messages from some kind of GUI here, we work with real-time external events.

Another way is to use some (free or payware) serial monitor and grab its output from AutoIt.

All in all, given that finding a working solution may be time consuming, that's why I suggested you use simple Y cable to route I/O signals and Tx/Rx to two separate serial ports, which you then can monitor easily using Martin's serial UDF and accompanying DLL. Given that if you don't have extra ports free on your PC, you can still use another PC or use a multi-I/O board at 10 € street price.

Yet another way, depending on the actual nature of the reason for monitoring. Obtain the docs of the remote instrument and work from there might be enough for your purpose.

Edited by jchd

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

Is any solution to sniff serial communication on PC (windows XP or Win7) between PC and attached device?

Like do portmon.exe from sysinternals....

I need to catch traffic between two devices (multimeter and PC) and write to PC or send data over internet...

I think com0com can do what you want. My udf cannot.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I had a lot of luck with this free program for Serial port sniffing:

http://www.serial-port-monitor.com/

Using this I managed to get the comms between the PC and my diabetes glucose meter and managed to make an autoit script that could communicate with the glucose meter.

Also, I didn't use the UDF, but used the code from this thread:

NiVZ

Edited by NiVZ
Link to comment
Share on other sites

  • 4 years later...

You can catch traffic between two devices with <snip>. This software serves as a gatekeeper on the flow of data via RS232/422/485 serial ports during applications or driver development, testing, debugging and optimization of serial devices, and so on.
Moreover, the monitored data can be redirected to a specified file or copied to a clipboard.  Serial Port Monitor can intercept, and record all serial input/output control codes (IOCTLs) parameters with full detail. Each monitoring session can be saved and used whenever necessary.
So, It can be very useful)

Edited by Melba23
Removed link
Link to comment
Share on other sites

  • Moderators

AlexGreen,

We do not permit adverts for payware.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...