Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    nrf24l01

    Scheduled Pinned Locked Moved Firmware
    esp32wipy
    8 Posts 2 Posters 1.7k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P Offline
      pedrofelipest
      last edited by

      Hello everyone, I use Wipy 2.0 in an esp32 wroom32 and I can not use a micropython library for nrf24l01. can anybody help me?

      robert-hhR 1 Reply Last reply Reply Quote 0
      • robert-hhR Offline
        robert-hh @pedrofelipest
        last edited by

        @pedrofelipest Please give a link to that library, post the section of code in which you use the library and what kind of response you get.

        1 Reply Last reply Reply Quote 0
        • P Offline
          pedrofelipest
          last edited by

          It is https://github.com/micropython/micropython/blob/master/drivers/nrf24l01/nrf24l01test.py @robert-hh

          robert-hhR 1 Reply Last reply Reply Quote 0
          • robert-hhR Offline
            robert-hh @pedrofelipest
            last edited by

            @pedrofelipest Yes, and my other question:

            • how do you call that module? Which parameters do you use?
            • What is the result of the call. Any error messages?
            1 Reply Last reply Reply Quote 0
            • P Offline
              pedrofelipest
              last edited by

              I set the pins to use the SPI

              csn = Pin(cfg['csn'], mode=Pin.OUT, value=1)
              ce = Pin(cfg['ce'], mode=Pin.OUT, value=0)
              spi = SPI(0, pins=('P22','P20','P12'))
              nrf = NRF24L01(spi, csn, ce, payload_size=8)
              
              

              Make a mistake in the library

              def reg_write(self, reg, value):
                  self.cs(0)
                  self.spi.readinto(self.buf, 0x20 | reg) # The mistake happens here. More arguments than necessary
                  ret = self.buf[0]
                  self.spi.readinto(self.buf, value)
                  self.cs(1)
                  return ret
              
              robert-hhR 1 Reply Last reply Reply Quote 0
              • robert-hhR Offline
                robert-hh @pedrofelipest
                last edited by

                @pedrofelipest said in nrf24l01:

                self.spi.readinto(self.buf, 0x20 | reg)

                According to the documentation, the syntax is:
                self.spi.readinto(self.buf, write=(0x20 | reg))
                or later
                self.spi.readinto(self.buf, write=value)
                If that works, you have to change the other places too.

                1 Reply Last reply Reply Quote 0
                • P Offline
                  pedrofelipest
                  last edited by pedrofelipest

                  You have returned this error. And u checked nrf and it's working. I tested it in standard Arduino code.

                  File "<stdin>", line 1, in <module>
                    File "boot.py", line 34, in master
                    File "nrf24l01.py", line 77, in __init__
                  OSError: nRF24L01+ Hardware not responding
                  

                  CE on P6
                  CSN on P21
                  SCK on P22
                  MISO on P12
                  MOSI on P20

                  robert-hhR 1 Reply Last reply Reply Quote 0
                  • robert-hhR Offline
                    robert-hh @pedrofelipest
                    last edited by

                    @pedrofelipest said in nrf24l01:
                    Please verify a) the intended connection as below

                    CE on P6 -> GPIO27
                    CSN on P21 ->GPIO26
                    SCK on P22 ->GPIO25
                    MISO on P12 -> GPIO21
                    MOSI on P20 -> GPIO33

                    b) The semantics of the SPI method may be different between the poerts. Please compare the different ports (Pycom and micropython) by printing the results and self.buf content from write_register and read_register.

                    1 Reply Last reply Reply Quote 0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    • 1 / 1
                    • First post
                      Last post

                    Pycom on Twitter

                    Pycom