Giter Site home page Giter Site logo

Comments (10)

sultanqasim avatar sultanqasim commented on September 3, 2024

Good idea, for long runs there are many situations in which there could be a glitch in the data coming in, for example I’ve seen intermittent cases of chunks of data being lost over USB CDC-ACM, especially during context switches when running inside a VM and under situations of high CPU load.

from sniffle.

jsmif avatar jsmif commented on September 3, 2024

OK, I thought it was because I had a mismatched firmware/software version, but I checked out v1.9.3 specifically and flashed the v1.9.3 release firmware and I'm still getting this error fairly frequently when I run with -q -a -e:

Traceback (most recent call last):
  File "/home/user/Sniffle/python_cli/sniff_receiver.py", line 203, in <module>
    main()
  File "/home/user/Sniffle/python_cli/sniff_receiver.py", line 161, in main
    msg = hw.recv_and_decode()
  File "/home/user/Sniffle/python_cli/sniffle_hw.py", line 334, in recv_and_decode
    mtype, mbody, pkt = self._recv_msg()
  File "/home/user/Sniffle/python_cli/sniffle_hw.py", line 305, in _recv_msg
    word_cnt = data[0]
IndexError: index out of range

from sniffle.

sultanqasim avatar sultanqasim commented on September 3, 2024

Hmm, did 5cecf12 cause that for you? Does the error appear right at startup? The only way that can happen is if pkt here is all whitespace or CRLF characters.

If you change this line to if len(pkt.strip()) < 4: does that fix it?

from sniffle.

sultanqasim avatar sultanqasim commented on September 3, 2024

Try the latest master branch, hopefully that fixes this particular crash you reported.

from sniffle.

sultanqasim avatar sultanqasim commented on September 3, 2024

And this should improve general robustness: 87ac1bd

from sniffle.

jsmif avatar jsmif commented on September 3, 2024

The error is not currently occurring for me, but I'm also not physically where it was occurring, so I'm not subject to the same background packets. Once I'm back in the same location I'll let you know if it's still occurring (with the old, and then the new, code). Thank you.

from sniffle.

XenoKovah avatar XenoKovah commented on September 3, 2024

FWIW I left my sniffers (confirmed to be on 1.9.3) running overnight in a hotel last night (so I won't be able to replicate this in the future), and when I got up one of them had got basically the same error as the OP:

Traceback (most recent call last):
  File "/home/test/Downloads/Sniffle/python_cli/sniff_receiver.py", line 203, in <module>
    main()
  File "/home/test/Downloads/Sniffle/python_cli/sniff_receiver.py", line 162, in main
    print_message(msg, args.quiet)
  File "/home/test/Downloads/Sniffle/python_cli/sniff_receiver.py", line 166, in print_message
    print_packet(msg, quiet)
  File "/home/test/Downloads/Sniffle/python_cli/sniff_receiver.py", line 173, in print_packet
    dpkt = DPacketMessage.decode(pkt, hw.decoder_state)
  File "/home/test/Downloads/Sniffle/python_cli/packet_decoder.py", line 81, in decode
    dpkt = AdvertMessage.decode(pkt, dstate)
  File "/home/test/Downloads/Sniffle/python_cli/packet_decoder.py", line 146, in decode
    return tc(pkt)
  File "/home/test/Downloads/Sniffle/python_cli/packet_decoder.py", line 310, in __init__
    self.aa_conn = struct.unpack('<L', self.body[14:18])[0]
struct.error: unpack requires a buffer of 4 bytes

Top of the git log for conf:

commit 588e1638c352e95d62cbc48bfb1387731d58d06d (HEAD, tag: v1.9.3)
Author: Sultan Qasim Khan <>
Date:   Wed May 8 12:31:36 2024 -0400

    fw: Bump the revision
    
    Nothing changed in firmware since v1.9.2, but this is so it matches the
    overall release version.

from sniffle.

sultanqasim avatar sultanqasim commented on September 3, 2024

That should be fixed in the latest master branch; it will still work fine with the v1.9.3/v1.9.2 firmware.

from sniffle.

XenoKovah avatar XenoKovah commented on September 3, 2024

Ah, I didn't pay attention and realize the cited fix commit wasn't in 1.9.3. Thanks

from sniffle.

jsmif avatar jsmif commented on September 3, 2024

FYI I don't seem to be seeing any script-killing-crashes due to unpack errors anymore. I do see the occasional error still popping up, but it seems to be handled gracefully, so I'm closing this now until I find another script-killer. Thanks!

from sniffle.

Related Issues (20)

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.