RFExplorer / RFExplorer-for-Python

RF Explorer libraries and examples for Python 3
GNU Lesser General Public License v3.0
51 stars 25 forks source link

Python Example USB 2 hangs #10

Closed IamSierraCharlie closed 5 years ago

IamSierraCharlie commented 6 years ago

Greetings,

I'm running your examples in python 3.6 on Ubuntu 16.04 with my RFExplorer 6G combo The first example runs fine with expected results as per the wiki. The second one however hangs:

Detected COM ports: /dev/ttyS0 /dev/ttyUSB0 Error in RFCommunicator - IsConnectedPort()[Errno 13] could not open port /dev/ttyS0: [Errno 13] Permission denied: '/dev/ttyS0' /dev/ttyUSB0 is a valid available port. RF Explorer Valid Ports found: 1 - /dev/ttyUSB0 User COM port: void Connected: /dev/ttyUSB0, 500000 bauds ·¸½ÀÆ¿ÍÅÌÌÍÇËÉÀº¼¼º¼ÂºÅÁ¾Â¿¼ÄÄÄÀ¼¾ÈÄÁɽÁÄÄ¿Á»ÅÃÆÃŪÀÁÃÀ¸ÃÅÃÂÄÆÃÂÂÄ·¸Å¼ÉÇ°®¨¹·±¨¹µ¸º¹º»¼½»Â¼¾Â¾À½Âž¾Åľ®¯¬¸½¹Â¾½

On my RFExplorer, I see "Pre-calibration" My spectrum analyser is running firmware version 01.20

From syslog - I believe the device is detected correctly: [ 2428.917044] usb 1-2.3: new full-speed USB device number 12 using xhci_hcd [ 2429.007078] usb 1-2.3: New USB device found, idVendor=10c4, idProduct=ea60 [ 2429.007087] usb 1-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 2429.007093] usb 1-2.3: Product: CP2102 USB to UART Bridge Controller [ 2429.007099] usb 1-2.3: Manufacturer: Silicon Labs [ 2429.007104] usb 1-2.3: SerialNumber: 0001 [ 2429.008583] cp210x 1-2.3:1.0: cp210x converter detected [ 2429.008831] usb 1-2.3: cp210x converter now attached to ttyUSB0

Could you advise what the expected behaviour should actually be for the second example please? Let me know if you need any more info Thanks Steve

IamSierraCharlie commented 6 years ago

After some further investigation, I've found that my RF Explorer doesn't reset from "Pre-calibration". Running the program twice seems to resolve the garbled output. Otherwise resetting the explorer when the script doesn't finish gracefully helps too

Additionally, I noted the following lines 75 - 77: SPAN_SIZE_MHZ = 100 #Initialize settings START_SCAN_MHZ = 500 STOP_SCAN_MHZ = 900

It would appear that the SPAN_SIZE_MHZ must equal the the difference between START_SCAN_MHZ and STOP_SCAN_MHZ. In the above example, adjusting the SPAN to 400 with the same and start settings works and the code actually finishes i.e. SPAN_SIZE_MHZ must be equal to STOP_SCAN_MHZ - START_SCAN_MHZ. I'm not sure if this is a bug or not. I simply don't know enough about the program (yet).

Feedback is greatly appreciated on what I've written above.

Steve

jcalderon09 commented 5 years ago

Hi Steve, Sometimes the "Pre-calibration" issue appears when device connect to serial port and you run the example very fast. The device is still doing internal calculation and the unit blocks. As you figured out, the workaround is run the example again.

According to second question, the initial settings are ok. From 500Mhz to 900MHz in steps of 100MHz cover full range, that is, 500-600, 600-700,...