WISBLOCK API PROGRAMMING PROBLEM PLATFORMIO

Hello, I have problem with programming RAK 4631 RUI3 (I updated firmware using USB), now I’m working at low energy consume project and I want to use WisBlock API to have ~40uA current consumption during sleep time. Proglem is that my RAK don’t want to update program using PlatformIO, it work fine when I use ArduinoIDE, but using Arduino IDE I have error with compilation : Error compiling for board 4631 (when I choose RUI board) and when I choose nRF board it is problem problem similiar to my problem with PlatformIO. terminal says that board is not in DFU mode and uploading is failed.
In PlatformIO program compile good beut it’s not possible to upload, i tried ground TX and GND pin many times and it not working. I also tried to upgrade firmware to my custom made by platformio via BLE usinsg WisBlock toolbox and it’s also fail during update. I don’t know what’s wrong with my boards. Do you have any ideas?

WisBlock API is for the open source RAK4631 BSP, not for RUI3.

To use PlatformIO, we have the Installation of Board Support Package in PlatformIO guide how to patch the Nordic nRF52 BSP to enable the RAK4631/RAK4630.

Potential problems when it refuses to flash:

  • Your RAK4631 is flashed with the RUI3 bootloader. Check Converting RAK4631-R to RAK4631 how to flash the open source Arduino bootloader
  • Try to double click reset to force the device into bootloader mode (works only with the Arduino bootloader, doesn’t work with the RUI3 bootloader)

OK, thanks but now I have problem after trying to convert rak 4631-R to RAK4631. When I connect RAK to USB Its open folder with u2f data. It looks like after double click reset and Green LED is allways on. I can see board in port manager but I can’t write program into memory.

If the device shows up as UF2 drive, then you have successfully flashed the Arduino bootloader.

What error do you get in Arduino IDE when you try to flash an application?
Now that you have Arduino Bootloader, make sure you are using the correct module, not the RUI3 module in Arduino IDE

Error says that board is not connected

But it is not most important problem now. I supossed it’s bricked Core board.
Now I decided to use one RAK4630 with Arduino bootloader from my working project.
My main task is reducing power consumption like it says around 30- 40 uA and I allways have about 1,2 mA in sleep mode. No matter what source code I test. I suggested this topic and I have much bigger power consumption. What could by caused by? My region is EU868.

About the power consumption

  • if using LoRaWAN, has the device connected to the LoRaWAN server?
  • if using LoRa P2P, is the device in RX mode?
  • if not using LoRa or LoRaWAN, make sure to initialize the LoRa transceiver and then set it into sleep mode with:
api_init_lora();
Radio.Sleep();
  • Do you have any external sensors connected?

For the download problem, obviously ArduinoIDE detects the device.

Any other application running that might occupy the port? I experienced e.g. that Ultimaker Cura is occupying all COM ports it can find, hoping it finds a 3D printer connected to it.

I use LoRaWAN and device is connected to Chirpstack and send payload every 2 minutes.
Now I tested it without sensor and sleep current is about 30uA. Is any solution to turn off I2C bus sequently to reduce consumption caused by sensor?

I will check one more time at another computer that port occupation.

Thank you very much, for answers.

Two potential options to shut down the sensor and I2C

#1 switch off 3.3V

On WisBlock Base we have two 3.3V supply lines.

3V3 is permanent supplying
3V3_S can be switched on and off by using WB_IO2 (HIGH => 3V3_S on)

Not sure what sensors you are using, you have to check the datasheets.

#2 Wire.end()

You can use Wire.end() to shut down the I2C and then manually de-initialize the GPIO’s usd as SCL and SDA. I am not 100% sure if Wire.end() does that already.