-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Adafruit FT232H Breakout #39
Comments
I dreamt about this type of support a while back, but I did not end up getting one of those FTDI boards. I have not thought about it since... Can you supply links to docs about using this board (it would save me some time)?
It does, but it shouldn't be needed to install on anything but Linux. I specifically put that condition in the requirements.txt:
but maybe I can improve the setup.py in this regard: CircuitPython_nRF24L01/setup.py Lines 15 to 16 in c800869
I wouldn't be too surprised if running
displays "posix" on mac (I'm rather biased against macs - sorry). So, Using spi = busio.SPI(board.SCK, board.MOSI, board.MISO) Maybe specifying the SPI bus' pins is required for using this FTDI lib/board from a PC? However, I'm surprised if this change worked at all since it sets a var named nrf = RF24(SPI_BUS, CSN_PIN, CE_PIN)
This is usually indicative of a power supply problem. Just because you verified the radio's worked on a different power supply doesn't mean the radios will work on all power supplies. I also have to ask: What exact version of nRF24L01 are you using (store link please)? I'm also curious if you read #19. |
Hi bndy5, yes, I have read #19, Yes potentially a power supply issue, I'll check. As for your other questions:
|
and also here up to 500mA, so should be good, but I'll check actual. |
Thanks for clarifying the code modifications. I just wanted to be sure since I'm not there by your side.
Thanks for reporting this. I have adjusted the setup.py file on the no-more-upy branch. Can you test the following to see if it installs on mac?
Sorry if this is too demanding, but you're the only person I know with a mac - your feedback is valuable to me here.
I saw that also on the store page, but my experience leads me to think that a good portion of that may be consumed by the FTDI chip itself (or maybe other peripheral connections). I assume this means that you're using the newer version of that FTDI board (which was revised in 2020). BTW, I meant "what hardware version of the radio are you using?" Is it from ebyte? Is it a generic pack from amazon? Is it from Sparkfun? If you could supply the store link from where you purchased the radio, I'd be better equipped to understand your scenario. Also, are you using any capacitors? What about a PCB or adapter board that goes in between the radio and the FTDI board? |
ok, I read through that tutorial you linked to... Setting aside the lib install on mac problem, I don't see anything that might need to be done on our end (in terms of hardware support). I think all you needed to actually do is modify the CE & CSN pin numbers in the examples. The example snippets for SPI devices in that tutorial use both This makes me think that it is definitely a power stability problem. |
address = [b"00001", b"00002"] This is bad addressing. Anything with consecutive uniformed bit patterns (longer than 2 bits) is going to have significant signal loss because the radio's firmware has trouble decoding the address from other data in the packet. Also the unique byte in the address should be at the beginning due to how bytes objects are stored in memory. >>> from circuitpython_nrf24l01.rf24 import address_repr
>>> address_repr(b'00001', delimit=" ")
'31 30 30 30 30'
>>> [bin(int(byte, 16)) for byte in address_repr(b'00001', delimit=" ").split()]
['0b110001', '0b110000', '0b110000', '0b110000', '0b110000'] |
Hi 2bndy5
Confirmed, This 'pip install' is now working thank you!
You're the one helping me, so no apology required, thank you for your support.
Correct, using the newest version with USB-C port.
From here, let me know if this detail suffices?
Can you please recommend how I should be addressing then. As for the power issue, I need to pull my Oscope from out of the roof and I'll get a better representation of everything. However, from a multimeter, between vcc and gnd of the nRF24: FDTI = Recapping |
Bad addressing can be avoided by heading ManiacBug's advice from here For now, just stick with what the examples use. This will also provide a baseline for me to compare to.
That info is good enough, thank you. Those PA/LNA modules are a pain when it comes to power usage. An oscilliscope should show the instantaneous peaks in current consumption. You should see these peaks whenever the radio tries to TX (this includes the ACK packets - with or without ACK payloads attached). We've been using a lowered PA level (a software hack) in the examples to try to avoid the higher power demands of those PA/LNA radios. Lots of people seem to like those things, but I've never had consistently good/reliable experiences with them (as I've documented in the docs' troubleshooting page). Remember: "bigger is not always better". Have you tried using electromagnetic shielding? The capacitor's value seem ok, but it might be more stable with another smaller (like 10uF) capacitor in parallel with your 100 uF. When you say "Arduino", are you using CirPy lib or the Arduino RF24 C++ lib? There are a few differences in the lib's default values. |
Just on the bad addressing thing, I think you mean something like this:
|
Roger that, I'll get the Oscope out tomorrow. And, I'll look at the other references you have provided me. Thank you for you instantaneous support. |
I'm using the R24 C++ lib for the Arduino |
That is worse, so yeah I guess. Any time the LSB contains a series of bits
ok then, look in the CirPy example and uncomment the lines about |
Hi 2bndy5 Ok so it is now working. For some clarity on above. When you asked:
I thought you meant on the Arduino side. Arduino: I have been using the RF24 C++ lib. Here is some general data for your records, please note the mV in the top of the images:
Interesting to note: the FDTI provides greater power than the AMS1117. The final straw was, and I should have figured this comparing the settings through MacOS (Master) to Arduino (Slave) output snip:
Arduino (Master) to MacOS (Slave) output snip:
Generally, the current output seems to look fine, however, i did purchase a AMS1117 3.3v reg. This is where it first started working after aligning dynamic payloads. However, changing it back to direct FDTI also worked. Thank you for your help on this. Let me know what your thoughts are. |
Indeed. It is tiresome to keep writing out the word CircuitPython so many times. If I said CPy, then I'd be referring to a native python distribution...
Judging by the noise in those scope readings, you should be fine to forego additional caps. Although, more stability is always a welcome thing.
Good to know. In the future I'll have to remember to ask this first when someone says "Arduino". FWIW, that info is available in the docs for this lib's examples (under the section "TMRh20’s C++ libraries")
I was afraid this would happen. Its not your OS. Its barely even a library problem (which is already as optimized as I can make it). CirPy runs annoying slow on bare metal (referring to CirPy capable MCUs). The problem lies with using the FTDI board. The implementation that CirPy is using to communicate to the FTDI board is dependent on a Serial bus that's enumerated as a USB device. Serial buses are without a doubt the slowest data bus there is (excluding the OneWire protocol). This is why I decided not purchase one of those boards. If you wanted to control the radio from your computer, then a Serial bus is the easiest solution. However, I would have written an app that runs on bare metal and takes input from USB Serial. That way, the shear amount of data needed to traverse the Serial bus (over USB) could be significantly less. Although, I don't think this idea would too much faster because it still relies on a Serial bus. |
I'm closing this because it seems to be solved. You can still share your developments/thoughts here. |
Hi Team, first of all thank you for your work on this.
I am wanting to use a Adafruit FT232H breakout via its SPI to communicate to an Arduino that is using the RF24 library.
FT232 inherently uses circuit python.
I couldn't
$pip3 install circuitpython-nrf24l01
as I am running the FT232 from MacOS, and CircuitPython_nRF24L01 has SpiDev dependancy. So I just downloaded the repo and added into the project. I am also using Adafruit's busio instead os SpiDev for the SPI bus.Using your 'simple example' as an example all I have really done is added the following code:
This is 25% working, I am able to transmit data from the Mac to the Arduino. With the caveat of: I still get the "send() failed or timed out" from my Mac meaning .send is returning a False. I am unable to transmit data from the Arduino to the Mac.
the nRF sensors are all wired up correctly and work as I have tested them TxRx both ways using 2 off Arduinos. I am pretty sure the fault lies with my poor porting of your library to MacOS + FDTI.
Hopefully you may be able to look at this and easily implement a solution so I can use the FDTI interface.
Thank you in Advanced.
The text was updated successfully, but these errors were encountered: