This is our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

I am trying to build a socket to retrieve the ethernet packets from ecu. When i run my code on windows there is no problem and the code runs correctly. But when i run my code on Linux it gets stuck at s.recv(65565) as no udp messages are received by Debian(raspberry pi). I have already set static ip in /etc/network/interfaces as follows: iface eth0 inet static address 160.48.199.91 netmask 255.255.255.0 gateway 160.48.199.1

The code is as below:

 import socket
    import sys
    HOST = "160.48.199.91"
    port = 30490
    s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_UDP)
    s.bind((HOST, 30490))
    while True:
         data = s.recvfrom(65565)
         print(data)

There is no LAN or Router. When i check netstat -s i see that there are 0 UDP and 0 TCP messages received. But when i check in Wireshark on Debian i could see the displayed UDP packets. Does it mean that the UDP packets are reaching the Raspberry Pi but not received by Debian OS ?

I know this is not related to this forum. But any help would be appreciated as i need to solve this problem urgently for my thesis.

asked 11 May '15, 07:27

Praju's gravatar image

Praju
11336
accept rate: 0%

closed 11 May '15, 08:16

grahamb's gravatar image

grahamb ♦
19.8k330206

Sorry, you're much more likely to get help in a Python focused site.

(11 May '15, 08:16) grahamb ♦

The question has been closed for the following reason "Question is off-topic or not relevant" by grahamb 11 May '15, 08:16

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×549
×166
×19
×12
×9

question asked: 11 May '15, 07:27

question was seen: 1,934 times

last updated: 11 May '15, 08:16

p​o​w​e​r​e​d by O​S​Q​A