Can not reach low power state when radio is declared outside of main()

Description of defect
Inability to enter sleep mode (or at least reach expected sleep mode average current) after calling
static LoRaWANInterface lorawan(radio); when working with NRF52840-DK + SX1262MB2xAS mbed shield
even when building with Develop profile. Results in average "sleep" current of ~6.5mA. Uncommenting all code before main() (except for above line) and removing all code except sleep_for within main() yields expected sleep current (~14uA).
Target(s) affected by this defect ?
NRF52840-DK
Toolchain(s) (name and version) displaying this defect ?
Mbed Studio 1.4.0
What version of Mbed-os are you using (tag or sha) ?
6.3.0
What version(s) of tools are you using. List all that apply (E.g. mbed-cli)
Mbed CLI 2
How is this defect reproduced ?
Set up 2 NRF52840 DK's: one with PowerProfilerKit, another with SX1262MB2xAS mbed shield. Connect both to PC via microUSB (not nRF USB). Have PPK DK power LoRa shield DK via External supply, switch power on LoRaDK ON, nRF ONLY switch, VEXT->nRF switch to ON. Load up nRF Connect utility for the power profiler kit application, and enable DUT power and monitoring.
Use the default example for this sketch, but remove most of the code such that all that remains looks as below:
#include <stdio.h>

#include "lorawan/LoRaWANInterface.h"
#include "lorawan/system/lorawan_data_structures.h"
#include "events/EventQueue.h"

// Application helpers
#include "SX126X_LoRaRadio.h"
SX126X_LoRaRadio radio(D11,//MOSI
                       D12,//MISO
                       D13,//SCK
                       D7,//CS/NSS
                       A0,//RESET
                       D5,//DIO1
                       D3,//BUSY
                       A1,//FREQ_SEL
                       A2,//DEV_SEL
                       A3,//XTAL_SEL
                       D8);//ANT_SW

#include "mbed.h"

//DigitalOut led1(LED1);
using namespace events;
uint8_t tx_buffer[30];
uint8_t rx_buffer[30];
#define TX_TIMER                        20000
#define MAX_NUMBER_OF_EVENTS            10
#define CONFIRMED_MSG_RETRY_COUNTER     3
#define PC_9                            0

static EventQueue ev_queue(MAX_NUMBER_OF_EVENTS *EVENTS_EVENT_SIZE);
static void lora_event_handler(lorawan_event_t event);
static lorawan_app_callbacks_t callbacks;

static LoRaWANInterface lorawan(radio);

int main()
{
rtos::ThisThread::sleep_for(1000);
}

change the following in mbed_app.json:
"target_overrides": {         "*": {             "platform.stdio-convert-newlines": true,             "platform.stdio-baud-rate": 115200,             "platform.default-serial-baud-rate": 115200,             "lora.over-the-air-activation": true,             "lora.duty-cycle-on": false,             "lora.phy": "US915",             "lora.device-eui": "{ 0x00, 0x80, 0xA0, 0xD0, 0x09, 0xEA, 0x82, 0x37 }",             "lora.application-eui": "{ 0x70, 0xB3, 0xD5, 0x7E, 0xD0, 0x03, 0xE4, 0x02 }",             "lora.application-key": "{ 0xEE, 0xB6, 0x72, 0x7D, 0xEB, 0x52, 0x08, 0x1C, 0x2E, 0x32, 0xC4, 0x3B, 0xB8, 0x96, 0x86, 0x6D }",             "target.components_add":            ["SX126X"],             "lora.app-port": 2,             "lora.fsb-mask": "{0xFF00, 0x0000, 0x0000, 0x0000, 0x0002}"         },
"macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_lora_config.h\"", "MBED_TICKLESS=1"]
Now, compile, upload and compare the average currents when static LoRaWANInterface lorawan(radio); is commented, and uncommented. For me, results for commented are ~14uA average sleep current over 52ms period, while uncommented shows an average sleep current of approximately 6.5mA over 52ms period.

@charlesmodrich-tc  I have similar issues in #222.  Did you find a solution?  For tcxo control, I am exploring modifying the set_operation_mode call in the driver i.e. set to 0 when RF_OPMODE_SLEEP otherwise 1.  But that still leaves I high residual.

@charlesmodrich-tc  - very frustrating.

It really is! I spent a lot of time and hope on this before giving up.

Yes, have been in the same boat!  Having to revert back to the manufacturer SDKs is its own path of pain given all the messy #defines to support multiple targets and tight coupling of business logic to SDK logic.  It's a shame support resources for MBED seem to have dropped off recently and it is stuck being half a corporate project and half an open source project with neither seeming to have particularly strong momentum.

@charlesmodrich-tc - I have been doing some more debugging, this time on a Murata ISJ dev board (link).  This is a STM32L072 + SX126X radio.  With the Murata supplied AT firmware, I measure this board at the expected 2uA, so I know this is the baseline.   I am using a new example from scratch, but using the master branch of mbed-os (as I needed to make some non power related changes to the SX126X driver).
With the code below, I am able to achieve an average of 50uA.  Interestingly, if I power up the board (which puts the radio to sleep), then re-upload the code with the radio.sleep() line commented out, current falls to 11uA, which is very similar to the 14uA you measured.  I think this is related to GPIO/peripheral configuration in sleep but I haven't been able to figure out why, or where I am losing 9uA relative to the AT firmware.
mbed_app.json
{
  "requires": [
    "bare-metal",
    "events",
    "storage",
    "spif-driver",
    "lora",
    "mbedtls",
    "sx1276-lora-driver",
    "SX126X-lora-driver"
  ],
  "target_overrides": {
    "*": {
      "target.macros_add": ["MBED_TICKLESS"],
      "target.lpticker_lptim": 0
    },
    "MURATA_TYPE1SJ_EVB": {
      "SX126X-lora-driver.freq-support": "MATCHING_FREQ_915",
      "SX126X-lora-driver.device-variant": "SX1262"
    }
  }
}

main.cpp
#include "mbed.h"
#include "events/EventQueue.h"
#include "radio.h"
#include "SX126X_LoRaRadio.h"

#define MAX_NUMBER_OF_EVENTS 20

static EventQueue ev_queue(MAX_NUMBER_OF_EVENTS *EVENTS_EVENT_SIZE);

SX126X_LoRaRadio radio(LORA_SPI_MOSI,
                       LORA_SPI_MISO,
                       LORA_SPI_SCLK,
                       LORA_SPI_CS,
                       LORA_RESET,
                       LORA_DIO1,
                       LORA_BUSY,
                       LORA_FREQ_SELECT,
                       LORA_DEVICE_SELECT,
                       LORA_CRYSTAL_SELECT,
                       LORA_ANT_SWITCH);

int main(void)
{

    radio.sleep();
    ev_queue.dispatch_forever();
}

  "target.lpticker_lptim": 0

This is not tested, not validated, so not recommended...
Keep the default configuration

@jeromecoutant - this line saves about 30uA .  At the moment my objective is to just get current down to 2uA with nothing running, then start adding back functionality to be able to do a full LoRaWAN test so I'll admit I've been trying things such as that line without fulling understanding the impact.  The 2uA firmware is written in https://www.st.com/en/embedded-software/i-cube-lrwan.html but I find the structure such a headache to deal with.

That's interesting because I wanted to post a comment this night but went to bed before. In the meantime conversation has new comments.
I'm currently switching to mbed for my lorawan E5 and RAK3172 board because it's really nice simple with lot of features and this lorawan example works.
But my next step is to go to low power testing and seing this makes me feel inconfortable because the goal of LoRaWAN device is to be low lower. I'm going to 1.5uA with old murata one on custom code without mbed so 11uA or 50uA is not an option on my side.
Would be interesting to have @jeromecoutant, or @MarceloSalazar on this point, in the meantime I will give some tries on my boards.

The 2uA firmware is written in https://www.st.com/en/embedded-software/i-cube-lrwan.html but I find the structure such a headache to deal with.

I really don't understand how can this structure give you headache (kidding), but I'm glad I don't feel alone on this one 👍

@hallard  - I have some E5's on order along with the https://www.seeedstudio.com/LoRa-E5-mini-STM32WLE5JC-p-4869.html.   Is there a target already that works with this chip and can give low power?  I don't care what chip I use at this point as long as I can get something functional - don't know if there is anyone using MBED lorawan in the real world.
As to i-cube-lrwan, honestly my adaptions are relatively minor and I could probably mod it to get it working, but :scream: I don't the business logic would be so tightly coupled with that structure I couldn't deliver in good conscience.

@hallard - I have some E5's on order along with the https://www.seeedstudio.com/LoRa-E5-mini-STM32WLE5JC-p-4869.html. Is there a target already that works with this chip and can give low power?

Sure take a look there (not tested on Low Power yet )
for STM32WL i-cude-lrwan has been replaced by STM32Cube MCU Package for STM32WL series(SDK) may be it was too simple.
More information here but don't dream, file and folder architecture won't remove your any headache

@hallard thanks for the links.  Not Low Power tested is the concern.  I've tried the Type ABZ (custom build and DISCO LRWAN1), Type 1SJ and STM32L0/RFM95 (draguino LNS50 node) so far with no luck for easy low power < 10uA (and even struggling for <100uA).  I guess the trade-off for using a simplified framework like MBED is you lose that fine-grain control to library implementations.  Still, it such a common problem I'd hope there would be sufficient community support / documentation to get things running at least with a viable battery life for a low power long-term node (i.e. 1 year plus).  Especially for dev boards like the DISCO LRWAN1.

Worth looking at this sample code https://os.mbed.com/users/kenjiArai/code/Check_DeepSleep_os6/
For sure need to be adapted for STM32 target but could be an excellent starting point because on some board got 2uA which is both our target :-)

@hallard I have attempted something like the "LowPowerConfiguration" function before.  Firstly, I don't think "AHBENR" exists for a L0 target (so I switched for "IOPENR").  Secondly, I think the presence of the radio messes with this code as I have experienced worse performance after calling such a function following radio.sleep (as in mA).    Otherwise, I don't see anything obvious in this code that is doing anything I haven't tried before.  I haven't found anything documented as to what happens to peripherals/gpio when deep sleep is called.

