Hello, i got strange problem with sending outgaugepack through serial, when ill send car pack, everything is good, and on my LCD i got data, but when i want send rpm pack or other pack, through serial, i cant, cause python give me that error "SerialException: could not open port 'COM3': WindowsError(5, acces is denied".Its very strange, cause when I sending car pack, everything works properly.
CODE
import socket
import struct
import serial
ser = serial.Serial(2, 115200)
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(('127.0.0.1', 3))
while True:
data = sock.recv(256)
if not data:
break
outgauge_pack = struct.unpack('I3sxH2B7f2I3f15sx15sx', data)
time = outgauge_pack[0]
car = outgauge_pack[1]
flags = outgauge_pack[2]
gear = outgauge_pack[3]
speed = outgauge_pack[5]
rpm = outgauge_pack[6]
turbo = outgauge_pack[7]
engtemp = outgauge_pack[8]
fuel = outgauge_pack[9]
oilpressure = outgauge_pack[10]
oiltemp = outgauge_pack[11]
dashlights = outgauge_pack[12]
showlights = outgauge_pack[13]
throttle = outgauge_pack[14]
brake = outgauge_pack[15]
clutch = outgauge_pack[16]
display1 = outgauge_pack[17]
display2 = outgauge_pack[18]
ser.write( rpm )
sock.close()
CODE
import socket
import struct
import serial
ser = serial.Serial(2, 115200)
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(('127.0.0.1', 3))
while True:
data = sock.recv(256)
if not data:
break
outgauge_pack = struct.unpack('I3sxH2B7f2I3f15sx15sx', data)
time = outgauge_pack[0]
car = outgauge_pack[1]
flags = outgauge_pack[2]
gear = outgauge_pack[3]
speed = outgauge_pack[5]
rpm = outgauge_pack[6]
turbo = outgauge_pack[7]
engtemp = outgauge_pack[8]
fuel = outgauge_pack[9]
oilpressure = outgauge_pack[10]
oiltemp = outgauge_pack[11]
dashlights = outgauge_pack[12]
showlights = outgauge_pack[13]
throttle = outgauge_pack[14]
brake = outgauge_pack[15]
clutch = outgauge_pack[16]
display1 = outgauge_pack[17]
display2 = outgauge_pack[18]
ser.write( rpm )
sock.close()