I'm trying to develop a serial to ethernet bridge (half-duplex/rs485) in python.
The maxium allowed size of ethernet frames is 1536 bytes, but the maximum size of raw frames I can send from python is 1500 bytes. I don't know how to solve that.
Here is a part of my code which is sending the received frames to ethernet.
def ethernet_send(self):
"""
ethernet send thread
sends received data over ethernet
"""
# Init the Ethernet Socket
send_socket = socket.socket(socket.AF_PACKET, socket.SOCK_RAW)
send_socket.bind((self.config["interface"], 0))
while True:
# get next frame
ethernet_frame = self.send_ethernet.get()
# un escape data
ethernet_frame = self.un_escape(ethernet_frame)
# send data
send_socket.send(ethernet_frame)