Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. My Project
  3. nRF5 action!

nRF5 action!

Scheduled Pinned Locked Moved My Project
1.9k Posts 49 Posters 630.8k Views 44 Watching
  • 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.
  • NeverDieN Offline
    NeverDieN Offline
    NeverDie
    Hero Member
    wrote on last edited by NeverDie
    #601

    In my testing, NRF5_PA_LOW did offer some modest reduction in overall current consumption, but it's no silver bullet.

    The range with NRF5_PA_MIN is just a few feet, so I don't consider it practical for the vast majority of use cases.

    So, further reductions in current consumption will have to come from somewhere (?) else.

    I suppose the next step is to turn-off auto ACK's and any listening for ACK's by the mote. Hopefully (?) there's a switch in myconfig which does that.

    1 Reply Last reply
    0
    • d00616D Offline
      d00616D Offline
      d00616
      Contest Winner
      wrote on last edited by
      #602

      I have checked the current with my nRF52 board with integrated shunt. I have measured 6.5µA while sleeping until timeout or sleeping until interrupt. It doesn't matter if RX/TX are connected but after flashing the firmware a reset by removing the voltage is required.

      There was an bug, with any type of sleep(0) which is fixed by this PR https://github.com/mysensors/MySensors/pull/909

      rmtuckerR 1 Reply Last reply
      0
      • NeverDieN Offline
        NeverDieN Offline
        NeverDie
        Hero Member
        wrote on last edited by
        #603

        Unless I'm doing it unwittingly, I'm not doing any sleep(0)'s at present.

        1 Reply Last reply
        0
        • NeverDieN Offline
          NeverDieN Offline
          NeverDie
          Hero Member
          wrote on last edited by NeverDie
          #604

          I'm finding that having a very simple adapter board, such as that in the photo here, is quite convenient both for programming and for powering the nRF52832, and for wiring-up prototypes. I made my breakout board for breadboards, but those connections are always just too flakey. Maybe I need to use better breadboards? Anyhow, this meets the requirement for reliable, solid connections.
          0_1502636407342_nRF52_adapter.jpg

          1 Reply Last reply
          0
          • NeverDieN Offline
            NeverDieN Offline
            NeverDie
            Hero Member
            wrote on last edited by
            #605

            I removed this useless block of code from the main loop, which, with its long waits, may have been what was draining the power:

            	Serial.println("");
            	Serial.println("");
            	Serial.println("");
            	Serial.println("#########################");
            	randNumber=random(0,101);
            
            	Serial.print("RandomNumber:");
            	Serial.println(randNumber);
            	// Send fake battery level
            	Serial.println("Send Battery Level");
            	sendBatteryLevel(randNumber);
            	wait(LONG_WAIT);
            
            	// Request time
            	Serial.println("Request Time");
            	requestTime();
            	wait(LONG_WAIT);
            
            1 Reply Last reply
            0
            • NeverDieN NeverDie

              What's going to be the best way to reduce the sleep current and Tx current on the nRF52? Since I'm feeding off a supercap for power, it's noticeably worse (by an order of magnitude) on the same task than the atmega328p+rfm69 combo. I've already increased the datarate to 2mbps, and it's inherently lower Tx current should give it a natural advantage.

              I guess I'll try reducing Tx power and see if that makes much of a dent....

              I suppose reducing 3 separate packets to one single packet, and maybe turning off ACK requests might also help. Then, maybe all of the LONG_WAIT's can be eliminated. Is the radio still awake even if the CPU is sleeping during a "wait" period? If so, that might be a large chunk of the wasted power.

              I wonder if the mysensors mesh networking (which I don't intend to use) might be getting in the way, and possibly keeping it awake longer than it otherwise would be? Can I disable the mysensors meshnetworking just to be sure?

              Sorry for the shotgun blast of questions, but I'm trying to get a sense of what will yield the highest payoff.

              rmtuckerR Offline
              rmtuckerR Offline
              rmtucker
              wrote on last edited by
              #606

              @NeverDie
              When you are comparing the atmega 328 and the nrf52 what sketch are you using to come to your conclusions?.

              NeverDieN 1 Reply Last reply
              0
              • rmtuckerR rmtucker

                @NeverDie
                When you are comparing the atmega 328 and the nrf52 what sketch are you using to come to your conclusions?.

                NeverDieN Offline
                NeverDieN Offline
                NeverDie
                Hero Member
                wrote on last edited by NeverDie
                #607

                @rmtucker said in nRF5 Bluetooth action!:

                @NeverDie
                When you are comparing the atmega 328 and the nrf52 what sketch are you using to come to your conclusions?.

                A solar mote which reports the voltage on the supercap and the unloaded voltage on the solar panel.

                The goal is to get the mote to be a solar powered remote, where it will wake up and listen for a packet once every 100ms and then go back to sleep if it doesn't receive one inside a very narrow window of time. That window can be a lot narrower on the nRF52302, because it supports 2Mbps, whereas the RFM69 can support at most 300kbps. I got the atmega328p+rfm69 to do that (although it required a larger than 10F supercap to get through the night), and it worked. At the present moment, though, I don't think the nrf52 can do it, unless I were to use an even bigger supercap and more than one mini solar panel. The potential to do it is there though. I just need to drive it better.

                I think a high priority is to get the DCDC working on the nRF52.
                That should cut the higher currents (such as during Tx and Rx) by about half, as discussed earlier in this thread.

                BTW, removing the above block of code did help appreciably.

                d00616D 1 Reply Last reply
                0
                • NeverDieN NeverDie

                  @rmtucker said in nRF5 Bluetooth action!:

                  @NeverDie
                  When you are comparing the atmega 328 and the nrf52 what sketch are you using to come to your conclusions?.

                  A solar mote which reports the voltage on the supercap and the unloaded voltage on the solar panel.

                  The goal is to get the mote to be a solar powered remote, where it will wake up and listen for a packet once every 100ms and then go back to sleep if it doesn't receive one inside a very narrow window of time. That window can be a lot narrower on the nRF52302, because it supports 2Mbps, whereas the RFM69 can support at most 300kbps. I got the atmega328p+rfm69 to do that (although it required a larger than 10F supercap to get through the night), and it worked. At the present moment, though, I don't think the nrf52 can do it, unless I were to use an even bigger supercap and more than one mini solar panel. The potential to do it is there though. I just need to drive it better.

                  I think a high priority is to get the DCDC working on the nRF52.
                  That should cut the higher currents (such as during Tx and Rx) by about half, as discussed earlier in this thread.

                  BTW, removing the above block of code did help appreciably.

                  d00616D Offline
                  d00616D Offline
                  d00616
                  Contest Winner
                  wrote on last edited by
                  #608

                  @NeverDie said in nRF5 Bluetooth action!:

                  I think a high priority is to get the DCDC working on the nRF52.

                  You can try to do this:
                  #include <nrf.h>

                  ...in before()

                  NRF_POWER->DCDCEN = 1;

                  1 Reply Last reply
                  1
                  • NeverDieN Offline
                    NeverDieN Offline
                    NeverDie
                    Hero Member
                    wrote on last edited by NeverDie
                    #609

                    I haven't yet touched DCDC, but having stripped the example code down a bit, my 10F capacitor is now losing only about 18mv per hour, which is much better than when I began. Some of that is even self-discharge. Whew! Another bullet dodged. Of course, it needs to go lower still, but at least this is meaningful progress for minimal effort.

                    1 Reply Last reply
                    0
                    • NeverDieN Offline
                      NeverDieN Offline
                      NeverDie
                      Hero Member
                      wrote on last edited by
                      #610

                      Removing ACK's is the next easy step, and I found the entry in myconfig.h that will do it:

                      /**
                       * @def MY_PASSIVE_NODE
                       * @brief If enabled, the node operates fully autonomously, i.e. messages are sent without ACKing.
                       *
                       * @note All transport-related checks and safety-mechanisms are disabled.
                       * @note Requires that @ref MY_NODE_ID is set, @ref MY_PARENT_NODE_ID and
                       *       @ref MY_PARENT_NODE_IS_STATIC are optional.
                       * @note Singing, registration, and OTA FW update are disabled.
                       */
                      //#define MY_PASSIVE_NODE
                      
                      1 Reply Last reply
                      0
                      • scalzS Offline
                        scalzS Offline
                        scalz
                        Hardware Contributor
                        wrote on last edited by scalz
                        #611

                        @NeverDie
                        in case.. it's better to make the config changes inside your sketch instead of the MyConfig file, especially if you want to use MySensors for others nodes (else each time you'll have to struggle with MyConfig)

                        1 Reply Last reply
                        2
                        • NeverDieN Offline
                          NeverDieN Offline
                          NeverDie
                          Hero Member
                          wrote on last edited by NeverDie
                          #612

                          @NeverDie said in nRF5 Bluetooth action!:

                          #define MY_PASSIVE_NODE

                          Not sure, but I may have run into a bug. I've defined MY_PASSIVE_NODE, and in the main loop I send two different packets once every 5 minutes. The first one never arrives. The second one always arrives. Prior to defining MY_PASSIVE_NODE, both would always arrive. This is on an nRF52832.

                          NeverDieN 1 Reply Last reply
                          0
                          • NeverDieN NeverDie

                            @NeverDie said in nRF5 Bluetooth action!:

                            #define MY_PASSIVE_NODE

                            Not sure, but I may have run into a bug. I've defined MY_PASSIVE_NODE, and in the main loop I send two different packets once every 5 minutes. The first one never arrives. The second one always arrives. Prior to defining MY_PASSIVE_NODE, both would always arrive. This is on an nRF52832.

                            NeverDieN Offline
                            NeverDieN Offline
                            NeverDie
                            Hero Member
                            wrote on last edited by
                            #613

                            @NeverDie said in nRF5 Bluetooth action!:

                            @NeverDie said in nRF5 Bluetooth action!:

                            #define MY_PASSIVE_NODE

                            Not sure, but I may have run into a bug. I've defined MY_PASSIVE_NODE, and in the main loop I send two different packets once every 5 minutes. The first one never arrives. The second one always arrives. Prior to defining MY_PASSIVE_NODE, both would always arrive. This is on an nRF52832.

                            Of course, within a minute of posting the above, the first one suddenly decided to arrive. Maybe it's not a bug after all.

                            1 Reply Last reply
                            0
                            • NeverDieN Offline
                              NeverDieN Offline
                              NeverDie
                              Hero Member
                              wrote on last edited by NeverDie
                              #614

                              On the other hand, it really does seem to receive the second packet (solar panel voltage) far more often than the first (supercap voltage):

                              2017-08-14 12:17:45.613 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 12:22:45.866 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 12:22:45.887 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 12:27:46.121 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 12:27:46.152 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 12:32:46.399 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 12:32:46.431 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 12:37:46.661 (nRF52 DK Gateway) General/Barometer (SuperCap Voltage)
                              2017-08-14 12:37:46.708 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 12:42:46.928 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 12:42:46.975 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 12:47:47.207 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 12:47:47.254 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 12:52:47.474 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 12:52:47.493 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 12:57:47.736 (nRF52 DK Gateway) General/Barometer (SuperCap Voltage)
                              2017-08-14 12:57:47.767 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 13:02:48.006 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 13:02:48.051 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 13:07:48.279 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 13:07:48.310 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 13:12:48.556 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 13:12:48.587 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 13:17:48.843 (nRF52 DK Gateway) General/Barometer (SuperCap Voltage)
                              2017-08-14 13:17:48.882 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 13:22:49.085 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 13:22:49.116 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 13:27:49.371 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 13:27:49.402 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 13:32:49.624 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 13:32:49.655 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 13:37:49.896 (nRF52 DK Gateway) General/Barometer (SuperCap Voltage)
                              2017-08-14 13:37:49.942 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 13:42:50.169 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 13:42:50.215 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 13:47:50.450 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)
                              2017-08-14 13:47:50.481 (nRF52 DK Gateway) General/Barometer (Solar Panel Voltage)

                              Also, I hadn't realized until now that it was sending them multiple times. I had wanted each packet to be sent only once.

                              1 Reply Last reply
                              0
                              • NeverDieN Offline
                                NeverDieN Offline
                                NeverDie
                                Hero Member
                                wrote on last edited by NeverDie
                                #615

                                It looks as though it's a bug in Domoticz. If I open up the serial monitor to the gateway, I can see that it is receiving both packets. However, Domoticz isn't displaying them or even logging them. However, if I don't turn on MY_PASSIVE_NODE, then it does correctly display them. So, Bye-bye Domoticz. I hopee the other controllers don't have the same problem.

                                1 Reply Last reply
                                0
                                • NeverDieN Offline
                                  NeverDieN Offline
                                  NeverDie
                                  Hero Member
                                  wrote on last edited by
                                  #616

                                  Maybe nobody uses MY_PASSIVE_NODE? I just did a search of the forum, and nobody but me ever mentions it.

                                  Nca78N 1 Reply Last reply
                                  0
                                  • NeverDieN NeverDie

                                    Maybe nobody uses MY_PASSIVE_NODE? I just did a search of the forum, and nobody but me ever mentions it.

                                    Nca78N Offline
                                    Nca78N Offline
                                    Nca78
                                    Hardware Contributor
                                    wrote on last edited by
                                    #617

                                    @NeverDie I don't think many people know about it, I didn't know this define existed. But sounds like a good mode for things like temperature sensors with tiny batteries, so thank you for pointing it out.

                                    NeverDieN 1 Reply Last reply
                                    0
                                    • rmtuckerR Offline
                                      rmtuckerR Offline
                                      rmtucker
                                      wrote on last edited by
                                      #618

                                      At the moment i am range testing.
                                      I have the nrf51822 sending v_status true then false every second.
                                      The esp8266 gateway recieves it and sends it back to the nrf8122 which turns an led on and off accordingly.
                                      I have the nrf8122 running from a usb powerbank so i can walk around my house.
                                      There are a few deadspots around the house with the unamplified nrf24l01 on the gateway.
                                      I tried my nrf24l01 pa lna sma but it seemed to be only working every now and again so waiting on a new one being delivered.

                                      NeverDieN 1 Reply Last reply
                                      0
                                      • rmtuckerR rmtucker

                                        At the moment i am range testing.
                                        I have the nrf51822 sending v_status true then false every second.
                                        The esp8266 gateway recieves it and sends it back to the nrf8122 which turns an led on and off accordingly.
                                        I have the nrf8122 running from a usb powerbank so i can walk around my house.
                                        There are a few deadspots around the house with the unamplified nrf24l01 on the gateway.
                                        I tried my nrf24l01 pa lna sma but it seemed to be only working every now and again so waiting on a new one being delivered.

                                        NeverDieN Offline
                                        NeverDieN Offline
                                        NeverDie
                                        Hero Member
                                        wrote on last edited by NeverDie
                                        #619

                                        @rmtucker said in nRF5 Bluetooth action!:

                                        I tried my nrf24l01 pa lna sma but it seemed to be only working every now and again so waiting on a new one being delivered.

                                        According to hackaday, there's a certain very common model which doesn't perform well unless you wrap it first in saran wrap (as an electrical insulator) and then in aluminum foil (except for the antenna, obviously).

                                        rmtuckerR 1 Reply Last reply
                                        0
                                        • Nca78N Nca78

                                          @NeverDie I don't think many people know about it, I didn't know this define existed. But sounds like a good mode for things like temperature sensors with tiny batteries, so thank you for pointing it out.

                                          NeverDieN Offline
                                          NeverDieN Offline
                                          NeverDie
                                          Hero Member
                                          wrote on last edited by
                                          #620

                                          @Nca78 said in nRF5 Bluetooth action!:

                                          sounds like a good mode for things like temperature sensors with tiny batteries

                                          Exactly. If you're updating every 5 minutes (which is typical) or less, then it doesn't matter too much if you occasionally lose a packet, because there will be another one coming along in just a few minutes. So, if you can greatly increase your battery life as recompense, most people would

                                          I'm shocked it's not more prevalent here on the mysensors forum.

                                          mfalkviddM 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          15

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.0k

                                          Posts


                                          Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular