This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Description
Hi,
I've just been trying this on a linux and mac laptop. The design of the constructor for the RFExplorer class unfortunately won't work on linux or mac. The serial device created by the driver is called something like '/dev/ttyUSB0' on linux and '/dev/cu.SLAB_USBtoUART' on a mac (osx 10.8). The code to open the serial device
ser = serial.Serial(int(port-1))
appears to be internally translated to something like '/dev/ttySx' on linux and '/dev/cuadx' on a mac (where 'x' is port-1). So the integer-based way of specifying the serial device just doesn't work.
What does seem to work is opening the serial device with the correct name of the filesystem object, like
ser = serial.Serial('/dev/ttyUSB0')
on linux.
If you want to keep the integer device specification, how about (for linux/mac) using it as an index into the list returned by list_serial_ports() and instead of doing
ser = serial.Serial(int(port-1))
do
devs = list_serial_ports()
ser = serial.Serial(devs[port])
or something like that? It seems that the RFExplorer serial device always appears last in that list, so you could even have the port ID default to -1 so it picks the last item in the array by default if it is not specified.
Hope this is useful.
Cheers,
Randall.