Code Monkey home page Code Monkey logo

modbus-sniffer's People

Contributors

alerighi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

modbus-sniffer's Issues

ioctl get: Inappropriate ioctl for device

Finally recieved my USB RS-485 dongle. Driver is loaded:

[ 16.285543] usbcore: registered new interface driver ch341
[ 16.285606] usbserial: USB Serial support registered for ch341-uart
[ 16.285648] ch341 1-1.1:1.0: ch341-uart converter detected
[ 16.288046] usb 1-1.1: ch341-uart converter now attached to ttyUSB0

When I start the sniffer, I get the following error:

frank@odroid:~/modbus-sniffer$ ./sniffer -p /dev/ttyUSB0
output file: -
serial port: /dev/ttyUSB0
port type: 8N1 9600 baud
time interval: 1500
starting modbus sniffer
ioctl get: Inappropriate ioctl for device

Any idea what causes this error?

I also tried https://github.com/j123b567/SerialPCAP , this one is working (so the USB device is working) but I don't like the bulkiness of te mono framework.

Break and failed CRC after every 32 Bytes on long response

Hi,

I'm trying to log some modbus traffic between my huawei inverter and smart meter.
It works only partly.
The requests from the inverter to the smart meter and the request and responses to/from the battery decode correctly.
But the response from the smartmeter is really long (i think 80 registers so 160 bytes requested, 165 bytes in total).
The output is like this
captured packet 206: length = 8, CRC: 32A7 = 32A7 [OK]
DUMP: 0B 03 08 36 00 50 A7 32
captured packet 207: length = 32, CRC: 5AC9 = 439A [FAIL]
captured packet 208: length = 32, CRC: 151A = C3CD [FAIL]
captured packet 209: length = 32, CRC: 0E0A = 4366 [FAIL]
captured packet 210: length = 32, CRC: C808 = C29A [FAIL]
captured packet 211: length = 32, CRC: E08C = 4233 [FAIL]
captured packet 212: length = 5, CRC: BC28 = 2853 [FAIL]

I tried playing around with the --interval parameter but I can't get it to decode properly.
I also have a hard time finding the correct documentation for all the serial port functions.

Maybe you can guide me what to adjust so that the response paket is read as a whole?

Best regards,
Philipp

Realtime readable output

I would like to send all sniffed data to MQTT (in a human readable form). Would it be possible to pipe the output to Wireshark or tshark to get an almost realtime human readable output, so I can pick that up and send it to MQTT?

short opts

hey dude, thanks for the tool, super helpful for me...

I don't write C, but short opt for --interval -> -t didn't work for me... maybe my syntax was wrong or something on this line here? missing t?

 while ((opt = getopt_long(argc, argv, "ho:p:s:P:S:b:l", long_options, NULL)) >= 0) {

thanks again!

Usage of interval-parameter

Thank you for this cool piece of code!

I'm currently wondering, how the defined interval is affecting the data.
I built a test-setup with two slaves operating in half-duplex at 9600baud and had to set the interval to 2000ms in order to log the packets correctly.
This works perfectly but I'm about to install it in a bigger setup with approx. 14 slaves on a single bus, where the bus-messages might not be in coordinated intervals of 2000ms or 1500ms.
What is the internal function of the interval? Might it cut a message in half, if the interval is set on a too low value?

Thx!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.