-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LoRaWan - CubeCell cannot join most time (error -6) #1013
Comments
Where is the gateway in relation to your device? Too close and they can overpower each other. We are just in the process of preparing another beta release - I'll get the CubeCell tested over the next couple of days but from previous tests I'm not aware of any particular issues. |
I also thought about it and was going outside with CubeCell - but no changes. Many "failed joins", but sometimes it is ok - but with SF10BW125 Gateway is in same room (4meters about) - but it was never a problem before with other devices (WSLV3, Heltec_WiFi32, FeatherM0) and the CubeCell was working with the Heltec library in this case too (was starting all experiments with Heltec lib...) You cannot see anything "special" in logs? |
All I can see is SPI output that at best translates to "avada kedrava" to me - usually my eyes and brain suffer much worse from all that nonsense. To me, this issue very much appears to be down to some details in the hardware or whatever RF environment you are working in. Version 6.4.3 is coming soon™, which will make troubleshooting RadioLib a bit easier, but apart from the suggestions from @HeadBoffin (mostly distance, probably check antennae), I doubt we can help you here. |
SPI output is automagically run through an Enigma machine and can only be decoded by @jgromes. Although I think LoRaTracker speaks it natively. Your RSSI is OK at -75 but I'm unsure how you end up joining, sending a uplink and then immediately sending a join request - did the board reset. Did we mention that the protocol is still in beta? TL;DR: Let me do a sanity / smoke test of 6.4.2 in the morning so we know if you should be able to get it to work. |
Do you mean between the failed joins?
Yes, of course, but you wrote "comments and issues are welcome" (like that... ;) ...) |
Not sure about this, because device was working before with the Heltec lib without any problems (with LoRaWAN version 1.0.2 of course). I only wanted to switch to RadioLib and have seen this issue (using RadioLib for other devices now too). Thanks! |
I commented out the session restore that comes after the join in your code and looked at the text logs locally. If you have logs again, please can you post them without SPI and inline as downloading random text files causes issues with indexing and virus checking etc. The starter version of code coming soon will help as it will make the test code more compact. The setup of the data structures on the CubeCell is borked - something very strange is going on that I've not seen before and goes way beyond the debug output we have at present to pin point something obvious. Both myself & @StevenCellist have RL (that's Real Life) pressing us for some results. And we are behind the curve on getting the latest issues, persistence and examples out the door. So this issue is very much on the todo list but it will be a few days before we can dismantle the session setup code to figure out the why. |
I very much appreciate your work and the high level of commitment (outside the RL) to this project.
Do you mean after the init procedure, beginning with Will be happy to do it. |
By "without SPI" we mean that you do not enable |
Thanks for this. There is no need to send any more information at this time - I've replicated the issue and will get to work on it - each time someone posts we have to choose, do we ignore them & seem rude or do we divert from the tasks at hand & give a reply. Feel free to post if you find a fix, but in the meanwhile your other devices will serve you better. |
I will help you with a piece of the puzzle: the |
Bit off-topic, but just to answer @StevenCellist - there's no fix for missing |
Also a bit "off-topic" - it was a good hint about the |
@jgromes would that be a default option? No idea.. just a thought |
@StevenCellist I don't think it's a good idea to pull in 3rd party dependency (https://github.com/embeddedartistry/arduino-printf) if that's what you mean (and if that library I linked is the LibPrintf @michapr meant). Let's not hijack this thread, if anyone has any more points about float printing, feel free to open a Discussion ;) |
Issue now also replicated by me after digging up an old Cubecell board.
... produces the following timestamps:
The average clock drift is about 16 milliseconds. For PlatformIO, adding the following build flag solves the problem:
Alternatively, you can set this in
Please note that you should measure the clock drift of your device yourself: it may not be 16 ms, but rather 14 or 18 for example. You can do so easily by using something like the loop I showed, and adding timestamps to your terminal (integrated button in Arduino IDE serial monitor, or using the |
While keeping it running for a while, I now see that the clock drift compensation may mess up something unintentionally:
@jgromes could you have a look at the implementation of EDIT: the module source files (
|
(sorry for delay, was not available some days...)
For my CubeCell (not an "old" ;) ...) this are also 16ms... Have added But the receive data is not working, I think it is the same for you?
|
@StevenCellist regarding the timeout in Tx, I don't think that should be caused by the clock drift being set. The point of the |
It's depending on the
But I see in TTN SF10BW125. |
@michapr you seem to not exactly catch the details on LoRaWAN. The idea is that you almost never receive a downlink. Fewer downlinks is better. The "timeout" message is a bit misleading there, and is removed in the current version that should be released in a couple of days. @jgromes I do agree that 150% should be plenty of headroom, but I also never saw it happen on any ESP32 and it occurs on the ASR after only a few uplinks already, every time.. I hope to check it out a bit more soon, but there must be some detail there.. |
Your LoRaWAN experience can be enhanced by a huge percent, possibly as much as a gazillion, by ensuring you are up on the fundamentals. https://www.thethingsnetwork.org/docs/lorawan/ pretty much covers the super important details but don't try to watch the whole video in one go! |
@HeadBoffin - sory for the wrong wording about "downlink" - I was thinking about the downlink procedure (code) after Maybe it is better for me to leave this discussion here because you assume that I don't seem to match your level of experience |
An update on this: it turns out that the problem is quite fundamental to the CubeCell platform - more specifically, it appears to be due to the way that micros() overflows. There are some sketchy ways around this, but actually solving the problem seems to be a harder challenge. For the near future, the answer would be: "ASR650x / CubeCell is not well supported, please use something else". Maybe we / I / @jgromes can come up with a good solution at some point, but at least for me it's not worth prioritizing my time for it. |
Rollover/overflow isn't really the issue here apparently (which I expected), but there are so many weird things with the CubeCell platform.
Interestingly, the
|
@StevenCellist - yes, you are right, looks like a bug there. I have seen before that http://community.heltec.cn/t/cubecell-micros-function/985/2 If you like I can open at Heltec an issue and follow up this there - so you don't need it to do. |
Ehm, be my guest, but I don't expect anything. The platform is outdated, it's not maintained anymore given the 107 open issues, most without reactions. @jgromes may implement a change from micros() to millis() in the transmit() function which is more likely to successfully handle this problem. |
Without having any idea how CubeCell works, issues with timers that appear and disappear when interacting with another periphery (UART in this case) smells like badly configured interrupts to me. In any case out of scope for us. As @StevenCellist posted, I will switch timeout detection from micros to millis after we get 6.5.0 released. I'm afraid that's as much as we can do from our end. |
@michapr as promised, timeout detection is switched from micros to millis, which should resolve some of the weirdness of CubeCell. However, fully fixing it's issues with millis and micros is fairly out-of-scope for this library, so I suggest taking this to the CubeCell maintainers. |
Thanks, CubeCell is working now (more or less) stable, no reconnects, no hanging. And - looks like the same problems with |
I'm afraid I have to correct myself...
Nothing more happen until Reset.... Have seen multiple times. |
Well, it happens after the MAC requests, so it's still the same theme as in the Discussions. Will investigate, later. |
Using the LoRaWAN_End_Device_Reference.ino the CubeCell 2 can initialize the Device but return error -6 most times.
In TTN I see the join process without errors.
Tried to skip the error in sketch, but sending does not work.
Sometimes the process will go as expected, values will be transmitted and I can see it in TTN.
If connected with data transfer - I have seen that SF10BW125 was used - this is not normal, other devices (Heltec WirelessStickV3 lite) are using SF7BW125, as expected...
Attached 2 verbose debug logs - first with returned error -6 for join, second with a normal transfer without error.
So maybe you can see the difference and have an idea what happen here in most times.
CubeCell_join_failed.log
CubeCell_join_data_ok.log
Screenshots
attached from TTN a screen with join (but sketch returned -6) and a screen with datatransfer
Additional info :
The text was updated successfully, but these errors were encountered: