AB-01 V2 RGB led indicator

simple code doesn’t work on AB-01 V2 (v2.2 on PCB - version with etched label on cap) - onboard LED just keeps in off state:

#include "LoRaWan_APP.h"

#ifndef LoraWan_RGB    #line 3
#define LoraWan_RGB 1  #line 4
#endif                 #line 5

void setup()
{

}
void loop() {
  turnOnRGB(0x500000,100);
  delay(1000);  
  turnOffRGB();
  delay(1000);  
}

but it works on AB-01 V1.2! moreover - it works even if I set LoraWan_RGB 0
or even if I comment lines 3,4 and 5.
it also works if I change first line to #include "LoRa_APP.h"

this code has been checked for both board version with Arduino IDE ( Heltec CubeCell (ASR650X) Arduino Support V1.5.0)
and PlatformIO ( latest platform - Heltec CubeCell v 1.1.0 which the same release V1.6.0 - https://github.com/HelTecAutomation/CubeCell-Arduino/releases/tag/V1.6.0)

but for example, this code - works on both boards with both IDE:

#include "CubeCell_NeoPixel.h"

CubeCell_NeoPixel pixels(1, RGB, NEO_GRB + NEO_KHZ800);

void setup() {
// put your setup code here, to run once:
pinMode(Vext,OUTPUT);
digitalWrite(Vext,LOW); //SET POWER
pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
pixels.clear(); // Set all pixel colors to ‘off’
}

void loop() {
pixels.setPixelColor(0, pixels.Color(255, 0, 0));
pixels.show(); // Send the updated pixel colors to the hardware.
delay(500); // Pause before next pass through loop

pixels.setPixelColor(0, pixels.Color(0, 0, 0));
pixels.show(); // Send the updated pixel colors to the hardware.
delay(500); // Pause before next pass through loop
}

I dont understand - why it is?

second code just pretty the same code which is executed if I include LoRaWan_APP.h and run turnOnRGB

Vext must be set low for the led to work. Thats the significant difference in the example. Trust me an also screamed at my board for not working until I found this. The same is true for some i2c devices to work or atleast was the case for me.

if I add veext low is still doesnt work:

#include "LoRaWan_APP.h"

#ifndef LoraWan_RGB    #line 3
#define LoraWan_RGB 1  #line 4
#endif                 #line 5

void setup()
{
  pinMode(Vext,OUTPUT);
  digitalWrite(Vext,LOW); //SET POWER
}
void loop() {
  
  pinMode(Vext,OUTPUT);
  digitalWrite(Vext,LOW); //SET POWER

  turnOnRGB(0x500000,100);
  delay(1000);  
  turnOffRGB();
  delay(1000);  
}

moreover I found out that if I use second example code which works for both boards but move codeh code for LED in the setup() - it also doesnt work:

#include "CubeCell_NeoPixel.h"
CubeCell_NeoPixel pixels(1, RGB, NEO_GRB + NEO_KHZ800);

void setup() {

// put your setup code here, to run once:
pinMode(Vext,OUTPUT);
digitalWrite(Vext,LOW); //SET POWER

pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
pixels.clear(); // Set all pixel colors to ‘off’

pixels.setPixelColor(0, pixels.Color(255, 0, 0));
pixels.show(); // Send the updated pixel colors to the hardware.
delay(500); // Pause before next pass through loop

pixels.setPixelColor(0, pixels.Color(0, 0, 0));
pixels.show(); // Send the updated pixel colors to the hardware.
delay(500); // Pause before next pass through loop

}

void loop() {

// pixels.setPixelColor(0, pixels.Color(255, 0, 0));
// pixels.show(); // Send the updated pixel colors to the hardware.
// delay(500); // Pause before next pass through loop

// pixels.setPixelColor(0, pixels.Color(0, 0, 0));
// pixels.show(); // Send the updated pixel colors to the hardware.
// delay(500); // Pause before next pass through loop

}

it works ONLY with code in the loop()

can someone explain what the issue with this LED and how to correctly use it on the ver.2.2 boards?

any answer from support?
do you need more details about issue?
I spent hours to check different versions of code - I totally cant use LED in the setup() on ab01 v2.2
but some code works on v1.2 boards.

ok some “dirty hack” and seems it works on both boards:

#include "LoRaWan_APP.h"
//#include "LoRa_APP.h"

// #ifndef LoraWan_RGB
// #define LoraWan_RGB 1
// #endif

void setup()

{

  pinMode(Vext,OUTPUT);
  digitalWrite(Vext,LOW); //SET POWER
  delay(100);  
  turnOnRGB(0x500000,100); delay(50);  
  turnOffRGB();

  pinMode(Vext,OUTPUT);
  digitalWrite(Vext,LOW); //SET POWER
  delay(100);  
  turnOnRGB(0x500000,100); delay(50);  
  turnOffRGB();

  pinMode(Vext,OUTPUT);
  digitalWrite(Vext,LOW); //SET POWER
  delay(100);  
  turnOnRGB(0x500000,100); delay(50);  
  turnOffRGB();

}

void loop() {

// pinMode(Vext,OUTPUT);
// digitalWrite(Vext,LOW); //SET POWER
// delay(1000);  
//  turnOnRGB(0x500000,1000); delay(1000);  
//   turnOffRGB();

}

3 red blinks, but sometime color is green (!!)
also strange that there no difference is I set
LoraWan_RGB 1
or
LoraWan_RGB 0

Dude, it’s Saturday/Sunday…

That is because this definition is meant to enable LoRaWAN feedback through the LED. No surprise that it doesn’t do anything given that you don’t use LoRaWAN in your code.

And the Cubecell boards are less and less used since they are pretty old at this point. So there are few that have the knowledge to comment on them. Let alone during the weekend…

1 Like

but Cubecell’s very good with low power consumption.
Which Heltec devices can be similar in this aspect?
WiFi LoRa 32(V3) based on ESP32 consumes around 20uA which is pretty much

The V3 series go down to about 13uA ~ 18uA depending on board/series. Not sure about the nRF series, I haven’t tested those, I don’t have a dev board yet. Per Heltec, it’s listed for 11uA.
So looks like within Heltec, the Cubecell have the lowest power consumption. But if low power consumption is the main priority, there’s always the STM32WLE5. Otherwise you could try an nRF52840 board such as the T114.

nRF52 is in the same ballpark as STM32WL at ~2uA.

For BLE advertising of sensor data, the nRF52 can run on a coin cell for around a year - it’s a BLE first MCU based on ARM so heavily optimised in that area.

I think you’ll find that that second example works OK if you include a delay between those first two statements, the .begin and .clear, and the .show like:

  pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
  pixels.clear(); // Set all pixel colors to 'off'

  delay(500); // Pause before trying to light the NeoPixel

  pixels.setPixelColor(0, pixels.Color(32, 0, 0));
  pixels.show();   // Send the updated pixel colors to the hardware.

I don’t know how short a delay you can get away with, but without a delay, I don’t see the NeoPixel light either.

You would probably have noticed this if you’d included all the code from the loop in the setup() area—without the delay, you miss the red cycle, but you catch the green and blue OK, which provides the hint that might have allowed you to solve this particular problem.

Also, as @bns suggests, you need to be aware that Heltec uses the NeoPixel, and also the onboard display on boards where this is relevant, within its LoRaWAN library. You would think that just including the LoRaWan_APP (or LoRa_APP) library shouldn’t be a problem but, in the past, I’ve encountered conflicting definitions [within my code] that have arisen when simply including one of these the libraries. I do believe that the conflicts I encountered have been resolved in the current software, but the fact remains that the Heltec code uses these hardware elements [the NeoPixel and display] within their LoRaWan_APP library and this can have consequences if you are also trying to use these hardware elements for some other purpose at the same time.

1 Like

I believe we are d00med until we get context - what is it that the OP is trying to achieve, not trying to do.

1 Like

sorry for continue offtopic but…
which “STM32WLE5” can be considered if I need LoRa, 2 ADC and 4-6 GPIO?
is there something like Cubecell size but with better low power specs?

It’s a bit odd that you :heart:'d my comment above without any response.

What’s the point of us answering? Leaving aside the whole parametric search that ST provides that would allow you to choose yourself from the variations of the module. But if we have no idea if the recommendation will be suitable for your application which will only result in you not making progress which is an essential element of building on success.

Can you code STM32? Some similarities with Arduino’s style of C, but far more detailed in how you setup things - no “analogRead(A2)”, instead you need a half dozen lines of code to initialise the peripheral and take a reading, all documented & lots of examples, but not particularly conducive to code mashing until it works.

thank you for your answer.

idk. its up to you)
this is public place and usually someone asks and someone answers.
but unfortunately this is how forums works - when you asks straight questions, your questions keeps without answers but you receive a lot of advices “how to do it in better way” )

but this is “my bad” - I have asked in wrong thread - total offtopic. sorry.

I have answered this question here several times)
probably this is more detailed - HTCC-AB01 pinout in datasheet

anyway, regarding STM32WLE5 I already found something like this:

Xiao ESP32S3 + LoRa module…

https://pt.aliexpress.com/item/1005008094638318.html?spm=a2g0o.productlist.main.1.2d057213hgRv7I&algo_pvid=60f984e9-6efb-4eab-a7d3-f0464680212b&algo_exp_id=60f984e9-6efb-4eab-a7d3-f0464680212b-0&pdp_ext_f={"order"%3A"918"%2C"eval"%3A"1"}&pdp_npi=4%40dis!EUR!15.65!11.27!!!125.34!90.24!%40211b629217494702473493115e65d2!12000043894817482!sea!PT!6076866631!X&curPageLogUid=O4OMpr8jdqB5&utparam-url=scene%3Asearch|query_from%3A

just need to understand if it has enough ADC and GPIO… and hope that it will work better that Cubecell… honestly - I had high hopes for Cubecell.
but every time I encounter some very strange problems. which I try to solve on this forum.
thanks to everyone who gives me useful advice.
but it still seems that the Cubecell device is not very stable and high-quality.

idk) I will learn.
for example here - https://wiki.seeedstudio.com/xiao_mg24_getting_started/#reading-battery-voltage
it look like not so hard.

But you aren’t asking questions that can be answered, that’s the point. So I am trying to help you to help us to help you by explaining what you are trying to do rather than a common X-Y issue of “how do I apply this function” - we may be able to answer but it may not help you.

It is a stretch to expect us to track everyone’s project or search back through someone’s posts to see what they are trying to do - ideally each new topic should be self contained but a link in the first post to a prior explanation is good too.

The XIAO format does, but with an SX1262 attached it may not have enough left, the Seeed documentation should give you the details. And getting low power out of an ESP32 is a solved problem but does come with some learning if you need to keep some variables between sleeps. But then why not use the Heltec ESP32 LoRa v3 which is very well supported here? Or the Wireless Stick Lite?

You may already know, but the CubeCell only has one ADC input and to remove it from the battery input you need to remove a resistor.

It’s fine - it’s the second LoRaWAN boards I ever used - but it does have it’s eccentricities that need working around, but at the time of release, it was better than most.

That’s a link to a Silicon Labs EFR32MG24 based board using the Arduino framework not an STM32 which means you’ll need to find a LoRa library to suit for it. That isn’t an example of coding STM32 using the ST HAL. But such discussion would be rather off topic for the Heltec forum.

Hopefully this moves you forward.

yes indeed!
thank you again.
I mixed STM32 with ESP32 by mistake (

these devices has low power consumption around 20uA which is pretty big to me.
Also I dont need wifi/bt and display onboard.
so Im still looking for simple device, but can not find anything better than Cubecell (