RFExplorer / RFExplorer-for-Python

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

Serial Port Detection In linux #27

Open Omkardixi opened 1 year ago

Omkardixi commented 1 year ago

I'm trying to run the example RFE_Example_IoT_1.py on the Linux platform. The only change that I have made is SERIALPORT = "/dev/ttymxc2" after running this I got the following output,

Serial ports not detected Error: No module named 'RPi' I'm using python Python 3.9.2

So what will be the reason? Any help will be really appreciated!

electrokean commented 1 year ago

What Linux platform exactly are you using?

The IoT examples are meant for use on a Raspberry Pi with one of the RF Explorer IoT modules http://j3.rf-explorer.com/61-rfe/getting-started/179-internet-of-things-products https://github.com/RFExplorer/RFExplorer-for-Python/wiki/Python-Example-IoT-1

Omkardixi commented 1 year ago

Thanks for the reply. Basically, I'm trying to use the example codes on the NXP i.MX 6ULL processor and using rootfs debian-11.2-minimal-armhf-2022-01-01

electrokean commented 1 year ago

Are you using an RF Explorere IoT module, or some other RF Explorer device?

The IoT modules are only supported by the Python library on Raspberry Pi. With just a little work you should be able to get it to work on other platforms.

At a minimum you will need to change the call to ResetIOT_HW (at https://github.com/RFExplorer/RFExplorer-for-Python/blob/master/Examples_IOT/RFE_Example_IoT_1.py#L55). That function uses direct GPIO access specific to the RPi hardware. See https://github.com/RFExplorer/RFExplorer-for-Python/blob/master/RFExplorer/RFExplorer.py#L1842

If you are using some other RF Explorer device, then don't use the IoT examples.