BTW, with the exact some code and the LNS50 as a target (so swapping the SX126X driver for SX1276) I see 500uA.  But I am not convinced the pin mappings for the SX1276 are correct for the RFM95 module (https://github.com/dragino/Lora/blob/master/LSN50/v2.0/LoRa ST Sensor Node v2.0.sch.pdf and https://raw.githubusercontent.com/dragino/Lora/master/LoRaST/v1.0/LoRa ST v1.0_Sch.pdf).

Ok done some testing on my LoRa-E5 board, after removing all code of the sample (and all GPIO config such as LED and Button) here we go

1.43uA in deep sleep mode, perfect !!
mbed_app.json
{
    "requires": ["bare-metal", "events", "lora", "mbedtls"],
    "target_overrides": {
        "*": {
            "target.printf_lib": "std"
        }
    }
}

code
//  Include --------------------------------------------------------------------
#include "mbed.h"

//  Constructor ----------------------------------------------------------------
//DigitalIn   my_sw(BUTTON1);
//DigitalOut  myled(LED1,1);
static BufferedSerial pc(CONSOLE_TX, CONSOLE_RX, 115200);

//------------------------------------------------------------------------------
//  Control Program
//------------------------------------------------------------------------------
int main()
{
    while (true) {
//        myled = 0 ; // ON
//        ThisThread::sleep_for(1s);
//        myled = 1 ; // Off
//        ThisThread::sleep_for(2s);
        hal_deepsleep();
    }
}

Please not that using ThisThread::sleep_for(2s) instead sleep at 3mA

@hallard - great, sounds promising.  Is this the Seeed Studio dev board or one of your own?  I think with bare metal you need to use thread_sleep_for rather than ThisThread::sleep_for for the sleep manager to work (or events.dispatch_forever() like I used).  What's happening with the radio?  Is it defaulting to off for this board?  What are the settings for PeripheralPins.c?  What is the system clock configuration?

@evandavey yes it's my basic own board, pin definitions are here and the radio is included into the STM32WL chip.
hal_deepsleep() may be not the best because I'm not sure we can wake up with a timer, but I'm wondering how the difference between with thread_sleep_for()
As you can see as soon as I'm using this code consumption in sleep goes from 1.5uA to 2.9mA
int main()
{
    while (true) {
          thread_sleep_for(5000);
    }
}

@hallard  - I might be wrong on thread_sleep_for https://forums.mbed.com/t/clarification-on-os-6-empty-vs-os-6-bare-metal-example-programs-1-0-0/8950 and it is equivalent and doesn't call the sleep manager.  What do you get using events.dispatch_forever()?  Maybe the radio defaults to its sleep state on the STM32WL?

Same thing with
int main()
{
    EventQueue queue;
    queue.dispatch_forever();
}

2.9mA

Same code but not using bare-metal?

Sorry same code, same config so yes bare-metal

Sorry, I meant, what do you get running the same code but not in bare-metal?

int main()
{
    EventQueue queue;
    queue.dispatch_forever();
}

mbed_app.json => 6.5mA
{
    "requires": ["bare-metal", "events", "lora", "mbedtls"],
    "target_overrides": {
        "*": {
            "target.printf_lib": "std",
            "target.macros_add": ["MBED_TICKLESS"],
            "target.lpticker_lptim": 0
        }
    }
}

mbed_app.json => 2.9mA
{
    "requires": ["bare-metal", "events", "lora", "mbedtls"],
    "target_overrides": {
        "*": {
            "target.printf_lib": "std",
            "target.macros_add": ["MBED_TICKLESS"]
        }
    }
}

So  "target.lpticker_lptim": 0 saves 3.6mA?
For not bare-metal I mean
int main()
{
    EventQueue queue;
    queue.dispatch_forever();
}

{
    "target_overrides": {
        "*": {
            "target.printf_lib": "std"
        }
    }
}

and here we go without bare-metal, same results
int main()
{
    EventQueue queue;
    queue.dispatch_forever();
}

mbed_app.json => 6.5mA
{
    "target_overrides": {
        "*": {
            "target.printf_lib": "std",
            "target.macros_add": ["MBED_TICKLESS"],
            "target.lpticker_lptim": 0
        }
    }
}

mbed_app.json => 2.9mA
{
    "target_overrides": {
        "*": {
            "target.printf_lib": "std",
            "target.macros_add": ["MBED_TICKLESS"]
        }
    }
}

mbed_app.json => 2.9mA
{
    "target_overrides": {
        "*": {
            "target.printf_lib": "std"
        }
    }
}

I've done a little more testing myself.
3.4ma
int main()
{
    EventQueue queue;
    queue.dispatch_forever();
}

2.4ma
#include "SX126X_LoRaRadio.h"
SX126X_LoRaRadio radio(LORA_SPI_MOSI,
                       LORA_SPI_MISO,
                       LORA_SPI_SCLK,
                       LORA_SPI_CS,
                       LORA_RESET,
                       LORA_DIO1,
                       LORA_BUSY,
                       LORA_FREQ_SELECT,
                       LORA_DEVICE_SELECT,
                       LORA_CRYSTAL_SELECT,
                       LORA_ANT_SWITCH);

int main()
{
    EventQueue queue;
    queue.dispatch_forever();
}

70uA
#include "SX126X_LoRaRadio.h"
SX126X_LoRaRadio radio(LORA_SPI_MOSI,
                       LORA_SPI_MISO,
                       LORA_SPI_SCLK,
                       LORA_SPI_CS,
                       LORA_RESET,
                       LORA_DIO1,
                       LORA_BUSY,
                       LORA_FREQ_SELECT,
                       LORA_DEVICE_SELECT,
                       LORA_CRYSTAL_SELECT,
                       LORA_ANT_SWITCH);

int main()
{
    EventQueue queue;
    radio.sleep();
    queue.dispatch_forever();
}

{
  "requires": [
    "bare-metal",
    "events",
    "lora",
    "mbedtls",
    "SX126X-lora-driver"
  ],
  "target_overrides": {
    "*": {
      "target.macros_add": ["MBED_TICKLESS"],
      "target.reset_gpio_on_init": 1
    },
    "MURATA_TYPE1SJ_EVB": {
      "SX126X-lora-driver.freq-support": "MATCHING_FREQ_915",
      "SX126X-lora-driver.device-variant": "SX1262"
    }
  }
}

I am pretty sure that in both bare-metal and RTOS queue->dispatch_forever() should go into deep sleep when idle (and this is what I am experiencing).  Can you turn on sleep tracing to see if anything is blocking deep sleep?

May be the Serial port console? do you know how to be sure that any serial is disabled?

You could try: mbed_file_handle(STDIN_FILENO)->enable_input(false)
Console and Deep Sleep

With radio driver
#include "mbed.h"
#include "STM32WL_LoRaRadio.h"

static BufferedSerial pc(CONSOLE_TX, CONSOLE_RX, 115200);
STM32WL_LoRaRadio radio;

int main()
{
    EventQueue queue;
    radio.sleep();
    queue.dispatch_forever();
}

mbed_app.json => 6mA average
{
    "requires": ["bare-metal", "events", "lora", "mbedtls", "stm32wl-lora-driver"],
    "target_overrides": {
        "*": {
            "target.printf_lib": "std"
        }
    }
}

And you're using a develop or release build profile (not debug?)

ah ah good catch, it's a debug, compiling above code as release and here we go
Avg 1.7uA and peak are 4mA for approx 2ms

OK, that's great!! And is it the same without the radio.sleep() call?
Perhaps we need to compare the differences between "STM32WL_LoRaRadio.h" and "SX126X_LoRaRadio.h".

yes same things without radio.sleep(), I already had 1.5uA with murata ABZ (STM32L0 + SX126x) with another framework so it's do able and may be your issue is related to mbed. Do you have same issue on mbed 5 where ABZ is officially supported?

What framework?  I have tried stm32duino / arduino-lmic but similar issues.  I am actually using a Type 1SJ for these tests.  My LRWAN1 board had to be repurposed in a field test and I haven't re-checked on my custom board.  But experiencing similar issues on the Draguino LNS50.  Definetely there is some config issues with the framework, but they should be solveable with support....
Please post your results when you have done a end-to-end test with LoRaWAN active.

using this one https://github.com/GrumpyOldPizza/ArduinoCore-stm32l0
By the way do your board manage USB because I remember having issues with that, very tricky, needed to disable some USB stuff and more, needed to reset (start the board) without usb connected, removing USB cable once started prevented to go to low power.

I used that GrumpyOldPizza framework very early on but ran into LoRa implementation issues, can't remember exactly what now, and gave up.  Could have been related to early days of them supporting AU915.  If you have any code you can share that would be greatly appreciated.
I experience a similar issue with the Draguino LNS50 where I have to use a ST-Link and need it unplugged for low power.  Have tested the Type 1SJ both with and without the (on-board) debugger connected and it makes no difference (and the ~45uA I am seeking is too low for that anyway).

Here part of my code working for GrumpyOldPizza (with git version since some API have changed since)

#include "STM32L0.h"
#include "LoRaWAN.h"
#include "TimerMillis.h"

// Transmit period in s
#define LORA_TRANSMIT_PERIOD  300

// for USB
#define DEBUG_USB
#define DEBUG_SERIAL

// Disable USB after boot
#define DISABLE_USB_SERIAL

#ifdef  DEBUG_SERIAL
#define SERIAL_DEBUG  Serial1
#elif defined (DEBUG_USB)
#define SERIAL_DEBUG  Serial
#endif

#if defined (DEBUG_USB) || defined (DEBUG_SERIAL)
#define debug(VAL)          { SERIAL_DEBUG.print(VAL); }
#define debug2(VAL, MODE)   { SERIAL_DEBUG.print(VAL, MODE); }
#define debugln(VAL)        { SERIAL_DEBUG.println(VAL); }
#define debug2ln(VAL, MODE) { SERIAL_DEBUG.println(VAL, MODE); }
#define debugflush()        { SERIAL_DEBUG.flush(); }
#else
#define debug(VAL)          {}
#define debug2(VAL, MODE)   {}
#define debugln(VAL)        {}
#define debug2ln(VAL, MODE) {}
#define debugflush()        {}
#endif

#define WAKE_BTN YOUR_BUTTON_IO_NAME

uint32_t transmitPeriod = LORA_TRANSMIT_PERIOD;
bool VUSB, hasUSB;

volatile bool wake_btn = false;
volatile bool wake_timer = false;
volatile bool wake_join = false;

TimerMillis wakeTimer;

void ledOff()
{
  // Letting PWM active prevent stop mode and thus
  // stop()/deepsleep() does not go into sleep mode.
  pinMode(LED_RED, OUTPUT);
  pinMode(LED_GRN, OUTPUT);
  pinMode(LED_BLU, OUTPUT);
  digitalWrite(LED_RED, LEDOFF);
  digitalWrite(LED_GRN, LEDOFF);
  digitalWrite(LED_BLU, LEDOFF);
}

void btn_interrupt()
{
  wake_btn = true;
  STM32L0.wakeup();
}

void timer_interrupt(void)
{
  wake_timer = true;
  STM32L0.wakeup();
}

void joinCallback(void)
{
  debug("joinCallback() ");
  wake_join = true;
  STM32L0.wakeup();
}

void setup()
{
  char buffer[18];

  VUSB = USBDevice.attached();
  hasUSB = USBDevice.connected();

  pinMode(WAKE_BTN, INPUT);

  LoRaWAN.begin(EU868);
  LoRaWAN.getDevEui(buffer,18);

#ifdef DEBUG_SERIAL
  Serial1.begin(115200);
  while (!Serial1 && millis()<=2000 ) {
  }
  Serial1.println("Serial1 OK");
#endif

#ifdef DEBUG_USB
  Serial.begin(115200);

  while (!Serial && millis()<=5000 ) {
  }
  Serial.println("OK");
#endif

  LoRaWAN.setADR(true);
  LoRaWAN.setDutyCycle(false);
  LoRaWAN.onJoin(joinCallback);
  LoRaWAN.onReceive(receiveCallback);

  debugln("LoRa Joining");
  LoRaWAN.joinOTAA(appEui, appKey, (const char *) buffer);

#ifdef DEBUG_USB
#ifdef DISABLE_USB_SERIAL
  // Switch to real uart
  Serial.println("Stopping USB");
  Serial.end();
#else
  Serial.println("!!!! Leaving USB Serial running !!!!");
#endif
#endif

// In all case even just Serial
#ifdef DISABLE_USB_SERIAL
  USBDevice.detach();
#endif

  // Initialize our wake timer but do net setup yet
  wakeTimer.start( timer_interrupt, 10000);
  wakeTimer.stop();
}

void loop()
{
  unsigned long next_transmit = transmitPeriod;

  if (wake_btn) {
    debugln("button");
  }

  if (wake_join) {

    if (!LoRaWAN.joined()) {
      debug("NOT ");
    }
    debugln("JOINED");
    wake_join = false;
  }

  if (wake_timer) {
    // Security to be sure to be waked
    wake_timer = false;
  }

  ledOff();
  wake_btn = false;

  // reset heartbeat every 4 x transmit period
  wakeTimer.restart( LORA_TRANSMIT_PERIOD * 4 * 1000 + 5000);

	debug("Going to Sleep (");
  debug(next_transmit);
  debugln("s)...");
  debugflush();

  attachInterrupt(WAKE_BTN, btn_interrupt, RISING);

  STM32L0.deepsleep(next_transmit*1000);

   // Just waked up
  detachInterrupt(WAKE_BTN);
}

Awesome, thanks!  Can't see too much different from MBED in this application code so it must be the initial pin config / deep sleep code that is done differently.

can you share your HW schematics or not?

Type 1SJ EVM I think technically can't be shared (though they give you access if you buy the board) - I asked if I can share my target files with the mbed-os community but so far no response.  My custom board I can't as it is a client design (but I have accounted for TCXO) - it is pretty much the reference design with provision for an external crystal and for TCXO to be GPIO switched.  I'd build another one to test with bare minimum components but can't source the Type ABZ modules at the moment.  This issue shows up on the DISCO LRWAN1 board too.  If I dig in to the SX1276 driver though you supply a TCXO pin I don't think it actually does anything with it so I have manually disabled it.  You can measure the impact (about 1mA from memory) but that doesn't help (see https://github.com/ARMmbed/mbed-os-example-lorawan/issues/222).

Here mine
D12 is PB14 in my case

Does the "LoRaWAN.h" switch it?  If I search _tcxo in mbed SX1276_LoRaRadio.cpp I can see it turned on on line 212 but then not referenced again.

Yep  - I can see specific calls in the libraries and looks like the GPIOs are configured better too when it's off for deep sleep:
# https://github.com/GrumpyOldPizza/ArduinoCore-stm32l0/blob/b1cf1cd6eba2f06bbe4edbe76aa43ae5971e8d8c/system/STM32L0xx/Source/LoRa/Boards/cmwx1zzabz-board.c
# Line 134
void SX1276SetBoardTcxo( bool state )
{
    if (RADIO_TCXO_VCC != STM32L0_GPIO_PIN_NONE)
    {
        if( state == true )
        {
            stm32l0_gpio_pin_configure(RADIO_TCXO_VCC, (STM32L0_GPIO_PARK_NONE | STM32L0_GPIO_PUPD_NONE | STM32L0_GPIO_OSPEED_HIGH | STM32L0_GPIO_OTYPE_PUSHPULL | STM32L0_GPIO_MODE_OUTPUT));
            stm32l0_gpio_pin_write(RADIO_TCXO_VCC, 1);
        }
        else
        {
            stm32l0_gpio_pin_configure(RADIO_TCXO_VCC, (STM32L0_GPIO_PARK_NONE | STM32L0_GPIO_MODE_ANALOG));
        }
    }
}

But this is a separate issue to deep sleep (though does imply this library has a more detailed implementation so more likely to minimise current consumption).

I have had a break-through and am now getting down to 7uA!
I created a new SX1276 radio class which extends the original and overrides the sleep() and wakeup() methods.
I have only tested sleep but it looks like this so far:
 void sleep() final
{
    // call actual sleep method
    SX126X_LoRaRadio::sleep();

    // Set low power for pins

    GPIO_InitTypeDef GPIO_InitStructure = {0};

    // Disable ant switch (PA_15)
    GPIO_InitStructure.Mode = GPIO_MODE_ANALOG;
    GPIO_InitStructure.Pull = GPIO_NOPULL;
    GPIO_InitStructure.Pin = (GPIO_PIN_15);
    __GPIOA_CLK_ENABLE();
    HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);
    __GPIOA_CLK_DISABLE();

    // Disable SPI pins (SCLK PB_13, MISO PB_14, MOSI PB_15)
    GPIO_InitStructure.Mode = GPIO_MODE_ANALOG;
    GPIO_InitStructure.Pull = GPIO_NOPULL;
    GPIO_InitStructure.Pin = (GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15);
    __GPIOB_CLK_ENABLE();
    HAL_GPIO_Init(GPIOB, &GPIO_InitStructure);
    __GPIOB_CLK_DISABLE();
}

I have tried with CS (PB_12) with various pull up settings but this always results in ~1mA so assume this is turning the radio back on.  Don't know if this accounts for the missing 5uA.
Don't know if there is a better MBED way of doing this in PeripheralPins.c.  Also not sure if there are any global sleep / wakeup hooks that could be used instead as part of the sleep manager.
Will also need to work-out how to reverse in the wakeup() override.

HW deinit seems like it might be an outstanding mbed issue https://github.com/ARMmbed/mbed-os/issues/3106
@jeromecoutant  - any way to deinit / init SPI just for an STM32L0 target?

I have had a break-through and am now getting down to 7uA!

Wow impressed, I think you're very close. It's the first time I see that changing SPI pins before sleep has an effect on sleep mode consumption (I mean with this module I remember the need on doing that with custom boards with RFM95) . I had same thing for CS Line. Did you tried to put it in HI-Z mode instead?
The grumpyoldpizza does not change these pin and it works,, correct?
By the way if there is another device on SPI bus it may affect it not but it's out of the scope of this issue of course.

I think GrumpyOldPizza does change these pins, and so does I-CUBE-LRWAN (see e.g. Drivers/BSP/SX1262DVK1CAS/sx1262dvk1cas.c).
static void SX1262DVK1CAS_RADIO_SPI_IoDeInit(void)
{
  GPIO_InitTypeDef GPIO_InitStruct;

  /* Peripheral clock disable */
  /* no need to call SPI1_CLK_DISABLE() because going in LowPower it gets disabled automatically */

  /* DeInitialize Peripheral GPIOs */
  /* Instead of using HAL_GPIO_DeInit() which set ANALOG mode
     it's preferred to set in OUTPUT_PP mode, with the pins set to 0 */

  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  GPIO_InitStruct.Pull = GPIO_PULLDOWN;
  GPIO_InitStruct.Pin = RADIO_SPI_MOSI_GPIO_PIN;
  HAL_GPIO_Init(RADIO_SPI_MOSI_GPIO_PORT, &GPIO_InitStruct);
  GPIO_InitStruct.Pin = RADIO_SPI_MISO_GPIO_PIN;
  HAL_GPIO_Init(RADIO_SPI_MISO_GPIO_PORT, &GPIO_InitStruct);
  GPIO_InitStruct.Pin = RADIO_SPI_SCK_GPIO_PIN;
  HAL_GPIO_Init(RADIO_SPI_SCK_GPIO_PORT, &GPIO_InitStruct);

  HAL_GPIO_WritePin(RADIO_SPI_MOSI_GPIO_PORT, RADIO_SPI_MOSI_GPIO_PIN, GPIO_PIN_RESET);
  HAL_GPIO_WritePin(RADIO_SPI_MISO_GPIO_PORT, RADIO_SPI_MISO_GPIO_PIN, GPIO_PIN_RESET);
  HAL_GPIO_WritePin(RADIO_SPI_SCK_GPIO_PORT, RADIO_SPI_SCK_GPIO_PIN, GPIO_PIN_RESET);
}

static void SX1262DVK1CAS_RADIO_SPI_IoInit(SPI_HandleTypeDef *spiHandle)
{
  GPIO_InitTypeDef GPIO_InitStruct;
  /* USER CODE BEGIN SPI1_MspInit 0 */

  /* USER CODE END SPI1_MspInit 0 */
  /* Enable Peripheral clock */
  RADIO_SPI_SCK_GPIO_CLK_ENABLE();
  RADIO_SPI_MOSI_GPIO_CLK_ENABLE();
  RADIO_SPI_MISO_GPIO_CLK_ENABLE();

  /**SPI1 GPIO Configuration
  PA5     ------> SPI1_SCK
  PA6     ------> SPI1_MISO
  PA7     ------> SPI1_MOSI
    */
  GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
  GPIO_InitStruct.Pull = GPIO_PULLDOWN;
  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;

  GPIO_InitStruct.Alternate = RADIO_SPI_MOSI_GPIO_AF;
  GPIO_InitStruct.Pin = RADIO_SPI_MOSI_GPIO_PIN;
  HAL_GPIO_Init(RADIO_SPI_MOSI_GPIO_PORT, &GPIO_InitStruct);
  GPIO_InitStruct.Alternate = RADIO_SPI_MISO_GPIO_AF;
  GPIO_InitStruct.Pin = RADIO_SPI_MISO_GPIO_PIN;
  HAL_GPIO_Init(RADIO_SPI_MISO_GPIO_PORT, &GPIO_InitStruct);
  GPIO_InitStruct.Alternate = RADIO_SPI_SCK_GPIO_AF;
  GPIO_InitStruct.Pin = RADIO_SPI_SCK_GPIO_PIN;
  HAL_GPIO_Init(RADIO_SPI_SCK_GPIO_PORT, &GPIO_InitStruct);
}

I noticed that hal_deepsleep() is declared weak in TARGET_STM/sleep.c so have attempted to implement a custom deinit and init function (like above) before/after sleep but weirdly this behave as expected and I see very high current or no impact.  But this might be the most promising place to put it as it doesn't require extending the driver.

@hallard
Can you please confirm your test measurement setup?  I am seeing an average of about 620uA on a SeeedStudio LoRa E5 Mini using your code from https://github.com/ARMmbed/mbed-os-example-lorawan/issues/227#issuecomment-885491038 and mbed-os-example-lorawan as the starter project.
I am using the target files from https://github.com/ARMmbed/stm32customtargets with the LORA_E5_MINI target.
I am measuring power using a Nordic PPK2 powering the board at 3.3V via the 3.3V pin and GND.  Nothing else is connected.
I am compiling using GCC_ARM (GNU ARM 9-2019-q4-major) and with the Release profile.

I confirm code mentioned (basic no full sample LoRawan not tested yet) consumption. Take care LoRa E5 mini have all usb stuff on board including usb serial chip connected to uart. depending on type and if this chip powered or not it could draw some current same as on board regulator where you apply 3.3v on it output

I had a look at the schematic and I think the USB circuitry is only powered when 5V is present.  The assert above has me thinking the radio isn't getting into sleep mode due to some error.

I dead a dead-bug board.  I have broken out VCC,GND,SWCLK, SWDIO, NRST.  VCC and GND have a 1u and 100nF capactior on as short leads as possible.  Nothing else is broken out or connected.  Using the LORA E5 MINI as the target, I am still getting the same results as the actual mini.  I haven't connected the UART or a LED so I can't actually prove the code is running aside from that it programs and current matches.
@hallard - perhaps you could send me your compiled binary and I can test that?

So even with only LoRa-E5 nothing else except caps (no regulator of course) you still have the issue? I can try back and give the compiled code but not today as I got so much other things to finish before.

@hallard  - no worries, whenever you can.  Yes, just the LoRa-E5 powered by the Nordic PPK2 @ 3.3V.

Ok took some time here, used  latest master from
https://github.com/ARMmbed/mbed-os
https://github.com/ARMmbed/stm32customtargets
then use this code (as release of course)

mbed_app.json
{
    "requires": ["bare-metal", "events", "lora", "mbedtls", "stm32wl-lora-driver"],
    "target_overrides": {
        "*": {
            "target.printf_lib": "std"
        }
    }
}

custom_targets.json
{
    "LORA_E5": {
        "inherits": [
            "MCU_STM32WLE5xC"
        ],
        "device_name": "STM32WLE5JCIx"
    },
    "LORA_E5_BREAKOUT": {
        "inherits": [
            "LORA_E5"
        ],
        "macros_add": [
            "LED1=PB_5",
            "LED2=PB_10",
            "BUTTON1=PB_13"
        ]
    }
}

Connected as follow

Powering with

and tadaaaaaa 1.5uA

Please note the 3mA peaks (mainly some OS wake) an if I put them into the selection I have average of 7.5uA

Hope this helps

@hallard  - thank you.  Very odd, our different results and almost identifcal setups.   I have installed MBED Studio and will try compiling with that tomorrow (very late here) and see if that changes anything.

Here the compiled file if you want to give a try mbed-os-deepsleep-test.bin.zip

Some progress.  On the bare E5 board, your binary and a version I compiled using MBED studio matches your results!  However, unplugging the debugger, current jumps to about 100uA - are you seeing the same result?

Some progress. On the bare E5 board, your binary and a version I compiled using MBED studio matches your results! However, unplugging the debugger, current jumps to about 100uA - are you seeing the same result?

humm not sure I tested removing debugger while running but sure that running it while no debugger connected on start was also 1.5uA

Same code uploaded to the E5 Mini is 620uA. It's possible this is the USB, but I am still suspicious it's related to GPIOs or that assert error.

usb has only 3 wires connected, gnd tx and rx correct? and both connected directly to E5 rx, tx ? But may be you right I’m using ch340 usb/serial may be Ftdi one or cp21xx has an issue with that need to try that

Removing debugger or running with no debugger connected on start gives me 100uA but I will double-check the latter.
They use a CP2102N for USB/UART and connect rx,tx and rst.  But this should only be powered if 5V present.  I have also asked Seeed if they have instructions on how to measure current.

No debugger on start-up does give me 7uA average after-all, so looking promising.  I will try to hook up an antenna for a full-test and hope that meanwhile Seeed report back on the E5 mini.

7uA Average is same than my measure :-)

