Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling Raw Frame Support and Promiscuous #54

Closed
owaits opened this issue Oct 31, 2023 · 7 comments
Closed

Enabling Raw Frame Support and Promiscuous #54

owaits opened this issue Oct 31, 2023 · 7 comments
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@owaits
Copy link

owaits commented Oct 31, 2023

It took me a while to work out how you enable both raw frame support and promiscuous together as the readme only gives an example for enabling one macro. Can I suggest updating the example to include enabling two macros as bellow.

compiler.cpp.extra_flags=-DQNETHERNET_ENABLE_RAW_FRAME_SUPPORT -DQNETHERNET_ENABLE_PROMISCUOUS_MODE
compiler.c.extra_flags=-DQNETHERNET_ENABLE_RAW_FRAME_SUPPORT -DQNETHERNET_ENABLE_PROMISCUOUS_MODE

It all seems obvious now but many of the forum posts I read suggested quotes which lead me down the garden path. In the end I had omitted the -D from QNETHERNET_ENABLE_PROMISCUOUS_MODE as I had not spotted in the readme that this had been appended to QNETHERNET_ENABLE_RAW_FRAME_SUPPORT.

Amazing library though, thank you so much for your work on this.

@ssilverman
Copy link
Owner

Thanks for using QNEthernet and for the suggestion.

I'm curious, can you point me to where you read about using quotes?

@ssilverman
Copy link
Owner

ssilverman commented Oct 31, 2023

Also, I'm curious: what did your non-working attempts look like? Would you mind listing them? I find it's sometimes good to put "what not to do" in addition "what to do". It appears this might be helpful here.

@owaits
Copy link
Author

owaits commented Oct 31, 2023

The forum article that suggested quotes was this https://forum.arduino.cc/t/how-to-specify-multiple-extra-compiler-flags/994083

Here are some of the variants I tried:

compiler.cpp.extra_flags=-DQNETHERNET_ENABLE_RAW_FRAME_SUPPORT, QNETHERNET_ENABLE_PROMISCUOUS_MODE

compiler.cpp.extra_flags=-DQNETHERNET_ENABLE_RAW_FRAME_SUPPORT -QNETHERNET_ENABLE_PROMISCUOUS_MODE

compiler.cpp.extra_flags="-DQNETHERNET_ENABLE_RAW_FRAME_SUPPORT -QNETHERNET_ENABLE_PROMISCUOUS_MODE"

compiler.cpp.extra_flags='-DQNETHERNET_ENABLE_RAW_FRAME_SUPPORT -QNETHERNET_ENABLE_PROMISCUOUS_MODE'

compiler.cpp.extra_flags=-QNETHERNET_ENABLE_PROMISCUOUS_MODE -DQNETHERNET_ENABLE_RAW_FRAME_SUPPORT  //Resulted in compile error

I have been trying to receive LLDP packets, in the end I did not need to enable it as the reason it was not working was because of the line

if (size < EthernetFrame.minFrameLen() - 4)

in the RawFrameMonitor example. This ignores any raw packets over about 41 bytes and the LLDP packets where 491 bytes.

@ssilverman
Copy link
Owner

ssilverman commented Oct 31, 2023

[The reply appears to be missing the forum link.]

Thank you for those incorrect attempts. I'm going to think about how I'd like to improve the documentation.

That code in RawFrameMonitor checks for less than 60 bytes (64 - 4) and prints "SHORT Frame"; it prints the whole frame if >= 60 bytes. I don't think it ignores 491-byte frames?

@owaits
Copy link
Author

owaits commented Oct 31, 2023

I have updated my comment to include the forum link. I had over simplified the RawFrameMonitor example as I just wanted to see the raw data printed to serial. The example code as written is fine.

@ssilverman
Copy link
Owner

ssilverman commented Nov 1, 2023

What do you think of these modifications to the README:

Next, create a platform.local.txt file in the same directory as the
platform.txt file and add the options you need. The contents of the properties
are exactly the same as if adding them to the command line. For example, to
enable raw frame support and disable DNS:

compiler.cpp.extra_flags=-DQNETHERNET_ENABLE_RAW_FRAME_SUPPORT -DLWIP_DNS=0
compiler.c.extra_flags=-DQNETHERNET_ENABLE_RAW_FRAME_SUPPORT -DLWIP_DNS=0

Each additional option is simply appended. No commas or quotes are required
unless they would be used for those same options on the command line.
See https://github.com/ssilverman/QNEthernet/issues/54#issuecomment-1788100978
for some incorrect variants.

@ssilverman
Copy link
Owner

See commit 5484704.

@ssilverman ssilverman added question Further information is requested documentation Improvements or additions to documentation labels Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants