Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 problems sending BIN file with XMODEM python
#1
Hello my freinds,


i am trying to send a bin file which i already tested with teraterm before.
the reciever is an energy meter, i am connected to it by usb/rs232 converter.

when i start the XMODEM i recieve the following error:

*Read Byte: b'\x00'

send error: expected NAK, CRC, or CAN; got b'\x00'*



can anyone please help?

i am using the following code:

def sendFile():

    ser= serialPort.serialport
    ser.flushInput()
    print (ser)

def getc(size, timeout=8):
    gbytes = ser.read(size)
    sleep(2)
    print(f'Read Byte: {gbytes}')
    return gbytes or None


def putc(data, timeout=8):
    pbytes = ser.write(data)
    sleep(2)
    print(f'Put Byte: {pbytes}')
    return pbytes or None

modem =XMODEM(getc,putc)
stream = open('104_new.BIN', 'rb')
modem.send(stream)
print(stream)
buran wrote Nov-23-2019, 10:30 AM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  How to stop Xmodem after bin file transfer was finished shaya2103 0 160 Nov-27-2019, 04:33 PM
Last Post: shaya2103
  Xmodem error neethuvp 6 453 Oct-18-2019, 06:08 AM
Last Post: neethuvp
  sending html file in email santoshi 3 716 Apr-05-2019, 03:59 PM
Last Post: nilamo
  problems with writting a text file sunny 6 674 Feb-24-2019, 10:52 PM
Last Post: Larz60+
  Mail sending Python - What it's wrong? airwawekz 1 549 Jan-30-2019, 03:20 PM
Last Post: gontajones
  Problems running exe file from pyinstaller ersa21 4 1,573 Jan-15-2019, 06:36 PM
Last Post: snippsat
  Python, sending E-mails Daxanius 1 692 Sep-05-2018, 03:49 PM
Last Post: buran
  Problem in sending email using python nhoh007 1 804 Aug-25-2018, 07:20 PM
Last Post: typic
  Problem with absolute path to file (Mr.Stickman Problems) SheeppOSU 3 1,458 Jun-26-2018, 10:05 AM
Last Post: Larz60+
  Sending different color codes in python at certain times Kimzer 4 961 Jun-18-2018, 06:56 PM
Last Post: gontajones

Forum Jump:


Users browsing this thread: 1 Guest(s)