Yeah, I know :)  Need to implement a full test to be sure.

Seeed recommended removing the 5V->3.3V regulator (U2) and the two resistors connecting tx/rx (R3/R4) to the CP2102N.  With just the regulator removed, I am now seeing 7uA average (~2uA min) so I will attempt a full LoRa test now with this board.

Humm means that you had leak current going from your 3.3v rail going thru the regulator. Remind me one message earlier in this thread 😋

And success!  2uA in sleep following an uplink.  It does beg the question what is different about this target versus the others - newer radio driver that handles the GPIOs?

STM32WL does not have an external radio chip such as SX12.. the radio is directly  integrated into the STMWL32 chip.
But this  does not solve issue for murata device indeed.

And yep, does look like a leak through the regulator on that board, nice pick-up 👍

Murata + I have had similar issues with the Draguino which is STM32L0 + external RFM95W.  And the OP which was having issues with an external board as well

And yep, does look like a leak through the regulator on that board, nice pick-up 👍

Yeah as rule 1 in low power is “everything connected may be source of leak current”, and this is so true for every connected chip even if they are not powered. Regulators are for output current/voltage depending on it’s design applying input (3.3v) to it’s output may at worse fry it, leak current or may be just nothing.

Murata + I have had similar issues with the Draguino which is STM32L0 + external RFM95W. And the OP who was having issues with an external board as well. But at least some real-world proof that LoRa on MBED is feasible with at least one chip.

