Shop OBEX P1 Docs P2 Docs Learn Events
NRF24L01+ revisited and other library issues - Page 3 — Parallax Forums

NRF24L01+ revisited and other library issues

13

Comments

  • Jim,

    Sure:
    in a terminal, paste this (do it somewhere it won't clobber an existing copy if you want to preserve it): git clone https://github.com/avsa242/p2-spin-standard-library.git

    Alternatively, you can download a zip of it via https://github.com/avsa242/p2-spin-standard-library/archive/refs/heads/testing.zip
    On a repo's github page, if you click on the green 'Clone' button, the link to download a zip is at the bottom of the popup.

  • Got it, thanks.

  • What I downloaded was dated Nov 9, 2021. Is that the latest?
    Jim

  • Hi Jim,

    What file is it that has that date? I just took a look at the RX and TX demo files in the repository on the github page and they show modified as 'last month' and 'last week', respectively.

  • I clicked on your sig and downloaded what was there. I just used the git instructions and re-downloaded, now I have new material!

  • RS_JimRS_Jim Posts: 1,751
    edited 2022-12-29 23:47

    Jessie,
    Working with the RX demo and trying to compile under flexprop, I get the following error:

    "ser.start(SER_BAUD) : error: Unable to handle member start"
    Ihave tried SER_BAUD as both 115200 and 2000000

    I do note that the start routine is buried in the com.serial.spin2 file a child of the ansi file.
    any Ideas, or do I need to zip it up and send to you?
    Jim
    loaded up the tx-demo and get the ser_baud error and "unable to handle member STR in the following line:
    ser.str(@"Max retransmissions reached? ")

  • Jim,

    What version of flexspin are you running? When I changed the names of methods in some objects during all of my updates (the serial objects had some changes), I created aliases to the old method names so existing programs wouldn't break, but the method aliasing wasn't working in older versions of FlexSpin. That's just a guess though. Yeah, please zip up what you have and send it over and I'll see if I have similar issues. I just now tried building both demos and they built fine.

    Cheers

  • RS_JimRS_Jim Posts: 1,751
    edited 2022-12-30 14:07

    Jessie,
    I am running Flexprop 5.9.21 under Linux Mint 20 fully updated. This morning I tried compiling the NRF receive demo exactly as downloaded from github. I made NO changes! it fails to compile with the compiler error message previously mentioned. "unable to handle member STR"
    Jim
    EDIT: Once I know that I can compile your version, I will Make the necessary changes in my program such as the config file and my pin numbers.

  • avsa242avsa242 Posts: 424
    edited 2022-12-30 14:25

    Strange - I just rolled back to 5.9.21 and still have no issues building it. When you have a chance, please zip what you have (no idea why it would be different, but just to be sure).

    EDIT:
    When you updated from github, did you be sure to point flexspin (or flexprop) to the new library location? You may need to temporarily remove references to your old copy, in case it's looking there for library code (in other words, maybe you're building the demo in the new library, but flexspin is looking for child object code in the old location).

  • Jessie,
    When I update flexprop, I rename the current folder to oldflexprop(#), then I do a new flexprop install from github. I do need to go to my Downloads file and make sure there are no flexprop versions there. Stay tuned@
    Jim

  • Oh sorry I meant my spin2 library, but yeah same idea with flexprop.

  • OK, with Eric's help I finally am running flexprop 5.9.23. When I load NRF24L01Demo either RX or TX and compile without modification(using all your stuff) I get an error MOVE internal I am not changing pin numbers or anything. I keep getting frustrated by the wheels coming off this train. I really want to get this radio link working so I can get back to programing. I am attaching the 2 files that give me the compiler errors.
    Jim

  • Jim,

    When I build your attached nrf24l01_rxdemo.org.spin2 I get no build issues.
    There was one small build issue I had with the attached NRF24L01-TXDemo.o.spin2 - flexspin errored out with:

    NRF24L01-TXDemo.o.spin2:30: error: unknown identifier LED in class Boardcfg_kiss
    NRF24L01-TXDemo.o.spin2:30: error: unknown identifier LED in class Boardcfg_kiss
    

    but I was able to solve that by just changing the constant near the top of the file to read cfg.LED1, since that's what's defined in the KISS board config obj. Both build for me either to NuCode or PASM2.
    The TX demo looks to have modifications in it (or additions, at least), though without looking into it in more detail I can't say whether that's having an impact.

    If you're getting a build failure though, something still isn't setup quite right. In my above post, what I was asking was to be sure that flexspin/flexprop are pointed to the newest, and only the newest copy of the p2-spin-standard-library. It almost sounds like objects are getting mixed up or something. You might have the newest demo open, but if flexprop is still pointed to the old p2-spin-standard-lib, it'll be trying to build the demo using the objects from there.

    The library paths in flexprop should look something like this:

  • Yes I had that error, but after I got that fixed this internal "move" error crops up. How are you copying the error statments from the compiler?
    Jim

  • Pasted here, as formatted, you mean? Or the actual copying itself? I use vim for editing code, and I have commands set up to call flexspin (all of this just runs in a terminal). Then I just pasted the output here within a code block. Put three backticks (like " ``` ", but without the quotes or spaces) on a line by themselves, then paste the compiler output on the next lines, then put three backticks on the line after.

  • Ok,
    I am attaching 3 screenshots, 1 each for the RX_Demo,1 for Audio.amp.max9744m and 1 for lib paths.
    Note I get the error on demo but not on Audio.amp. Lib paths the same for all

  • Hmm ok I can't really tell what it's failing on from that...it doesn't look like flexspin is showing the line number (or the file) it's failing on. Any chance you could zip up your whole project and I'll take a look?

  • The file it is failing on is your nrf demo with all of your parms. All I am asking to do is compile.
    Jim

  • I know, but if I do a checkout of what I have on github I don't have the same result - it builds fine for me. There has to be a difference somewhere.

  • avsa242avsa242 Posts: 424
    edited 2023-01-02 00:36

    Steps I just did to try to reproduce it:

    git clone https://github.com/avsa242/p2-spin-standard-library.git
    cd p2-spin-standard-library/library/demos/wireless/
    git checkout testing
    flexspin -2 -I ../../ NRF24L01-TXDemo.spin2

    Propeller Spin/PASM Compiler 'FlexSpin' (c) 2011-2022 Total Spectrum Software Inc.
    Version 5.9.23 Compiled on: Jan  1 2023
    NRF24L01-TXDemo.spin2
    |-com.serial.terminal.ansi.spin2
    |-|-string.spin2
    |-|-|-char.type.spin2
    |-boardcfg.p2eval.spin2
    |-wireless.transceiver.nrf24l01.spin2
    |-|-com.spi.25mhz.spin
    |-|-|-core.con.smartpins.spin2
    |-|-core.con.nrf24l01.spin
    |-string.spin2
    NRF24L01-TXDemo.p2asm
    Done.
    Program size is 17740 bytes
    

    EDIT: removed erroneous pasted text

  • I wonder if the difference is I do everything in Flexprop and you are compiling in flexspin?

  • Trying it in flexprop seems to yield the same result for me...my copy of flexprop has a version of flexspin that's two versions older (5.9.21) but it still builds.
    If you copy the commands in my above post (#81) do you still have a build failure? Running out of ideas...

  • @RS_Jim : Try the attached archive. That has everything from @avsa242 's library needed to build the NRF24L01-TXDemo, and it builds fine for me. I have to assume that somehow one of your library paths or checkouts isn't quite right, which can be very frustrating and hard to track down. That's why I've included everything in the one archive, it's self-contained.

  • Eric,
    I extracted the file you sent me into its own folder and created a path to it and it compiled correctly. So now I wonder what was wrong with the other. I have since compiled other programs without problem so I do not know what has happened to the original. Thanks for the help.
    Jim

  • Update!
    After getting Eric's test file to compile. I tried the rx-demo from what I had and that failed again so re-downloaded rx-demo, and it compiled. I next edited it for my board configuration and recompiled, success. next downloaded it to nrf receive board, fail. Swapped out receive board, success! So now I have an NRF24-L01 link that works. Time to go back to the vendor and see if they will replace their defective board. I don't mind paying for a new board but I resent having to pay 2.5 times the board cost for the shipping. We will see how well I negotiate!
    I thank you both for your assistance I might have given up in utter frustration with out it.
    Jim

  • Jim, good news - glad you got it working again.

    Cheers

  • Jessie,
    You seemed to have dropped the "Time" object. Where did you put those functions?
    Jim

  • Jim,

    I removed it because spin2 has native support for delays (waitms(), waitus()...and I think there at least used to be one for waiting whole seconds? though I could be mistaken about that one)

  • Got it!

  • JonnyMacJonnyMac Posts: 8,912
    edited 2023-01-04 00:39

    @avsa242 said:
    I removed it because spin2 has native support for delays (waitms(), waitus()...and I think there at least used to be one for waiting whole seconds? though I could be mistaken about that one)

    The built-in Spin2 delays are with waitms() and waitus(). Both have a limit of 2^31 microseconds, which is about 10 seconds at 200MHz. You can always create longer delays with a loop:

    repeat 15
      waitms(1000)
    
Sign In or Register to comment.