1

I have an LTE modem connected to my mcu. It's a simcom7600 modem.

I am trying to find the IP and MAC address of the modem (I need that, so that I can hook up lwip and start communicating to the outside world).

I achieved a few things already:

  • basic stuff like reset, attach, activate, ping, etc
  • played around with mqtt using AT commands
  • set the modem in ppp mode, and switch from/to command mode and back to data mode (ppp).

However, getting the IP address and MAC address seem a more daunting task.

What I have tried is :

AT+CGPADDR=1
Sending command: AT+CGPADDR=1
[CR][NL]+CGPADDR: 1,xxx.xxx.xxx.xxx[CR][NL][CR][NL]OK[CR][NL]

xxx.xxx.xxx.xxx obviously shows a real IP address, I think it's best not to share that online ;-)

Could anybody confirm this is the IP address which is visible to the outside world? Because when I try to ping or trace it, it seems to be unreachable.

For MAC address I found this:

enter image description here

But when I try that, it always errors out.

AT+CWMACADDR?
Sending command: AT+CWMACADDR?
[CR][NL]ERROR[CR][NL]

For what it's worth: I CAN ping from the modem to e.g. google. So I know I am connected.

AT+CPING="www.google.com",1
Sending command: AT+CPING="www.google.com",1
[CR][NL]OK[CR][NL]
[CR][NL]+CPING: 1,216.58.211.100,64,299,255[CR][NL]
[CR][NL]+CPING: 1,216.58.211.100,64,288,255[CR][NL]
[CR][NL]+CPING: 1,216.58.211.100,64,287,255[CR][NL]
[CR][NL]+CPING: 1,216.58.211.100,64,277,255[CR][NL]
[CR][NL]+CPING: 3,4,4,0,277,299,287[CR][NL]

Who can confirm that the approach to obtain my IP address is correct? Who can give me some guidance how to get the modems MAC address?

Many thx in advance!!

AT+CWMACADDR?

3
  • 1
    I don't think the LTE modem will have a mac address. A mac address in the lwip case is how to identify packets at the Ethernet layer, which there isn't going to be in this case. I suspect you should be looking at the lwip over PPP docs lwip.fandom.com/wiki/PPP
    – hardillb
    May 6 at 21:34
  • 2
    Also the IP address presented by the modem is unlikely to be publicly routable these days unless you are paying for it from the provider. Most are behind CGNAT
    – hardillb
    May 6 at 21:37
  • Ah of course. That makes perfect sense. Thx a lot! Post it as answer and I will mark as answer if you want
    – bas
    May 6 at 22:00
2

As mentioned in the comments

A LTE radio is unlikely to have a MAC address that is of any use to you (it will have similar ids on the cellular network e.g. IMEI). MAC addresses in LWIP's context are normally for use with Ethernet networks. I suggest you probably want to use the LWIP PPP mode. Docs here

As for the IP address, any IP address that is available to the LTE modem is most likely going to be from a Private IP address range and be behind a CGNAT gateway as IPv4 addresses are in increasingly short supply and to get a fully routable address you will be paying a premium. If you want a publicly accessible device you really should be looking at IPv6 support these days.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.