linux - socket program unable to receive ethernet packets from ECU in python -


i trying build socket retrieve ethernet packets ecu. when run code on windows there no problem , code runs correctly. when run code on linux gets stuck @ s.recv(65565). have set static ip in /etc/network/interfaces follows: iface eth0 inet static address 160.48.199.91 netmask 255.255.255.0 gateway 160.48.199.254

i tried simple code of socket on raspberry pi. still gets stuck @ s.recv(65565). code 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) 

could please me problem.

also, have been trying recieve 'ip packets' ecu. in windows create socket protocol type socket.ipproto_ip not valid in raspberry pi. how possible in raspberry pi(linux) ?

edit: tried implement same program using multicast. problem when create socket icmp protocols see data ecu after using command "ping -i echo 239.192.255.251" in terminal. (where 239.192.255.251 multicast address) when change socket protocol type udp, tcp or raw again gets stuck @ s.recv(). tried solutions in following link didn't help. stackoverflow.com/questions/15278053/… unix.stackexchange.com/questions/122255/… please me problem ?


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -