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

    Does network.WLAN.deinit() turn off WiFi radio part of ESP32 in 1.6.13.b1?

    Scheduled Pinned Locked Moved Discussion
    consumptiondeinit
    7 Posts 4 Posters 3.4k Views 4 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.
    • D Offline
      danielm
      last edited by danielm

      I am trying to figure out if network.WLAN.deinit() turns off WiFi radio part of ESP32 in 1.6.13.b1.

      I am using following method for power consumption measurement:
      http://community.silabs.com/t5/32-bit-MCU/How-to-use-an-STK-to-measure-current-consumption-on-your-own/td-p/98363

      boot.py:

      import os
      from machine import UART
      uart = UART(0, 115200)
      os.dupterm(uart)
      

      main.py:

      import pycom
      from network import WLAN
      
      pycom.heartbeat(False)
      wlan = WLAN()
      wlan.deinit()
      

      After connecting STK board as power source to Expansion Board 2.0 with LoPy through battery JST connector I observed current spike immediately:
      alt text

      Or after some time:
      alt text
      alt text

      In case of not calling wlan.deinit() in main.py current spikes appear immediately and are repeating periodically:
      alt text

      It seems that network.WLAN.deinit() makes some difference in power consumption patter. What could be causing those remaining spikes in case WLAN is initialized?

      1 Reply Last reply Reply Quote 1
      • D Offline
        danielm
        last edited by

        Last sentence should be:
        What could be causing those remaining spikes in case WLAN is NOT initialized?

        1 Reply Last reply Reply Quote 0
        • on4aaO Offline
          on4aa
          last edited by

          I am also interested in turning WLAN completely off. Have you found an answer in the meantime?

          I might be mistaken, but Bluetooth BLE might be employing the same radio and antenna but with less power.

          J 1 Reply Last reply Reply Quote 0
          • J Offline
            jmarcelino @on4aa
            last edited by jmarcelino

            @on4aa
            Yes WLAN.deinit() powers off WIFi radio.

            You now also have pycom.wifi_on_boot([enable]) to disable WiFi even before deinit is called: https://docs.pycom.io/chapter/firmwareapi/pycom/pycom.html

            BLE is currently very similar in energy to WIFi this will be addressed in the next major update of the ESP-IDF low level libraries

            on4aaO K 3 Replies Last reply Reply Quote 2
            • on4aaO Offline
              on4aa @jmarcelino
              last edited by

              @jmarcelino That did it. Thanks!
              I was reading the WLAN section of the documentation where this is not mentioned. As a newbee, it never crossed my mind to also look in the pycom section.

              Perhaps a cross link in the WLAN documentation section would easy the path for others to come…

              I definitely looking forward to BLE support. I do hope it will be possible to switch off WLAN whilst keeping BLE.

              1 Reply Last reply Reply Quote 0
              • on4aaO Offline
                on4aa @jmarcelino
                last edited by

                @jmarcelino With pycom.wifi_on_boot(False), I started using rshell, which I truly enjoy.

                It allows me to keep on writing code with vim (instead of atom) whilst rendering the upload and running of scripts really easy.

                The rshell command line tool definitely also merits mentioning in the documentation.

                1 Reply Last reply Reply Quote 1
                • K Offline
                  kavehoo @jmarcelino
                  last edited by

                  This post is deleted!
                  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