Comments (7)
Hello @chromoxdor!
Could you give me more information about what error happens in the while loop, or if it is just that the while loop in your gatherDataAndSend function keeps the device "awake"?
Have a nice day!
from beelan-lorawan.
Hey @Eric286,
it is hard to describe since i am no expert in this.
The loop basically wreaks havoc in the code....
e.g. i have another while loop for a sensor before. The fist time it runs fine the second time after the "lora.update();" loop and the device went to sleep and woke up again to run the "gatherDataAndSend()" function, the "sensor" looop runs forever ignoring its statement (also a timer).
Sometimes the mcu reboots.
And apart from that no data is send.
Is rRunning "lora.update();" in a loop together with "lora.readAck();" even the right way to do since it seems to mess with the rest of the code?
(The whole code can be found here: https://github.com/chromoxdor/LoRa-and-LoRaWAN/blob/main/lora_2v1/lora_2v1.ino)
Have a nice day!
You too... but here it is more of an evening :)
from beelan-lorawan.
Hello @chromoxdor!
Since the loop continuously checks for an acknowledgment, the code execution stalls at this point, preventing other code sections (like the sensor loop) from running.
Is lora.update() and lora.readAck() Necessary in a Loop?
Yes, these functions are crucial for checking for incoming data and acknowledgments. However, using them within an infinite loop is problematic.
Implement serial communication to print debug messages during code execution to identify potential problems.
Please try to call lora.update() within the loop to check for available data.
Best Regards!
from beelan-lorawan.
Thanks for your help. I adjusted my code and as soon as i come in reach of a gateway iยดll report back.
Have a nice day!
from beelan-lorawan.
Hello @chromoxdor
How are you doing with your code?
Could you use a gateway?
Is there anything else I can help you with?
Best Regards!
from beelan-lorawan.
Hi eric,
How are you doing with your code?
Everything works fine now. After a lot of trial and error i realized, that there was a memory issues leading to unexpected behavior.
The main steps i did that lead to success where:
- reducing the
MAX_UPLINK_PAYLOAD_SIZE
in the config.h to 50 - disabling serial communication completely
I also stripped the library a bit to just send data without waiting for an acknowledgement or any received data which saved space but more importantly time where the mcu can sleep.
Could you use a gateway?
I bought one. :) I did myself and the community a favor...
Thanks and regards,
chromoxdor
from beelan-lorawan.
Hello @chromoxdor
I'm glad to know that everything worked.
If you encounter any further difficulties or wish to share any feedback, please feel free to reach out to us again. We are here to assist you.
Have a nice day!
from beelan-lorawan.
Related Issues (20)
- Stuck on joining network HOT 4
- .setChannel(<int>) doesn't appear to do anything HOT 17
- ElectronicCats HOT 4
- unable to join using OTAA HOT 5
- Can not send/receive data using OTAA Class-C HOT 35
- Getting ACK message for uplink message HOT 12
- Join procedure EU HOT 13
- Issue setting up correct pins for ESP8266 HOT 11
- Method to get DevAddr, NwkSKey and AppSKey HOT 3
- IN865 band HOT 7
- Poor ESP8266 support since 2.0.0 and up HOT 2
- What is What , RFM_pins? HOT 4
- how to downlink class c? HOT 2
- Periodically repeated downlink HOT 13
- DevNonce issue HOT 1
- Correct LoRaWAN version (TTN) HOT 4
- ElectronicCats HOT 1
- DevNonce has already been used
- Downlink no longer works HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from beelan-lorawan.