Taun

Taun

How to set VintageNetMobile service_provider.apn from ICCID

This should maybe be two separate questions but they seem related in terms of architecture. Both have to do with wanting to perform actions after VintageNet.configure is kicked off but before PPPD is started.

All this is for a Telit ME310 modem.

Part 1 - How to set VintageNetMobile service_provider.apn from ICCID

I may be crazy but I am trying to figure out if there is good point within the standard VintageNetMobile startup & configuration to inject a service_provider selection based on the SIMs ICCID? Similar to what VintageNetQMI does with ICCIDs and service_provider.

The problem I am running across is it seems the only place to do this is in the Chat script but that’s not dynamic. The chat script doesn’t get and record the SIM ICCID and then allow using it later as a parameter to a function. At least, not that I can see.

So far, the only solution I can see is our existing solution which is to make an independent GenServer solely for the purpose of connecting to the modem, getting the SIM data, then modifying the Configuration chat to use the correct APN, then kicking off the VintageNet.configure. But it still has the problem of ppp kicking off the CGDCONT and sending ATDT before GPRS is really ready.

Part 2 - How to perform a CREG validation before pppd?

We have a modem which seems to be connecting to cells that aren’t really valid (connect but no traffic due to no cell enhancement available. This seems to be because PPPD is attempting ATDT... before AT+CREG? has responded with a valid cell connection of 1 or 5. CREG may be responding that it is still searching but PPPD will be attempting to setup the interface because ATDT responded with a CONNECT but the cell isn’t fully setup.

Again, what I would like to be able to do is break this down into 2 steps.

  1. Configure the modem and wait for the GPRS to be fully running.
  2. Use PPPD to turn the GPRS into an internet pipe.

I can’t see how to do this with PPP Chat attempting to do everything.

I feel like I am missing something really simple. Wouldn’t a CREG response of 2 (not registered but searching) be a normal thing that PPP would need to wait for? Do other modems not respond with CONECT until CREG would show 1 or 5?

On the other hand, these issues may be why we are mostly handling it all in a GenServer that powers the modem, gets the SIM information, generates the config, then kicks off the VintageNet.configure. But it still has the issue with the CG

Ideally I think all would be solved using the existing VintageNet & VintageNetMobile architecture and libraries if there was a way to

  1. Power on and run some commands before setting the APN.
  2. Wait for the CREG to be 1 or 5 before attempting PPP or timing out, or aborting, if the value is 0 (not searching not registered) or 3 (denied)
  3. Now run PPP with ATDT…

Marked As Solved

Taun

Taun

This turned out to be sort of easy. The solution was to,

  • Remove the PPPDConfig.add_child_spec from the modem driver add_raw_config/3 definition.
  • Use PowerManager to handle the modem power-on + watchdog.
  • Have the modem driver handle AT commands for modem config, setup, etc.
  • Once the modem driver is happy with a ready modem, it initiates the PPPD child process.

So the change mostly boils down to, move the PPPD child from being a child of VintageNetMobile and at the same level as the modem driver, to a child of the modem driver.

Where Next?

Popular in Questions Top

vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> somethi...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
chokchit
** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2733ms. You can configure how long re...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New

Other popular topics Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36352 110
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39467 209
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement