CubeCell LoRa+reading PWM from sensor

@descartes see my reply about printing the readings (sensor’s data), the same applies to pulse duration, it cuts off just after joining

To use the supplied LoRaWAN library, Heltec require a registration code that is tied to the ESP32 chip id:

which is obtained from here:

I failed to find where the code was referenced in the C source code, the modules worked OK that the client supplied so I wasn’t incentivised to read the assembly.

The question concerns a PSoC based board, not an ESP32

Ah, a new chipset for the Arduino IDE - my bad.

Try and see if the LoRaWAN.sleep() (replace with a delay(5000) is causing the issue, i.e. prevent the board from going to sleep, maybe the PWM settings are lost in the sleep function,

@weradis It fails joining, (joining fail, try after 30s) and keeps doing this. I also looked at the execution order. Once it executes the join function it goes to sleep, then gets triggered and prints joined! after that it enters the loop of (send -> cycle -> sleep -> send …etc)

Ok but does the data output remain stable or does it still turn to zero.?

I kept printing data inside the loop() function as the prepareTxFrame() is not executed any more after the join fails. The data looks normal inside the loop() even though joining fails every 30s trial…

what do you think? is it something to do with the join() being successful and then PWM gets disable/used?

even though joining fails every 30s trial…

Why do you keep re-joining? Joining is supposed to be extremely rare, really you should be saving session details across restarts of the firmware (LoRaWAN is not a protocol that is easy to use correctly).

If the device is not joined, there’s no point in preparing a TX frame since you can’t useful send application traffic without a joined session or ABP credentials instead.

Yes We know that, we are trying to find where things get messed up … unless you know the solution

@cslorabox I am not doing this on purpose, we are just trying to figure out where the PWM gets disabled and hence used delay() instead of sleep().

I am using the exact same code in the link below, except adding the PWM input bit:

No the sleepmode() is messing things up, the join is failing because the Radio.IrqProcess( ) is not handled anymore. I think the PWM settings are lost, you could try to reinitialise after sleeping …

@weradis I do re-initialise PWM in the prepareTxFrame() as other examples provided by the Library do. They initialise the sensor and read its data then append it to the appData buffer. Many examples use the same pattern, but none is using PWM.

Let me do some more research, board itself looks very promising, small and cheap :slight_smile: where did you procure and how long took it to deliver?

I got it from Amazon for next day delivery as I wanted to get this done asap. Yes, it is a very promising board.

I was working on esp32 heltec board for the same application but its power consumptiion was high ( few mA). This board is drawing (20uA!) in sleep mode + can plug solar panel and battery without needing drivers, cheaper etc. Very powerful.

I apologise for bombarding you with many questions and thank you for your patience :slight_smile: I really appreciate your help.

i ordered one in a local shop, but after ordering I noticed they are on holiday and returning next week :frowning: - btw i sent send you a pm with some more ideas

New? CubeCell and ASR650x are discussed on the forum for 9+ months already. :wink:
For more information see: Heltec CubeCell - part 2

CubeCell (in topic title) indeed is not ESP32 based.

Not really (see above link). Heltec’s CubeCell product range uses the ASR Microelectronics ASR6501 and ASR6502 SiP’s (Cypress ARM Cortex M0 + SX1262) but the ASR’s have no Arduino support.

It is Heltec who has added the Arduino support for their CubeCell products. Development with the Arduino framework is supported for both the Arduino IDE as well as PlatformIO.

LoRaWAN support is based on Semtech’s LoRaMac-node (as this already provided SX1262 support).

When asking for help with a board you should at least provide information about your hardware.
While the topic title mentions CubeCell there is no mentioning what CubeCell board/harware you are using.

CubeCell is a product family consisting of different hardware products, not one single product.
See Heltec CubeCell - part 2

Yeah, like I have all the time in the world to keep tabs on ALL of the vendors offerings, cut us some slack.

And this is a new chipset for the IDE - Heltec added it so it appears in the IDE, which surely makes it a new chipset for the IDE - again, feel free to slice & dice my words.

To save you time, the Heltec CubeCell start topic (link provided above) will provide you with a quick overview.