-
Notifications
You must be signed in to change notification settings - Fork 82
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
Using pppd with LARA-R6 via USB #218
Comments
Hi, and thanks for posting. As you may have guessed from having to comment-out that line, we don't routinely test using modules via the USB interface: not that it shouldn't work, it is just that UART is the more common use-case. I will see if there's a good way to take the offending line "out of circuit" for the USB use-case. On the CMUX thing with PPP, that's correct; we do that so that normal AT traffic can continue, GNSS information from a GNSS chip inside a cellular module can be streamed out in parallel, etc. all without the user having to worry about it. As to using one of the UART interfaces on the LARA-R6, I think it should just work - have you tried connecting to it (with the USB disconnected as the module likely switches to USB when it sees 5V there and so would then ignore you over UART)? |
Thanks, but I think I meant to say "use one of the additional AT instances", i.e., USB1/USB2/USB3. Unfortunately, our module is connected exclusively via USB. |
Ah, I see: what you need is PPP-level integration running to a serial port rather than to CMUX; I'd been waiting for someone to ask for that. Our virtual serial device interface is not quite the same as our uPortUart (hindsight is a wonderful thing); probably the simplest way to make it happen would be to follow the pattern we use in our test code for the virtual serial device and slap a virtual serial device interface on top of a You would need to perform a little surgery in I'm a bit buried in other things at the moment or I'd have a go at this myself. If you either (a) don't fancy diving in or (b) aren't in a hurry, I might be able to give it a go in a few weeks. |
I appreciate your pointers but the required changes seem to exceed my expertise/understanding of the lib a bit. I'll wait and hope that you'll find time for this. |
Understood, I will think on it and propose something back here for you to try. |
FYI, I have the code for this now but won't be able to test it until next week. Will post something here then. |
Great, I'm looking forward to it. |
@cirdeirf: how brave are you feeling (or alternatively how good is your knowledge of Docker containers)? I have a version of this which should work but I can't test it yet because of some subtlety to do with the way Docker containers work on different platforms (our test system runs instances of itself inside a Docker container); this is nothing to do with you of course but it means I can't give you tested code until I find a way around it. If you are feeling brave enough to just give stuff a try, I have pushed a preview branch here: https://github.com/u-blox/ubxlib/tree/early_preview_feature_cell_ppp_usb_rmea ...where the Linux PPP sockets example is updated to point PPP at another USB end-point if you define You will see from that example that the idea is the uNetworkCfgCell_t structure you pass to uNetworkInterfaceUp() has gained a new field,
...to use I will entirely understand if you'd rather let me sort my own rubbish out before inflicting this on yourself, just posting it in case you were in a hurry really. |
I have fixed my test problem; you can find a tested preview branch here: https://github.com/u-blox/ubxlib/tree/preview_feature_cell_ppp_usb_rmea I will delete early_preview_feature_cell_ppp_usb_rmea now. No code changes aside from the removal of some debug that I left in by mistake. This is the version that I will put in for review, it will hopefully appear in |
Thanks. Here is my configuration if you should happen to spot any mistake there on a glance:
|
For my clarification, |
Hmmm, I wonder: the difference with your case is that you are setting both |
Correct. I just used this value as it is defined in |
You can try setting |
Thank you. Was about to answer that that works ^^. |
Woohoo! Please continue hammering it. In particular, do you have any issues getting name resolution to work on Linux? Have a weird problem that I am seeing with our test system, only when the Docker container it is running inside is running on Centos8, where name resolution doesn't appear to work, seems to time out. It works fine when the Docker container is running on Raspbian, so I have put it down to "some odd Linux thing", but would be interested to know if you see the problem on whatever Linux you are running. Meanwhile I will go fix the logic in the |
If you would like to use you original formulation, I believe the fix required is to change this line: ubxlib/port/platform/linux/src/u_port_uart.c Line 419 in d251066
...to be:
|
But name resolution on the underlying system (Centos8) works? My knowledge of Docker containers is quit limited I'm afraid. Name resolution works on our system (custom linux built using yocto project) without problems so far. |
I don't have that scenario to hand as the test system always runs inside the Docker container and the only Centos8 machines I have are part of the test system, I don't have one I that I can freely use. When I print out the PPP traffic passing between the module and the application (those debug prints I have now removed) I can see what I guess is the DNS request being sent to the cellular module (a burst of PPP activity after the DNS query function is called at Linux level), but it seems to take slightly too long for the PPP activity in the reverse direction (which I guess is the answer coming back) to occur, the Linux bit has timed-out before that. I don't see how this can be anything to do with If your Linux flavour gets an answer to a DNS query in time that is useful information; I will put it down to "it's a mystery, probably not my fault" for now. |
Although the connection may not be stable. Our application regularly pings some server to check if internet is available and every 20-40s this ping currently fails once and succeeds again for ~30s. I'm going to clean up (some pppd-forking-related stuff I no longer need), recheck old pppd options and check again. |
Interesting: do you have any way of "sniffing" the USB interface? Normally when problems of this nature occur I would recommend switching on CMUX debug, which prints out detailed activity, and of course one can see AT commands in any case, but once PPP is on a separate USB port and connected to the Linux kernel via Otherwise, I could put those debug prints I took out back in, under a conditional compilation flag, for these occasions. Would that be useful? |
Sry, you are too fast for me ^^" |
Would you mind giving me the debug prints (or putting them back in)? Analysing pppd debug output/options did not help me much. I can look at the serial device (used for pppd connection) via, e.g., picocom, but the output is not readable (or at least there was nothing obvious during the "outage" times). |
The ubxlib log output during application shutdown does not look quite right by the way. Although it probably is not the cause for my problems as they occur during a fresh "boot" as well.
|
Done in latest commit to preview branch; define |
On the I will have a look at why the warning is appearing in this case (I see it also) but it might not be "real". It is sometimes difficult for the |
|
Oh, LARA-R2? Not a module that we've ever seen here in |
Hi, |
Thanks. Yes, I will look into the functions mentioned in the
Doesn't
Unfortunately, we still have same devices with LARA-R211 modules. So whatever I change has to work for both LARA-R211 and LARA-R6. |
Hi, |
Hi,
I'd like to use the new PPP-level integration on Linux with a LARA-R6 cellular module connected via USB but ran into two issues so far:
as this does not seem to work if connected via USB:
Until now we used ubxlib to setup the cellular module (we use LARA-R211 und LARA-R6) and fork pppd from within our application.
Thanks for your help and this really useful library!
The text was updated successfully, but these errors were encountered: