#!/usr/bin/env python
import time
import serial
import sys
ser = serial.Serial(
 port='/dev/ttyUSB0',
 baudrate = 9600,
 parity=serial.PARITY_NONE,
 stopbits=serial.STOPBITS_ONE,
 bytesize=serial.EIGHTBITS,
 timeout=1
)
counter=0

#ser.write(serial.to_bytes([0x02,0x04,0x00,0x1b,0x06,0x21,0x00]))

print  sys.argv[1]
my=sys.argv[1]
#my='0204001b062100'
ser.write(my.decode("hex"))

#while 1:
# x=ser.readline(6)
# print x
