OK, I'm completely new to Python so am probably doing a really silly thing - but I can't get the instructions on
https://github.com/rhysbryant/readerEmulatorClient
to work....
C:\Users\Charlie\Desktop\readerEmulatorClient>"C:\Program Files (x86)\Python\python.exe" readerClient.py --readerPath=COM1 --file=pageData.txt --cmd=writeToFile
Traceback (most recent call last):
File "readerClient.py", line 22, in <module>
import readerSerialConnection
File "C:\Users\Charlie\Desktop\readerEmulatorClient\readerSerialConnection.py", line 22, in <module>
import serial
ModuleNotFoundError: No module named 'serial'
Python is installed in the path specified.
Module has been changed to COM1
**EDIT***
OK, installed pyserial using PIP...
now get..
Traceback (most recent call last):
File "readerClient.py", line 161, in <module>
main()
File "readerClient.py", line 153, in main
c.connect(args.readerPath)
File "C:\Users\Charlie\Desktop\readerEmulatorClient\readerSerialConnection.py", line 27, in connect
self.serial = serial.Serial(comport)
File "C:\Program Files (x86)\Python\lib\site-packages\serial\serialwin32.py", line 31, in __init__
super(Serial, self).__init__(*args, **kwargs)
File "C:\Program Files (x86)\Python\lib\site-packages\serial\serialutil.py", line 240, in __init__
self.open()
File "C:\Program Files (x86)\Python\lib\site-packages\serial\serialwin32.py", line 62, in open
raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port 'COM1': FileNotFoundError(2, 'The system cannot find the file specified.', None, 2)
** EDIT 2 **
Ran as administrator
Getting better
Writing
No output.. but an empty file
Reading
C:\Users\Charlie\Desktop\readerEmulatorClient>"C:\Program Files (x86)\Python\python.exe" readerClient.py --readerPath="COM1" --file=pageData.txt --cmd=readFromFile
Traceback (most recent call last):
File "readerClient.py", line 161, in <module>
main()
File "readerClient.py", line 158, in main
reader.writePagesFromFile(args.file)
File "readerClient.py", line 82, in writePagesFromFile
line2 = line.rstrip('\n')
TypeError: a bytes-like object is required, not 'str'
What format must the input file be in?