Yeah but I’m another project where I need murata to be to 2uA like with grumpyoldpizza framework so if team could solve this low power issue would be fine

Certainly something with the init/deinit of pins, and the TCXO control, so at least we've discovered that.  I wish they would separate out the MBED specific stuff from the driver stuff so that the driver logic could be kept up-to-date with the Semtech (or other) reference implementation.  Kind of what they are moving to with HAL layer in https://github.com/Lora-net/sx126x_driver but looks like a lot of work to implement that with the current MBED way of doing things.

Yeah and lorawan stack in current implementation is 1.0.2 so behind LoRa Mac node current version 1.0.4 and 1.1.0 hope they will be able to update the stack

@evandavey
I've done some testing with old Murata board (STM32L0 + SX1276), deep sleep without declaring Radio instance works at 2/3uA as expected, but as soon as I declare the radio instance (even not using it) I'm not low powering
Quick investigation shows that there is no control of txco off in radio.sleep() but it's present on loramac-node implementation.
loramac-node radio sleep/standby implementation
void SX1276SetSleep( void )
{
    TimerStop( &RxTimeoutTimer );
    TimerStop( &TxTimeoutTimer );
    TimerStop( &RxTimeoutSyncWord );

    SX1276SetOpMode( RF_OPMODE_SLEEP );

    // Disable TCXO radio is in SLEEP mode
    SX1276SetBoardTcxo( false );

    SX1276.Settings.State = RF_IDLE;
}

void SX1276SetStby( void )
{
    TimerStop( &RxTimeoutTimer );
    TimerStop( &TxTimeoutTimer );
    TimerStop( &RxTimeoutSyncWord );

    SX1276SetOpMode( RF_OPMODE_STANDBY );
    SX1276.Settings.State = RF_IDLE;
}

mbed radio sleep implementation
void SX1276_LoRaRadio::sleep()
{
    // stop timers
    tx_timeout_timer.detach();

    // put module in sleep mode
    set_operation_mode(RF_OPMODE_SLEEP);
}

void SX1276_LoRaRadio::standby(void)
{
    tx_timeout_timer.detach();

    set_operation_mode(RF_OPMODE_STANDBY);
    _rf_settings.state = RF_IDLE;
}

I managed tcxo in driver like loramac-node implementation but I did not succeeded to go below 400uA. loramac-node has also de init antenna stuff here and gpio de init also but only for DIO pins and SPI CS pin here that can be interesting
If anyone has an idea of why we can't go below, we take it.

@hallard  - thanks, that agrees with my analysis and the key seems to be the init/deinit code which I could never get working.  I've also built a board to test out the AcSIP ST50H http://www.acsip.com.tw/index.php?action=products-detail&fid1=19&fid2=&fid3=&id=151 which should hopefully function the same as the E5 module.  Had some board design issues so fixing them up now for testing hopefully in a few weeks.

@hallard - have you pushed up changes in that repo?  Not seeing your commits.  From when I was testing, I was seeing some power impact deintiing the SPI pins but could never work out how to reinit them.  I was trying calling the STM32 HAL calls rather than using MBED initially just to see if that would work.  So copy/pasting the relevant init/deint sections from the STM32 Cube LoRaWAN libraries.

This was un unpushed commit sorry, now it's done, but I did not touched SPI pins for now, may be next step de init SPI.

@hallard - I have just built up a couple of Seeed LoRa E5 based boards and have done a real-world test over about 620m from node to gateway (RSSI ~-125-135, SNR: 13-14.5 with no line of sight and node indoors) so that's looking promising (so sampling sensors including using mbed trace and sending via TTN).  Seeing ~50uA in sleep but it's installed in a 3rd party carrier board so could be leakage there and 50uA 'good enough for Australia' (as Dave from the EEVBlog would say).  Still trying to read VBAT using the ADC but otherwise seems good.  Waiting on some AcSIP ST50H chips so I can test those too using the same platform.

@evandavey you still want to sleep at 3uA on Murata with mbed 6? Looks like we looked at the wrong place with GPIO, I don't know how my partner found this one but looks like misconfiguration of DIO registers :-)
just try this branch fix and let me know
https://github.com/hallard/mbed-os/tree/LORA_SX1276_LP_Fix

@evandavey you still want to sleep at 3uA on Murata with mbed 6? Looks like we looked at the wrong place with GPIO, I don't know how my partner found this one but looks like misconfiguration of DIO registers :-)
just try this branch fix and let me know
https://github.com/hallard/mbed-os/tree/LORA_SX1276_LP_Fix

And success! 2uA in sleep following an uplink. It does beg the question what is different about this target versus the others - newer radio driver that handles the GPIOs?

Dear @evandavey
I'm not able to reduce power consumption below 1.5mA with a RAK3172 (STM32WLE5C), similar to E5, using mbed-os-example-lorawan
Please, could you share how to configure Mbed to get 2uA.
Kind regards

@IoTopenTech - no special configuration should be needed for the E5/STM32WLE5C using the latest mbed/drivers other than making sure you are not building a debug build.  Have you tried the bare minimum code used by Charles above (using https://github.com/ARMmbed/stm32customtargets for the target)?  I had some leakage from other components (power regulator) that could also be your issue.  Thanks for the VBAT code.

@hallard - thanks for the Murata info.  Will try this when I get a chance.

Thank you very much @evandavey
Problem solved.
It was probably a soldering issue.
Now I am getting 2.5uA after uplink.

And success! 2uA in sleep following an uplink. It does beg the question what is different about this target versus the others - newer radio driver that handles the GPIOs?

As we though initially with @evandavey it was a matter of GPIO but did not tried to reconfigure GPIO on SX1276 side, magic is do do was on SX1276_LoRaRadio.cpp
        /* FIXME taken from set_modem, it reduces the power consumption
         *from 300µA to 1.5µA */
        write_to_register(REG_DIOMAPPING1, 0x00); // sets DIO0-DI03 in default mode
        write_to_register(REG_DIOMAPPING2, 0x30); // bits 4-5 are turned on i.e.,

@hallard - will dig up an old Murata ABZ based board to test and report back.  The Type 1SJ uses a SX126X radio so exploring how to do the equivalent.

link

Any news on this. Working on a project and seeing large sleep current for a similar board.

Any news on this. Working on a project and seeing large sleep current for a similar board.

@carriegong - which board/radio in particular?

@evandavey Custom Murata ABZ. I do not tick lora_fsm from start. Until some user input... But on sleep without ticking lora_fsm it seems to draw 3.4mA oddly. Can't seem to find what. Disabled all GPIO/ all inits.. and still the same. Seems like something else in radio needs to be off.

@carriegong - not sure what you mean by ticking lora_fsm?  But a few things to check/try:

Try the @hallard build above https://github.com/hallard/mbed-os/tree/LORA_SX1276_LP_Fix
Ensure you are building for Release not Debug
Try calling

    mbed_file_handle(STDIN_FILENO)->enable_input(false);

Try a bare minimum example (where radio is declared, then the queue is dispatched and nothing else - see examples above).
Try disconnecting a debugger if you have one connected

@evandavey  Like this lora_fsm
I am using stm32 code. not mbedOS

@carriegong - the info here is mostly mbed specific so not sure how much help it will be as results vary significantly by framework due to implementation differences (which can be very hard to compare/audit).  Have you tried https://github.com/GrumpyOldPizza/ArduinoCore-stm32l0? (see https://github.com/ARMmbed/mbed-os-example-lorawan/issues/227#issuecomment-885499468) or even the Loramac reference implementation https://github.com/Lora-net/LoRaMac-node?

@evandavey  would you be so kind sharing full LoRa test code
I am starting out with LoRa on MbedOs and the only okay example is the official example.
Currently I am able to produce bare-bones low-power test but can't figure out the full picture.
I am particularly interested in code used for this test:

And success! 2uA in sleep following an uplink. It does beg the question what is different about this target versus the others - newer radio driver that handles the GPIOs?

@JenertsA  - I will try to dig out the exact code I used, but it was pretty much the example in this repo but built for an E5/STM32WLE5C using (https://github.com/ARMmbed/stm32customtargets).  What is the exact target/gateway combo you are trying?

@evandavey I am using a custom RAK3172 board and RAK3172 target from previously mentioned  smt32customtargets.
the end goal is to make a device that reads I2C sensors and sends data ower LoRaWAN to TTN.
For the most part, I just need to spend some time digging through the example code to understand how the all mbedOs lorawan thing works. A bit steep learning curve coming here from 8bit MCUs with simple C++ without many files and APIs around it.

@JenertsA - the main example is complicated by things like the duty cycle flags and supporting multiple targets but the main thing is that the API is event driven.  The LoRa callbacks are hooked in https://github.com/ARMmbed/mbed-os-example-lorawan/blob/master/main.cpp#L110 and then handled https://github.com/ARMmbed/mbed-os-example-lorawan/blob/master/main.cpp#L216.


cmd/compile/internal/importer, go/internal/importer (+friends): can't import 'any' underlying

The following logic is replicated to a few of our importers:
	if t, ok := p.typCache[off]; ok && (base == nil || !isInterface(t)) {
		return t
	}

https://cs.opensource.google/go/go/+/master:src/go/internal/gcimporter/iimport.go;l=258;drc=f90a42b41080cf5a289f151f2166d0d0a795e836
As a result, we don't use the cached, predeclared any when considering the RHS of a type declaration, as in
type Any any

When importing this code, we get
cannot import <package> (predeclared type missing from cache: 31), possibly version skew - reinstall package

(it is unfortunate that we did not add test coverage for this pattern, once any was allowed out of constraint position)
Notably, cmd/compile/internal/typecheck does not appear to have this problem:
https://cs.opensource.google/go/go/+/master:src/cmd/compile/internal/typecheck/iimport.go;l=745;drc=229b90931312aa1686f4bace25d1f40f896884ad
Discussing with @griesemer, we're not sure why that guard is necessary. Certainly it seems OK to add an exception for any there. If this doesn't work out, we may need to revert #49583, which would be unfortunate.
CC @mdempsky and @danscales who may have additional context, @heschi for awareness.

Looked at this a bit more. The original problem is that we use the LHS of type declaration as the receiver type in interface methods on the RHS, so such RHS interfaces can't be reused.  Possibly we could stop doing this, but that's not a decision for now. To fix this bug, we can just allow reusing empty interfaces.

This issue is currently filed as release blocking and not okay after beta 1, so the Go 1.18 beta 1 is being blocked on it.

This issue is currently filed as release blocking and not okay after beta 1, so the Go 1.18 beta 1 is being blocked on it.

Yes, this is definitely a release blocker.  The CL to fix it is pending.


Add protobuf-d as a submodule to Agora

Part of #203

Because there's no tagged version which include the commit which fixes 120 lines of deprecations. Namely this.

Dockercloud will be green after merge


Add a note to 0.10 Backup and Restore

Adds a note to the backup and restore page that to do backups and restores, all shards must be in TSM format.
Fixes: https://github.com/influxdata/docs.influxdata.com/issues/331

@ross, could you look this over when you get a chance?

@ross, could you look this over when you get a chance?

I'm probably not the Ross you were looking for 😀

Haha, sorry about that, @ross :blush:

@rossmcdonald - oops, asked the wrong Ross (in my defense you both had mc in your last name :grin:). This is super short - could you OK it when you get a chance?

Hah, that's hilarious.
:+1: Looks good!


Add some metrics for BigQueryStorageStreamReader

Add basic latency metrics for BigQuery storage stream source

Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

[ ] Choose reviewer(s) and mention them in a comment (R: @username).
[ ] Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
[ ] Update CHANGES.md with noteworthy changes.
[ ] If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

Please review, @chamikaramj and @ajamato.

Please add a JIRA

R: @ihji


don't just rebalance the same channel, when timeout occures

"Last 10 Rebalance Requests (currently scheduling 2 of 5 enabled channels for rebalancing)"
shows multiple rebalance attempts for only 1 channel.
I get most of the time a "Timeout" (sometimes also a "Rebalancer Request Timeout") on the same channel.
Rebalance again, if success, like in https://github.com/cryptosharks131/lndg/issues/47 said is fine.
But if it's not successful, also the other channels scheduled should try to rebalance.

Both channel should be scheduling, if this is still a issue for you, provide some details around the max cost%, fee rate and target rebalance size for the channel that is not rebalancing.


Allow preset registries to be configured, to prevent typing it each time.

Description
Please make it possible to enter presets for the registries. So we dont have to specify it each time.

Implemented via https://github.com/portainer/portainer/pull/930


trailing bracket on ellipsis multi-line list not parsed correctly

contents of list-ellipsis-multi.cue:
a: [
    ...
    string
]

$ cue def list-ellipsis-multi.cue
a: [...string]

Error reported by intellij-cue:
a: [
    ...
    string<1
]<2

1> ']' expected
2>  expected, got ']'

Fixed for the next update.
The language specification wasn't clear about this rule, so I had (insufficient) changes in this plugin's grammar.
I fixed it in the plugin and submitted https://github.com/cuelang/cue/issues/823.


chore: update mergify branches and labels for 08-wasm backports

Description
Updates mergify backports for 08-wasm.
REMINDER:
Labels must be renamed after this PR is merged.

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

[ ] Targeted PR against correct branch (see CONTRIBUTING.md).
[ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
[ ] Code follows the module structure standards and Go style guide.
[ ] Wrote unit and integration tests.
[ ] Updated relevant documentation (docs/) or specification (x/<module>/spec/).
[ ] Added relevant godoc comments.
[ ] Provide a commit message to be used for the changelog entry in the PR description for review.
[ ] Re-reviewed Files changed in the Github PR explorer.
[ ] Review Codecov Report in the comment section below once CI passes.

I already changed this directly in main. :)


Can the model be used for Chinese STR case retrained?

Hey, I just found that you've done a really fantastic job.
Seems like it works on English, Korean & Japanese STR.
So...if I retrained the model with Chinese STR datasets(like RCTW, etc.), can it still work?
I don't know if you've tried such work. It'll be great if I could get more suggestions.

@iPrayerr
Hello,
I have not tried to re-train with different language/character sets (such as pretrained English model to Chinese model) yet.
I have usually trained from scratch and it worked with Chinese dataset.
Thus, I can't sure but I think re-training the model with Chinese STR datasets would also work.
How about change and retrain character set and last feed-forward layer which predicts characters?
Best

Have you solved the problem of training Chinese? How to train


Untangle the spaghetti

There are many widgets generated by functions and things being done more than one time in the code.
What makes it hard to understand and to fix and also leads to perceptive performance problems.
Creating this issue to help dealing with this.

[x] Separate big classes
[ ] Replace most or all widget functions for stateless or statefull widgets
[ ] Reduce repetitive actions
[ ] Clean unnecessary parts

The separate big classes point is part of the 2.2.0 release published to pub.dev .

Can you help with the item 2?
I'm a little lost in the code😅

Yes, item 2 would be quite easy for me though, a bit time consuming. As I am in a rush on other projects right now, I will have to take care of this at a later stage. Though, I am confident this will be a major gain in performance. Thanks a lot for the suggestion.


change crh feature handling

Pull Request Test Coverage Report for Build<PHONE_NUMBER>6
Details

4 of 4 (100.0%)  changed or added relevant lines in 1 file are covered.
No unchanged relevant lines lost coverage.
Overall coverage decreased (-0.006%) to 99.663%

Totals

Change from base Build<PHONE_NUMBER>4:
-0.006%

Covered Lines:
12471

Relevant Lines:
12472

💛  - Coveralls

replaced by #2511


Problem with simple mapping (recursion)

I have a  problem with define mapping between following classes:
public class Source{
public string Name{get;set;}
public string Value{get;set;}
public IList Dependants{get;set;}
}
public class Destination{
public string Name{get;set;}
public string Value{get;set;}
public IList Dependants{get;set;}
}
During compilation I get stack overflow. If I try to map instance of Source to instance of Destination without compiling the registered mappings the stack overflow is also signaled.

I found solution for mapping of such entries:
Mapper.Register<Source,Destination>()
.Ignore(dst=>dst.Dependants)
.Before((src,dst)=>dst.Dependants = Mapper.Map<Source,Destination>(src.Dependants));
I'm not sure if this is correct approach but it worked for me.

It's indeed a bug and we are going to fix it.

FIXED and will be included in 1.1 release (September the 15th)

This is not working for me, and I have the last stable version. I am gettnig this error:
"Expression of type 'System.Collections.Generic.List1[WCF.WcfService.SaleLineItem]' cannot be used for assignment to type  'System.Collections.ObjectModel.ObservableCollection1[WCF.WcfService.SaleLineItem]'"
I only want to map this element:
public class Sale
{
    public IEnumerable<SaleLine> SaleLines { get; set; }
}

To this one:
public class SaleHeaderItem
{
    public ObservableCollection<SaleLine> SaleLineList { get; set; }
}

I am doing something like this:
        Mapper.Register<Sale, SaleHeaderItem>()
            .Member(dest => dest.SalesLineList, src => src.SaleLines);
        Mapper.Register<SaleLine, SaleLineItem>();

        Mapper.Compile();

Dear fcogutierrez,
Thanks a lot for your input we didn't have before support for ObservableCollection type. I added it as enhancement to https://github.com/expressmapper/ExpressMapper/issues/39.

Thanks to you for your quickly reply!! :) @anisimovyuriy
When do you think you will upload a new release?


Step 8, missing information

Under Using NavigationUI, there's only two steps showing how to update the drawer and bottom navigation along with verifying that these menu items are shown when running the app. But, the actual implementation of the navigation from these items are missing.

Following the steps as described in the codelab still doesn't correctly allow navigation from those menu items.

I just added a bunch more material for this section based on this very valid feedback. See #37


optimized autocomplete model code for intellij idea

Description
optimized the autocomplete model code for intellij idea extension
Checklist

[x] The base branch of this PR is dev, rather than main
[x] The relevant docs, if any, have been updated or created

Hey @ubaid726 , this just looks like a few linting updates that I don't think we'd want to pull in as a standalone PR. It is also against main rather than dev, so closing this out.


added tlsauth keydir options to openvpn client

Before this pull request can be accepted you must first sign a CLA as described at https://www.pfsense.org/about-pfsense/#cla. Please read for more details.

@vpiserchia Before this pull request can be accepted you must first sign a CLA as described at https://www.pfsense.org/about-pfsense/#cla. Please read for more details

Requested changes not implemented in 7 months. PLease resubmit if still desired.


Create en-id.json

Indonesia localization

You have translated "All Fields" twice.
Once as "All Fields": "Tambah Kolom", and at the end as "All Fields":"Semua Kolom".

There's no string "Add Fields" in all of w2ui, you chould have just deleted the second "All Fields" ;)


Add Tools/new_nuttx_px_config.sh

Usage: Tools/new_nuttx_px_config.sh oldname newname
For example:
Tools/new_nuttx_px_config.sh px4nucleoF767ZI-v1 new_name-v3

@davids5 Here is your script ;).

@CarloWood
Thank you!
The CI failures are due to the parallel build and  disk - Merging
I will give this a go shortly!


Add new header for unreleased changes

This is a test.  Please ignore.

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 19.731%

Totals

Change from base Build<PHONE_NUMBER>:
0.0%

Covered Lines:
860

Relevant Lines:
3906

💛  - Coveralls


Feature request: allow redirection for a specific url

For example, I have hosted a server locally, and gave the localtunnel link to some friends.
After few days testing, moved it to some proper hosting.
It would be great if I could assign auto-redirect from localtunnel to the new server, even if it is time limited feature, say for 2 weeks.

Not within scope of what localtunnel is designed to do; it is an ephemeral service for exposing your site while doing local testing.


Reading files with float values

What would be the Tidier equivalent of this tidyverse code? The second column contains "NA", and values like 123423.6.
read_pheno <- function(col, phenofile){
       read_tsv(phenofile) |>
           select(ID = sona_id, pheno = col)
  }

Thanks @ymer. This is totally doable, but right now we don't have file read-write capabilities built into Tidier. I've been waiting to see whether it's worth trying to build this, but I'm increasingly convinced that it's worth it after playing with existing packages' APIs.
For now, we can rely on the CSV.jl package.
Here's how we would define the function:
using TidierData, CSV

function read_pheno(col, phenofile)
    @chain begin
        CSV.read(phenofile, DataFrame; missingstring = "NA")
        @select(!!col)
    end
end

And here's how we would call it. assuming that we want to select a column named x and a filename named filename. Notice that when we call the function, we refer to the column as a symbol :x. Inside of @select(), the symbol :x is converted to the bare column name x by using the bang-bang !! operator.
read_pheno(:x, filename)

Also, CSV.jl can auto-detect the delimiter, but if you wanted to be really specific, you could include the delimiter like this: CSV.read(phenofile, DataFrame; delim = '\t', missingstring = "NA").

Going to close this issue for now. Eventually, I hope to add a TidierFiles.jl package which is intended for reading and writing data to files.


Handle the case where the secret is not serialized as json

Summary of the Pull Request
What is this about?
PR Checklist

