-
Notifications
You must be signed in to change notification settings - Fork 81
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
uSockGetHostByName() fails if we use stubs for wifi. #36
Comments
Hi there! -5 is |
Yes, it sounds like |
Hi |
Ahh.. just saw that in the title now. Unfortunately there are no proper way of excluding wifi at the moment. We are planning to address this in the next quarter: UPCOMING_CHANGES.md. |
Apologies for this @eeFLis: we had thought the stub mechanism would work originally but it is really not scaleable, hence we are planning a different solution as Andreas describes. Are you able to work around the issue as Andreas suggests until we have a better solution in place? |
@RobMeades |
Hi Rob |
Hi again, and apologies: this was something we wanted to get in for this release but re-jigging all the underlying things to introduce the device/network API, which paves the way for doing what you want, took longer than we thought. So the hooks are there, we need to get down and do the implementation now. In fact, just a few hours ago we had a meeting about next priorities and this was highlighted. We are shooting for October; basically it comes after LARA-R6 support and I2C support, both of which are happening now. Apologies again: what I might do, as soon as we have something, is push a preview branch of it here so that you can see if it works for you. |
Hi Rob That would be great. this will help us to reduce the memory footprint. Thanks |
@eeFLis: just an update that this is being worked on but didn't make it into 1.1.0. We will let you know as soon as there is something to try. |
Hi Rob Do you know when we will have something to try? |
Hi there: unfortunately the guy who was working on this hasn't. That said, as a side-effect of doing the CMUX work, we've ended up creating the bits of code needed to make the jump-tables that are required for this kind of "link-time" separation to work, so I can probably start looking at this myself from the start of next week. That would suggest probably not this year but, maybe, just maybe... Apologies again for the extreme delay on this, don't like having issues open for an entire year, though it is not the record breaker :-(. |
Hi Rob Since the lib is growing constantly (which is great), in most cases not all components (gnss,wifi,ble,cell) are needed. already many thanks for your work |
Understood: the growth worries me a little actually, it might be that some of the things we are adding even within, for example, cellular, are not of general interest and the code size just becomes an overhead. Anyway, will try to at least allow you to remove the things that you are definitely not interested in. |
Had a bit of a revelation yesterday and realised that fixing this problem is a lot easier than I thought. I have pushed a preview branch of the solution here: https://github.com/u-blox/ubxlib/tree/preview_separation_rmea On this preview branch you should be able to change the FYI, the preview branch is arranged such that it includes the preview-fix we did for your issue #75. Please let me know if it does what you want. Also FYI, this is a preview, we've not actually reviewed this change internally yet, though I anticipate no problems. Once we merge the change to |
Actually, there's still a bug in that branch, the one you raised here originally, let me fix that and I'll update this issue when I've done it. |
Hopefully fixed now, branch updated. |
We use the STM32 Cube IDE, which does not have cmake integrated. Is this only a temporary solution? |
That's what I had originally thought but it is only not scalable because of having to swap in and out the stub files for the N cases; the revelation I had last night was that each I assume you're using the full Eclipse system? If you were just using a Makefile project we support that through the The other approach, what I was preparing for, was to create interface types: for instance there would be one for things that MQTT needed for services from |
Actually, let me push to the preview branch again: I've just changed some of the file names during review and so if you're manually adding them it is better to get that all right. Will comment back here when pushed... |
Right, please use this branch: https://github.com/u-blox/ubxlib/tree/preview_separation_use_this_one_rmea I will delete the other one shortly. |
in |
Ah, great, thanks for that, we will fix it on the version we merge to |
I think its not releated to this change but if If we call |
Interesting: are you able to see what AT sequence causes the AT parser to get upset? |
I mean, I guess it is that EDIT: you're on R5 so you must be, it wouldn't go into "real" PSM otherwise. |
It might be interesting to see if you called something like uCellInfoGetManufacturerStr() at that same point, does it fail also, i.e. is this specifically sockets related or is it just that any AT command that does not retry, if called just after return from PSM, fails in this way? |
`AT+CCID AT OK OK OK OK 03.15,A00.01 OK +UUPSMR: 0 OK OK OK OK OK +CPSMS: 1,,,"01000011","00001000" OK +UMNOPROF: 90 OK OK OK OK +UUPSDA: 0,"IP" +USOCR: 0 OK OK |
Very interesting, thanks for that, there is definitely something going wrong here. Let me just get my head straight on some things:
What should happen is that, before sending the AT command, the AT client will call uCellPrivateWakeupCallback() which will call uCellPrivateIsDeepSleepActive() and, if power saving has been agreed with the network and But, somehow or other, deepSleepWakeUp() is not returning that the module is in deep sleep. Hmph. |
yes we have strangely enough the command order of AT OK OK OK OK 03.15,A00.01 OK OK +UUPSMR: 0 OK OK OK OK +CPSMS: 1,,,"01000011","00001000" OK +UMNOPROF: 90 OK OK OK OK +UUPSDA: 0,"IP" u-blox OK +USOCR: 0 OK OK |
How weird! Would you be able to put some debug prints into uCellPrivateWakeupCallback() and uCellPrivateIsDeepSleepActive() to determine the route the code is following? |
...maybe in deepSleepWakeUp() also. |
yes i can do that. I will get back to you when i have first results. |
One possibility, while it is in my mind, knowing that you are using STM32F4 and that power saving is very important to you: do you happen to be running FreeRTOS in tickless mode? The reason I ask is because, in our default port to STM32F4, we do not switch on tickless mode so that we can implement The AT client will only call uCellPrivateWakeupCallback() if it believes that more than 6 seconds have passed since it was last active [this being the minimum time for any sort of sleep, UART sleep included, to take effect]; if, for some reason, |
wow that was exactly the problem. Yes we are using the tickeless idle mode. we correct the gTickTimerRtosCount now and the problem doesn't seem to occur anymore. |
Phew, glad that did it for you. |
Hi have you ever observed this behavior? we use SARA-R510S-01B-00 |
Ah, yes, this looks like an issue that I have seen with SARA-R5: basically what happens is that if you toggle the DTR line at the wrong time, just as the module is going into sleep, it may miss the edge and not wake-up. While the module is asleep the CTS line floats high and so you cannot send anything to it, hence you will end up stuck in There are a few ways forward:
It is possible (not yet confirmed) that there will be a maintenance release for SARA-R5 early next year which will include a fix for this problem; you will understand that going through all of the necessary approvals required for a cellular module means that such releases are rare and take quite some effort/time, hence I can't promise timescales, but there is an intention to make such a release. With that you could return to using DTR. |
Yes I think that is the issue we are seeing. so we will not use DTR at the moment and hope that the bugs will be fixed soon. |
You'll need @philwareublox for this, rather than me, but I do know [we might have talked of this already] that the The next thing you're going to ask is "why not and when will the module enter deep sleep?". In your trace above it seems like 10ish seconds have passed and the module has not entered deep sleep by that point; @philwareublox: what kind of things might keep the module awake for that long? |
Just to be sure, +UPSV needs to be set to something other than 0 otherwise it will go into 3GPP PSM mode, but not able to go into a [hardware] Deep Sleep.
If the module can't go into deep sleep you should also see a parameter stating what is causing the module to stay awake at that point, like the UART is still enabled (+UPSV=0) .... But you are seeing +UUPSMR: 1 with no extra parameter.
Do you have a link to the Saleae trace we could look over?
|
Just a few more points: If +UPSV is set to 0, you should not get +UUPSMR: 1 The only way I think you are seeing +UUPSMR: 1 but VINT is not dropping is because the module is using +UPSV 2 or 3 mode still and these lines are still held for keeping the module awake. What +UPSV mode are you using? |
We use +UPSV mode 1. Is it possible that I send you the Saleae trace in a PM? |
Please send it to phil.ware, using same format as Rob's email. Thanks. |
ok thanks you should have just received an email. |
The changes required to allow one or more of GNSS/Wifi/Ble/Cell to be left out of a build, the original question of this issue, are now pushed to |
Hello all
We are using cell sockets to resolve the address of a host. However, with the current master branch this fails. The reason seems to be in uWifiSockInit() line 474 in u_sock.c. This function is also called when only cell sockets are used. In this case the call fails with error code -5.
If I comment out the line, everything works as before.
Is there any other way I can work around this problem?
The text was updated successfully, but these errors were encountered: