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

    WLAN connection problem "dhcps: send_nak>>udp_sendto result 0"

    Scheduled Pinned Locked Moved Issues & Bugs
    8 Posts 3 Posters 44 Views 3 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.
    • A Offline
      Anthony Leung
      last edited by

      Hi everyone,

      I've recently connected my FiPy device to WLAN and began experiencing the persistent message:

      dhcps: send_nak>>udp_sendto result 0
      

      WLAN is still able to connect and I have successfully been able to send messages to Adafruit IO, however, this error-like message is very bothering as it continues printing in what I believe is in a thread. Meaning even when I do Ctrl+C the message still persists.

      My code in boot.py is as follows:

      import network
      
      def do_connect():
          import network
          wlan = network.WLAN(network.WLAN.STA)
      
          if not wlan.isconnected():
              print('connecting to network...')
              wlan.connect('ssid',  auth=(network.WLAN.WPA2, 'password'))
              while not wlan.isconnected():
                  pass
          print('network config:', wlan.ifconfig())
      
      do_connect()
      

      Is there something I am missing or doing wrong that's causing this message? Would greatly appreciate any guidance out of this annoying issue!

      Thank you.

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jcaron @Anthony Leung
        last edited by

        @Anthony-Leung what firmware version are you running? This log should only appear of the ESP-IDF has been compiled with the DHCP server debug flag set.

        Also, it is related to the DHCP server, which should only be running if in AP (or AP+STA) mode.

        1 Reply Last reply Reply Quote 0
        • A Offline
          Anthony Leung
          last edited by

          Hi @jcaron! I've taken a screenshot of my board's information. It looks a bit corrupted.

          Screenshot 2021-02-08 140101.png

          Because of this I am trying to reinstall firmware however this is the error I am getting:

          Screenshot 2021-02-08 140330.png

          How should I go about this?

          Thank you again!

          A 1 Reply Last reply Reply Quote 0
          • A Offline
            Anthony Leung @Anthony Leung
            last edited by

            Okay great news.

            After I connected up the expansion board 3.1 to my FiPy instead of FTDI I was able to reinstall the firmware. This resolved the issue.

            Thank you @jcaron for pointing me to check the firmware!

            robert-hhR 1 Reply Last reply Reply Quote 1
            • robert-hhR Offline
              robert-hh @Anthony Leung
              last edited by

              @Anthony-Leung Updating with a FTDI adapter works, if you pull P2 low and push reset before starting the update. This will put the device into bootloader state.

              A 1 Reply Last reply Reply Quote 1
              • A Offline
                Anthony Leung @robert-hh
                last edited by

                Thanks @robert-hh ! I will make note of that for next time :)

                1 Reply Last reply Reply Quote 0
                • A Offline
                  Anthony Leung
                  last edited by

                  Hey @jcaron I've come back realising that I had used AP+STA mode prior to using STA mode. I actually need to use AP+STA mode for my project and once activating it, I do get dhcps: send_nak>>udp_sendto result 0 continuously. I am not too sure what these mean however it doesn't impede functionality as of yet.

                  What function/command would I need to run in order to stop these from printing?

                  Thank you!

                  J 1 Reply Last reply Reply Quote 0
                  • J Offline
                    jcaron @Anthony Leung
                    last edited by

                    @Anthony-Leung I suppose the firmware or the underlying ESP-IDF starts the dhcp server when in AP or AP+STA mode and doesn’t stop it when you switch. Not sure if there’s anything you could do from your micropython code to stop the messages, but I would believe them to be pretty harmless, though one would need to recheck the code which prints this.

                    Things you could try include switching off WiFi via WLAN.deinit() and then switching it on again. Or worst case, reboot the board between the two modes.

                    1 Reply Last reply Reply Quote 1

                    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