[ ] Applies to work item: #xxx
[ ] CLA signed. If not, go over here and sign the CLI.
[ ] Tests added/passed
[ ] Requires documentation to be updated
[ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

Info on Pull Request
What does this include?
Validation Steps Performed
How does someone test & validate?

Codecov Report

Merging #3223 (13aaa37) into main (a941020) will decrease coverage by 3.93%.
The diff coverage is 25.00%.

@@            Coverage Diff             @@
##             main    #3223      +/-   ##
==========================================
- Coverage   29.54%   25.62%   -3.93%
==========================================
  Files         332      152     -180
  Lines       39195    16291   -22904
==========================================
- Hits        11582     4175    -7407
+ Misses      27613    12116   -15497

Impacted Files
Coverage Δ

src/ApiService/ApiService/onefuzzlib/Secrets.cs
6.66% <0.00%> (-0.19%)
:arrow_down:

src/ApiService/Tests/OrmTest.cs
3.88% <100.00%> (ø)

... and 180 files with indirect coverage changes


[Bug] Overlapping texts on many pages

Describe the bug
On some pages the figma and github buttons are on top of the title of the page
To Reproduce
Steps to reproduce the behavior:

Go to /campaigns on mobile device
See error

Expected behavior
A clear and concise description of what you expected to happen.
Screenshots

Fixed with https://github.com/podkrepi-bg/frontend/commit/520efc26bbab8dfe582ef12950ba35b480d9ef6e


install.sh failed on Ubuntu 12.04

I got some errors while installing Torch:

Prefix set to /home/alumno/torch/install
Submodule 'exe/env' () registered for path 'exe/env'
Submodule 'exe/luajit-rocks' () registered for path 'exe/luajit-rocks'
Submodule 'exe/qtlua' () registered for path 'exe/qtlua'
Submodule 'exe/trepl' () registered for path 'exe/trepl'
Submodule 'extra/argcheck' () registered for path 'extra/argcheck'
Submodule 'extra/audio' () registered for path 'extra/audio'
Submodule 'extra/cudnn' () registered for path 'extra/cudnn'
Submodule 'extra/cunn' () registered for path 'extra/cunn'
Submodule 'extra/cunnx' () registered for path 'extra/cunnx'
Submodule 'extra/cutorch' () registered for path 'extra/cutorch'
Submodule 'extra/fftw3' () registered for path 'extra/fftw3'
Submodule 'extra/graph' () registered for path 'extra/graph'
Submodule 'extra/graphicsmagick' () registered for path 'extra/graphicsmagick'
Submodule 'extra/iTorch' () registered for path 'extra/iTorch'
Submodule 'extra/nn' () registered for path 'extra/nn'
Submodule 'extra/nngraph' () registered for path 'extra/nngraph'
Submodule 'extra/nnx' () registered for path 'extra/nnx'
Submodule 'extra/sdl2' () registered for path 'extra/sdl2'
Submodule 'extra/signal' () registered for path 'extra/signal'
Submodule 'extra/threads' () registered for path 'extra/threads'
Submodule 'pkg/cwrap' () registered for path 'pkg/cwrap'
Submodule 'pkg/dok' () registered for path 'pkg/dok'
Submodule 'pkg/gnuplot' () registered for path 'pkg/gnuplot'
Submodule 'pkg/image' () registered for path 'pkg/image'
Submodule 'pkg/optim' () registered for path 'pkg/optim'
Submodule 'pkg/paths' () registered for path 'pkg/paths'
Submodule 'pkg/qttorch' () registered for path 'pkg/qttorch'
Submodule 'pkg/sundown' () registered for path 'pkg/sundown'
Submodule 'pkg/sys' () registered for path 'pkg/sys'
Submodule 'pkg/torch' () registered for path 'pkg/torch'
Submodule 'pkg/xlua' () registered for path 'pkg/xlua'
Installing Lua version: LUAJIT21
CMakeFiles/luajit.dir/lj_vm.s.o: In function `lj_BC_POW':
buildvm_x86.dasc:(.text+0x84b): undefined reference to `lj_wrap_pow'
CMakeFiles/luajit.dir/lj_vm.s.o: In function `lj_ff_math_log':
buildvm_x86.dasc:(.text+0x269c): undefined reference to `lj_wrap_log'
CMakeFiles/luajit.dir/lj_vm.s.o: In function `lj_ff_math_log10':
buildvm_x86.dasc:(.text+0x26cb): undefined reference to `lj_wrap_log10'
CMakeFiles/luajit.dir/lj_vm.s.o: In function `lj_ff_math_exp':
buildvm_x86.dasc:(.text+0x26fa): undefined reference to `lj_wrap_exp'
CMakeFiles/luajit.dir/lj_vm.s.o: In function `lj_ff_math_sin':
buildvm_x86.dasc:(.text+0x2729): undefined reference to `lj_wrap_sin'
CMakeFiles/luajit.dir/lj_vm.s.o: In function `lj_ff_math_cos':
buildvm_x86.dasc:(.text+0x2758): undefined reference to `lj_wrap_cos'
CMakeFiles/luajit.dir/lj_vm.s.o: In function `lj_ff_math_tan':
buildvm_x86.dasc:(.text+0x2787): undefined reference to `lj_wrap_tan'
CMakeFiles/luajit.dir/lj_vm.s.o: In function `lj_ff_math_asin':
buildvm_x86.dasc:(.text+0x27b6): undefined reference to `lj_wrap_asin'
CMakeFiles/luajit.dir/lj_vm.s.o: In function `lj_ff_math_acos':
buildvm_x86.dasc:(.text+0x27e5): undefined reference to `lj_wrap_acos'
CMakeFiles/luajit.dir/lj_vm.s.o: In function `lj_ff_math_atan':
buildvm_x86.dasc:(.text+0x2814): undefined reference to `lj_wrap_atan'
CMakeFiles/luajit.dir/lj_vm.s.o: In function `lj_ff_math_sinh':
buildvm_x86.dasc:(.text+0x2843): undefined reference to `lj_wrap_sinh'
CMakeFiles/luajit.dir/lj_vm.s.o: In function `lj_ff_math_cosh':
buildvm_x86.dasc:(.text+0x2872): undefined reference to `lj_wrap_cosh'
CMakeFiles/luajit.dir/lj_vm.s.o: In function `lj_ff_math_tanh':
buildvm_x86.dasc:(.text+0x28a1): undefined reference to `lj_wrap_tanh'
CMakeFiles/luajit.dir/lj_vm.s.o: In function `lj_ff_math_pow':
buildvm_x86.dasc:(.text+0x28e5): undefined reference to `lj_wrap_pow'
CMakeFiles/luajit.dir/lj_vm.s.o: In function `lj_ff_math_atan2':
buildvm_x86.dasc:(.text+0x2929): undefined reference to `lj_wrap_atan2'
CMakeFiles/luajit.dir/lj_vm.s.o: In function `lj_ff_math_fmod':
buildvm_x86.dasc:(.text+0x296d): undefined reference to `lj_wrap_fmod'
collect2: error: ld returned 1 exit status
make[2]: *** [exe/luajit-rocks/luajit-2.1/luajit] Error 1
make[1]: *** [exe/luajit-rocks/luajit-2.1/CMakeFiles/luajit.dir/all] Error 2
make: *** [all] Error 2
Installing common Lua packages
./install.sh: línea 71: /home/alumno/torch/install/bin/luarocks: No existe el archivo o el directorio
./install.sh: línea 72: /home/alumno/torch/install/bin/luarocks: No existe el archivo o el directorio
./install.sh: línea 73: /home/alumno/torch/install/bin/luarocks: No existe el archivo o el directorio
Installing core Torch packages

Any help?

I have the same problem on Ubuntu 14.04 using torch/distro 7b7156abb266b294bdf2720d97aeab2c27e9d4ef (Nov 7, 2015) and another one (Oct 21, 2015)
I hope that install.log may be helpful
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Found readline library
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void*
-- Check size of void* - done
-- Looking for dlopen
-- Looking for dlopen - found
-- Looking for sin in m
-- Looking for sin in m - found
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Performing Test LJ_TARGET_X64
-- Performing Test LJ_TARGET_X64 - Failed
-- Performing Test LJ_TARGET_X86
-- Performing Test LJ_TARGET_X86 - Success
-- LuaJIT Target: x86
-- LuaJIT target x86
-- Performing Test LJ_ARCH_BITS_64
-- Performing Test LJ_ARCH_BITS_64 - Failed
-- Performing Test LJ_HASJIT_1
-- Performing Test LJ_HASJIT_1 - Success
-- Performing Test LJ_HASFFI_1
-- Performing Test LJ_HASFFI_1 - Success
-- Performing Test LJ_DUALNUM_1
-- Performing Test LJ_DUALNUM_1 - Failed
-- Performing Test LJ_ARCH_HASFPU_1
-- Performing Test LJ_ARCH_HASFPU_1 - Success
-- Performing Test LJ_ABI_SOFTFP_1
-- Performing Test LJ_ABI_SOFTFP_1 - Failed
-- Performing Test __SSE2___1
-- Performing Test __SSE2___1 - Failed
-- Looking for sin in m
-- Looking for sin in m - found
-- Found Wget: /usr/bin/wget
-- Found MD5: /usr/bin/md5sum
-- Configuring done
-- Generating done
-- Build files have been written to: /home/test/torch/build
Scanning dependencies of target minilua
[  3%] Building C object exe/luajit-rocks/luajit-2.1/CMakeFiles/minilua.dir/src/host/minilua.c.o
Linking C executable minilua
[  3%] Built target minilua
[  7%] Generating buildvm_arch.h
Scanning dependencies of target buildvm
[ 11%] Building C object exe/luajit-rocks/luajit-2.1/CMakeFiles/buildvm.dir/src/host/buildvm.c.o
[ 15%] Building C object exe/luajit-rocks/luajit-2.1/CMakeFiles/buildvm.dir/src/host/buildvm_asm.c.o
[ 19%] Building C object exe/luajit-rocks/luajit-2.1/CMakeFiles/buildvm.dir/src/host/buildvm_peobj.c.o
[ 23%] Building C object exe/luajit-rocks/luajit-2.1/CMakeFiles/buildvm.dir/src/host/buildvm_lib.c.o
[ 26%] Building C object exe/luajit-rocks/luajit-2.1/CMakeFiles/buildvm.dir/src/host/buildvm_fold.c.o
Linking C executable buildvm
[ 26%] Built target buildvm
[ 30%] Generating vmdef.lua
[ 34%] Generating lj_vm.s
[ 38%] Generating lj_ffdef.h
[ 42%] Generating lj_bcdef.h
[ 46%] Generating lj_libdef.h
[ 50%] Generating lj_recdef.h
[ 53%] Generating lj_folddef.h
Scanning dependencies of target libluajit
[ 57%] Building C object exe/luajit-rocks/luajit-2.1/CMakeFiles/libluajit.dir/src/ljamalg.c.o
[ 61%] Building ASM object exe/luajit-rocks/luajit-2.1/CMakeFiles/libluajit.dir/lj_vm.s.o
Linking C shared library libluajit.so
[ 61%] Built target libluajit
Scanning dependencies of target luajit
[ 65%] Building C object exe/luajit-rocks/luajit-2.1/CMakeFiles/luajit.dir/src/luajit.c.o
[ 69%] Building C object exe/luajit-rocks/luajit-2.1/CMakeFiles/luajit.dir/src/ljamalg.c.o
[ 73%] Building ASM object exe/luajit-rocks/luajit-2.1/CMakeFiles/luajit.dir/lj_vm.s.o
Linking C executable luajit

I've tryed to chage line 58 of install.sh and switch LuaJIT version checking off
cmake .. -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DCMAKE_BUILD_TYPE=Release -DWITH_${TORCH_LUA_VERSION}=OFF 2>&1 >>$PREFIX/install.log || exit 1

And installation was completed successfully. But LuaJIT version is:
luajit -v
LuaJIT 2.0.4 -- Copyright (C) 2005-2015 Mike Pall. http://luajit.org/

Another solution I found here is run ./install command with LUA version like this
TORCH_LUA_VERSION=LUA52 ./install.sh

after @soumith's suggestion the above command also works with intel compilers


didDismissWithButtonIndex ?

It would be awesome if IBActionSheet supported didDismissWithButtonIndex, clickedButtonAtIndex produces an event too soon for me.

Thanks for the suggestion, I will look into adding the following to IBActionSheet when time permits:
- (void)actionSheet:(IBActionSheet *)actionSheet willDismissWithButtonIndex:(NSInteger)buttonIndex;
- (void)actionSheet:(IBActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex;

@Jules2010 @ianb821 Just opened up a PR for this.

This has been added via a PR from @robtimp.


better mention attachment

Current version only can append mention to end of message text.
What about sending a format array to format?
ex)
let mention = new ChatMention(chat.Sender);
let mentionContent = ['안녕하세요 ', mention, '님!'];
chat.Channel.sendTemplate(new AttachmentTemplate(MentionAttachment.fromArray(mentionContent ));

Use destructuring instead.

Also you can append ChatMention to AttachmentTemplate


[misc] typings: creator arg are readonly

Stricter typing outlining that obviously moment won't mutate the params passed to the creator. (I hope!)
Maybe a few more Readonly could be added here and there but I'm not an expert. Feel free to edit this PR.

@Offirmo fixing typescript definitions line by line is a (maintenance) disaster. If you want this merged -- look through the API and add it in all necessary places. If you're unsure if the input is changed (most of the time it shouldn't be) look in the code.

@ichernev I'm not sure I understand, sorry. "look through the API and add it in all necessary places" Do you mean there is another file to modify which generates the typings?

So you're saying in the whole of moment, the only 3 things that are read-only arguments are these? Also is this TS1.x compliant?

Ok I got it. No worries mate!


Allows client instrumentation to avoid thread local scoping

This allows async instrumentation to avoid any use of thread-local current trace context between callbacks.
The motivation for this was reactor-netty WebClient which needs to carry the subscription trace context to the request hook. Before this change, the code implied a threadlocal access (sometimes some other scope access) which was unnecessary and expensive.
It may not be obvious why this saves overhead. Mainly, folks hang things like log context synchronization on top of the scoping api. The more times a context is synced in tracing, the more times anything that hangs off it is synced. The total overhead is a sum of all those things, not just the threadlocal part.
Here's the jist of what this allows:
class MyFilter extends Filter {

  public void onSchedule(Attributes attributes) {
    // Stash the invoking trace context as this will be the correct parent of
    // the request.
    attributes.put(TraceContext.class, currentTraceContext.get());
  }

  public void onStart(Request request, Attributes attributes) {
    // Retrieve the parent, if any, and start the span.
    TraceContext parent = attributes.get(TraceContext.class);
    Span span = tracer.nextSpanWithParent(samplerFunction, request, parent);

This tidies up okhttp and apache async client.. lowering overhead a bit.
Fixes #1082

thanks @anuraaga!


Do not hardcode #!/bin/bash in shell scripts

Related to the BSD porting efforts ongoing in https://github.com/dart-lang/sdk/issues/10260.
BSD systems don't place bash in /bin and a lot of the dart tools hardcode a #!/bin/bash shebang that fails the 'all' target build (not able to execute dart2js since the interpreter is not found).
I would like to replace those paths with #!/usr/bin/env bash which should work on Linux, Mac OS X & all BSD's.
Places with a hardcoded shebang are as follows:
$ git grep /bin/bash
pkg/analysis_server/tool/spec/generate_files:#!/bin/bash
pkg/analyzer/tool/generate_files:#!/bin/bash
runtime/tools/bmu_benchmark_gallery.sh:#!/bin/bash
sdk/bin/dart:#!/bin/bash
sdk/bin/dart2js:#!/bin/bash
sdk/bin/dart2js_developer:#!/bin/bash
sdk/bin/dart2js_sdk:#!/bin/bash
sdk/bin/dartanalyzer:#!/bin/bash
sdk/bin/dartanalyzer_developer:#!/bin/bash
sdk/bin/dartanalyzer_sdk:#!/bin/bash
sdk/bin/dartdoc:#!/bin/bash
sdk/bin/dartfmt:#!/bin/bash
sdk/bin/dartfmt_sdk:#!/bin/bash
sdk/bin/pub:#!/bin/bash
sdk/bin/pub_sdk:#!/bin/bash
site/try/create_manifest.sh:#!/bin/bash
tests/standalone/io/create_sample_certificates.sh:#!/bin/bash
tests/standalone/io/dart_std_io_pipe_test.sh:#! /bin/bash
tools/apps/update_homebrew/bin/ssh_with_key:#!/bin/bash
tools/apps/update_homebrew/bin/update_homebrew.dart:      #!/bin/bash
tools/bots/run_android_tests.sh:#!/bin/bash
tools/create_debian_chroot.sh:#!/bin/bash
tools/dartium/download_shellscript_template.sh:#!/bin/bash
tools/dartium/start_dartium_roll.sh:#!/bin/bash -e
tools/dom/scripts/go.sh:#!/bin/bash -x
tools/precompilation/test_linux.sh:#!/bin/bash -ex
tools/precompilation/test_linux_simarm.sh:#!/bin/bash -ex
tools/precompilation/test_macos.sh:#!/bin/bash -ex
tools/presubmit.sh:#!/bin/bash
tools/testing/bin/jsshell:#!/bin/bash

Indeed, it would be nice if this could be merged. Using #!/usr/bin/env bash is the correct way to get the scripts to work on all the mentioned platforms.
I can confirm it works well this way on Mac OS X.

Think github didn't link this properly.


css returns an object not a string so memoized components always re-render

Bug report
Describe the bug
const c = css({...}), calling c() returns an object not a string so memoized components re-render. Also this hurts React's internal performance optimizations on intrinsic elements, e.g.
...

Setting className={String(c())} fixes the issue. So does turning css into an IIFE outside of a component like const c = (css({...}))() and then className={c}, assuming the object is treated as immutable by Stitches. But I don't think these work arounds should be necessary.
To Reproduce
https://codesandbox.io/s/stitches-react-css-object-bug-drsx0
Expected behavior
const c = css({...}), calling c() should return a string.
EDIT: an alternative would be for Stitches to memoize the object that's returned (so the return value of c() is referentially equivalent), but my preference would be for a string.
System information

Version of Stitches: 0.1.7

A component created with css() returns an object by design. An alternative resolution might be to memoize the resulting object.
The css() function will always return an object, because the object has more than its own classNames string.
For instance, a css() component forwards any of its props not swallowed by variants. If we wrote something like expression = component({ type: 'button', color: 'red' }), where component had a color variant, then our expression.props would be a the fall-thru object of { type: 'button' }.
This is very useful in applications where you’re assigning more than the class name to an element. Here’s an example.
const $buttonElement = Object.assign(
  document.createElement('button'),
  c({ type: 'button', color: 'red' })
)

Hi @jonathantneal, thanks for the explanation, I think I understand a bit better what's going on. I think for the narrow use case of "A function to generate class names from a style object" (quote from docs), it may make sense to wrap the super powerful css() function instead of exposing it directly. This would solve this issue and would probably make for a better TS experience as well.
Regarding the above use case to create a $buttonElement, I don't think it is relevant to a React package. I personally can't think of why I'd need to use the css() function like that when using React. The super powerful css() function, which is used internally by the styled() function, can still be exported from the core package for such use cases (perhaps under a different name, maybe something like createComposition(), see note below).

As a side note, I've found it confusing to have the word "component" refer to both React components and Stitches components, which are two very different things (something I only just realized). In the @stitches/react code, a Stitches component is called a composition, which may be a better name to use in the core package as well to avoid confusion, especially among open source contributors who may not be familiar with inner workings of Stitches. I only just now realized that the word "component" in this comment refers to a Stitches component and not a React component. It may also make sense to rename the sheet.css() function to something like createComposition() to make it clear what it's doing. Any thoughts on this @peduarte?

Here's how exporting a wrapped version could potentially work, and I think it could provide a better TS experience as well:
// note that in this code I renamed the current sheet.css function
// to createComposition, the functionality remains unchanged
export const css = (styleObject) => {
  const composition = createComposition(styleObject) // currently sheet.css

  // the function that's returned from css() should be typed to only
  // accept an object with known variant key value pairs from the composition,
  // as well as a `css` key to add additional styles
  // (the same as the `css` prop that can be passed to a styled React component),
  // it should NOT accept any random key/values like `composition(...)` does
  return (activeVariantsAndCssObject: CompositionVariantsAndCss) => String(composition(activeVariantsObject))
}

Also, just a note about TS, which I know isn't something that's going be addressed for a little bit. I think the current type assigned to the expression of StyledExpression & string is not correct and can lead to not type safe code. The expression is an object, and shouldn't be typed as a string (I'm guessing it is typed this way so an expression can be passed to the React className prop, which only accepts the string type).
String methods cannot be run on the expression, for example, expression.indexOf('foo') doesn't work. However, with the current typing of StyledExpression & string, TypeScript thinks it is fine to do expression.indexOf('foo') even though it results in a runtime error.

Now that we’ve firmly decided not to support props, it might be in line with Stitches to stop letting them slip thru, which would mean components could return true class name strings. Do I correctly infer from your comments here and in #687 that you are open to this? Note that if we decided to use regular strings, it would mean prop forwarding (at least in React) would be lost, and thus any spread usage when using styled components. And if we decided not to use regular strings, then these would become #wontfix type issues.

Making it a string sounds good.


Update Intro with Repo-Signatures

Minor changes to mention repo-signatures in Signatures Reference

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/reference/Signed-Packages-Reference.md
:white_check_mark:Succeeded
View

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.


Build command incorrectly handles dependencies

E:\workspace\vcpkg> vcpkg list
boost:x86-windows-static    1.62-2           Peer-reviewed portable C++ source libraries
cpprestsdk:x86-windows-static 2.9.0-1          C++11 JSON, REST, and OAuth library The C++ RES...
openssl:x86-windows-static  1.0.2j           OpenSSL is an open source project that provides a...
zlib:x86-windows-static     1.2.8            A compression library
E:\workspace\vcpkg> vcpkg build cpprestsdk:x86-windows-static
The build command requires all dependencies to be already installed.
The following dependencies are missing:
zlib:x86-windows-static
boost:x86-windows-static
openssl:x86-windows-static

Does they need to be installed automatically when you run the build command?

The install command will handle dependencies automatically and you can specify multiple arguments.
The build command is internal/undocumented, so the current intention was to have all dependencies installed before you run build, and there is a verification for it. Also build only allows 1 package to be specified.
This is because, if (for example) you request for cpprestsdk which depends on zlib, boost, openssl, then install will result in:
zlib = installed
openssl= = installed
boost = installed
cpprestsdk = installed
and build would result in:
zlib = installed
openssl= = installed
boost = installed
cpprestsdk = built but not installed
This feels a bit unexpected. This is further complicated if you do something like:
vcpkg build cpprestsdk zlib
(Should zlib be installed or not?).
Regarding the current bug: Fixed with 2584f3e3def7f09bc373117985013ac019aa76d6


Lily/Hitboxes: Add Hitboxes extension.

A small extension for setting the hitboxes of targets.

I might put this on the gallery if/when I add a few more blocks.

FINALLY


[Question]:  I am trying to Use GeoCoding for Converting Longitude & latitude to It's corresponding Address but getting an error :  I/flutter ( 5989): Error: MissingPluginException(No implementation found for method placemarkFromCoordinates on channel flutter.baseflow.com/geocoding)

Please check the following before submitting a new issue.

[X] I have searched the existing issues.
[X] I have carefully read the documentation.

Please select for which platform(s) you need help

[X] Android
[ ] iOS

Your question

Code file :
import 'package:flutter/material.dart';
import 'package:geocoding/geocoding.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: ConvertLatLngToAddress(),
    );
  }
}

class ConvertLatLngToAddress extends StatefulWidget {
  @override
  _ConvertLatLngToAddressState createState() => _ConvertLatLngToAddressState();
}

class _ConvertLatLngToAddressState extends State<ConvertLatLngToAddress> {
  double latitude = 33.6992;
  double longitude = 72.9744;
  String address = '';

  void _convertCoordinatesToAddress() async {
    try {
      List<Placemark> placemarks =
      await placemarkFromCoordinates(latitude, longitude);
      if (placemarks != null && placemarks.isNotEmpty) {
        Placemark placemark = placemarks[0];
        setState(() {
          address =
          '${placemark.street}, ${placemark.locality}, ${placemark.administrativeArea}, ${placemark.country}';
        });
      }
    } catch (e) {
      print('Error: $e');
      setState(() {
        address = 'Error converting coordinates to address';
      });
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Convert Coordinates to Address'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            Text('Latitude: $latitude'),
            Text('Longitude: $longitude'),
            ElevatedButton(
              onPressed: _convertCoordinatesToAddress,
              child: Text('Convert to Address'),
            ),
            SizedBox(height: 20.0),
            Text(
              'Address: $address',
              style: TextStyle(fontSize: 18.0),
            ),
          ],
        ),
      ),
    );
  }
}

Version
geocoding: ^2.1.0

If you found any Solution please let me know because I need to present this in College !! So ASAP...

@desaimann37, I have copied the provided code in a new Flutter application and tested it on a Pixel 7a without any issues. Meaning I am unable to reproduce the problem.
It is possible that something is wrong with the version of the geocoding plugin that are cached locally on your machine. Try running the following commands to make sure everything is up to date:
# Clean earlier build outputs and files cached during the build process.
flutter clean
# Download the latest versions of all dependencies.
flutter pub upgrade

If this doesn't work for you please provide the contents of the pubspec.lock file and the output of the flutter doctor -v command.

I also got this kind of error message from geolocator on IOS.
flutter: MissingPluginException(No implementation found for method placemarkFromCoordinates on channel flutter.baseflow.com/geocoding)
Is there any soluction for this? Below is my code
Position position = await Geolocator.getCurrentPosition(
desiredAccuracy: LocationAccuracy.high);
List placeMarks = [];
try{
// Get placemarks from coordinates
List placeMarks = await placemarkFromCoordinates(
position.latitude, position.longitude);
} catch(Exception) {
print(Exception);
}

I solved this issued on IOS , I rerun flutter clean and flutter pub get and also pod update . This is no longer exception.


pushMiddlewareToGroup not working on Provider in My Package

Laravel Version: 9.8.1
PHP Version: 8.0.5
Database Driver & Version: mariadb

Description:
In continuation of bug https://github.com/laravel/framework/issues/36604. I found the reason for this bug.
We want to dynamically connect Middleware in our package in the Service Provider:
public function boot(Router $router)
{
    // Push middleware to web group
    $router->pushMiddlewareToGroup('web', MyMiddleware::class);
}

But the Middleware is not executed if the package name starts with the letters a-k.
Reason:
In the /Illuminate/Foundation/Http/Kernel.php file, the syncMiddlewareToRouter method overwrites the Middleware list in the Router
protected function syncMiddlewareToRouter()
{
    $this->router->middlewarePriority = $this->middlewarePriority;

    foreach ($this->middlewareGroups as $key => $middleware) {
        $this->router->middlewareGroup($key, $middleware);
    }

    foreach ($this->routeMiddleware as $key => $middleware) {
        $this->router->aliasMiddleware($key, $middleware);
    }
}

In the /Illuminate/Routing/Router.php file the middlewareGroup method
public function middlewareGroup($name, array $middleware)
{
    $this->middlewareGroups[$name] = $middleware;

    return $this;
}

The syncMiddlewareToRouter method is called in prependToMiddlewarePriority which calls /var/www/admin/laravel/sanctum/src/SanctumServiceProvider.php after my ServiceProvider
Service providers are named in alphabetical order. If the package name starts with letters a-k Middleware Group is overwritten. If the package name begins with the letters m-z, everything works.
Solution:
If rewriting the middleware group is not required, then you can change the middlewareGroup method in /Illuminate/Routing/Router.php
public function middlewareGroup($name, array $middlewares)
{
    foreach ($middlewares as $middleware)
        $this->pushMiddlewareToGroup($name, $middleware);

    return $this;
}

Please add to the framework if I'm right.

I don't think this is considered normal usage. If you want to change anything please provide a PR implementation with a test case.


Function prototypes should be resolved before function bodies

Declaring mutually dependent functions will currently result in an error, presumably due to the body of fn_a being resolved before fn_b is resolved and added to the global symbol table.
func fn_a() void {
    fn_b();
}
func fn_b() void {
    fn_a();
}

[order-independent-top-level-declarations.nova:2] error: use of undeclared identifier `fn_b`

Fixed in 862a9ab1d799654db957f776ca49c3df708f9e57.


chore refactor some rf code and delete rpc file

Proposed changes
Issue Number: close #xxx

Further comments
If this is a relatively large or complex change, kick off the discussion at<EMAIL_ADDRESS>by explaining why you chose the solution you did and what alternatives you considered, etc...

run buildall

run buildall


error occurred while calling export GetDiscordRoles in resource Badger_Discord_API

[script:DiscordAcePer] SCRIPT ERROR: @DiscordAcePerms/server.lua:150:
[script:DiscordAcePer]  An error occurred while calling export `GetDiscordRoles` in resource `Badger_Discord_API`:
[script:DiscordAcePer]   citizen:/scripting/lua/scheduler.lua:749: SCRIPT ERROR: @Badger_Discord_API/server.lua:435: bad argument #1 to 'pairs' (table expected, got boolean)
[script:DiscordAcePer]   > ref (@Badger_Discord_API/server.lua:435)
[script:DiscordAcePer]
[script:DiscordAcePer]  ---
[script:DiscordAcePer] > RegisterPermissions (@DiscordAcePerms/server.lua:150)
[script:DiscordAcePer] > handler (@DiscordAcePerms/server.lua:205)

This happens every time someone joins. Not sure why? My Badger_Discord_API is updated to the latest version.

Is there an error similar to this above that error in the console?
"[Badger_Discord_API] ERROR: Code 200 was not reached... Returning false. [Member Data NOT FOUND] DETAILS: ....."
If so please post the full error.

Currently turned off Debugging as it was throwing that a lot as well.
I just checked someone, they are in the Discord but they don't yet have any roles.
Assuming its because of that? Is there a way we can just suppress the errors then.

Is there a way to disable the print errors in console or should i just comment out the prints
It seems tk occur every time someone is not in the discord


KOGITO-9671 CI: Remove bot account usage

https://issues.redhat.com/browse/KOGITO-9671

Description of the change:
Motivation for the change:
Checklist

[ ] Add or Modify a unit test for your change
[ ] Have you verified that tall the tests are passing?

How to backport a pull request to a different branch?

In order to automatically create a backporting pull request please add one or more labels having the following format backport-<branch-name>, where <branch-name> is the name of the branch where the pull request must be backported to (e.g., backport-7.67.x to backport the original PR to the 7.67.x branch).

NOTE: backporting is an action aiming to move a change (usually a commit) from a branch (usually the main one) to another one, which is generally referring to a still maintained release branch. Keeping it simple: it is about to move a specific change or a set of them from one branch to another.

Once the original pull request is successfully merged, the automated action will create one backporting pull request per each label (with the previous format) that has been added.
If something goes wrong, the author will be notified and at this point a manual backporting is needed.

NOTE: this automated backporting is triggered whenever a pull request on main branch is labeled or closed, but both conditions must be satisfied to get the new PR created.

Openshift tests job #354 was: ABORTED
Possible explanation: Most probably a timeout, please review
Please look here: https://jenkins-kogito-tools.kogito-cluster-0ad6762cc85bcef5745bb684498c2436-0000.us-south.containers.appdomain.cloud/job/kogito/job/kogito-serverless-operator-PR-check/354/display/redirect
See console log:

Console Logs
2023-08-02 13:38:47,942 resource.py:394        DEBUG Copying repository from '/home/jenkins/agent/workspace/kogito/kogito-serverless-operator-PR-check/target/repo/modules/org.kie.kogito.goModDownload/../../../../go.sum' to 'target/image/go.sum'.2023-08-02 13:38:47,942 resource.py:225        INFO  Copying resource 'api'...2023-08-02 13:38:47,942 resource.py:394        DEBUG Copying repository from '/home/jenkins/agent/workspace/kogito/kogito-serverless-operator-PR-check/target/repo/modules/org.kie.kogito.goModDownload/../../../../api' to 'target/image/api'.2023-08-02 13:38:47,945 resource.py:225        INFO  Copying resource 'workflowproj'...2023-08-02 13:38:47,945 resource.py:394        DEBUG Copying repository from '/home/jenkins/agent/workspace/kogito/kogito-serverless-operator-PR-check/target/repo/modules/org.kie.kogito.goModDownload/../../../../workflowproj' to 'target/image/workflowproj'.2023-08-02 13:38:47,948 resource.py:225        INFO  Copying resource 'container-builder'...2023-08-02 13:38:47,948 resource.py:394        DEBUG Copying repository from '/home/jenkins/agent/workspace/kogito/kogito-serverless-operator-PR-check/target/repo/modules/org.kie.kogito.goModDownload/../../../../container-builder' to 'target/image/container-builder'.2023-08-02 13:38:47,979 resource.py:225        INFO  Copying resource 'main'...2023-08-02 13:38:47,979 resource.py:394        DEBUG Copying repository from '/home/jenkins/agent/workspace/kogito/kogito-serverless-operator-PR-check/target/repo/modules/org.kie.kogito.app.builder/../../../../main.go' to 'target/image/main.go'.2023-08-02 13:38:47,979 resource.py:225        INFO  Copying resource 'controllers'...2023-08-02 13:38:47,979 resource.py:394        DEBUG Copying repository from '/home/jenkins/agent/workspace/kogito/kogito-serverless-operator-PR-check/target/repo/modules/org.kie.kogito.app.builder/../../../../controllers' to 'target/image/controllers'.2023-08-02 13:38:47,986 resource.py:225        INFO  Copying resource 'version'...2023-08-02 13:38:47,986 resource.py:394        DEBUG Copying repository from '/home/jenkins/agent/workspace/kogito/kogito-serverless-operator-PR-check/target/repo/modules/org.kie.kogito.app.builder/../../../../version' to 'target/image/version'.2023-08-02 13:38:47,987 resource.py:225        INFO  Copying resource 'utils'...2023-08-02 13:38:47,987 resource.py:394        DEBUG Copying repository from '/home/jenkins/agent/workspace/kogito/kogito-serverless-operator-PR-check/target/repo/modules/org.kie.kogito.app.builder/../../../../utils' to 'target/image/utils'.2023-08-02 13:38:47,990 resource.py:225        INFO  Copying resource 'log'...2023-08-02 13:38:47,990 resource.py:394        DEBUG Copying repository from '/home/jenkins/agent/workspace/kogito/kogito-serverless-operator-PR-check/target/repo/modules/org.kie.kogito.app.builder/../../../../log' to 'target/image/log'.2023-08-02 13:38:47,991 docker.py:38         DEBUG Artifacts handled2023-08-02 13:38:47,995 base.py:375        INFO  Rendering Containerfile...Aborted by unknownSending interrupt signal to processmake: *** [Makefile:186: container-build] Terminatedscript returned exit code 2[Pipeline] }[Pipeline] // withEnv[Pipeline] }[Pipeline] // stage[Pipeline] stage[Pipeline] { (Push image to Openshift Registry)Stage "Push image to Openshift Registry" skipped due to earlier failure(s)[Pipeline] }[Pipeline] // stage[Pipeline] stage[Pipeline] { (Run e2e tests)Stage "Run e2e tests" skipped due to earlier failure(s)[Pipeline] stage[Pipeline] { (Running e2e tests)Stage "Run e2e tests" skipped due to earlier failure(s)[Pipeline] }[Pipeline] // stage[Pipeline] }[Pipeline] // stage[Pipeline] stage[Pipeline] { (Declarative: Post Actions)[Pipeline] script[Pipeline] {[Pipeline] sh+ wget --no-check-certificate -qO - https://jenkins-kogito-tools.kogito-cluster-0ad6762cc85bcef5745bb684498c2436-0000.us-south.containers.appdomain.cloud/job/kogito/job/kogito-serverless-operator-PR-check/354/api/json[Pipeline] readJSON[Pipeline] sh


Question about Training Custom Point Cloud Dataset

Hello, thank you very much for sharing your work. I would like to use your network to train my own dataset. How should I set it up and operate it? My dataset is a point cloud dataset similar in format to SemanticKITTI.
Thank you very much for your help.

Then, I think you can refer our dataset for SemanticKITTI.