Skip to content

Commit

Permalink
SIMCOM/PPPoS: fix DNS request for esp-idf v3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dexterbg committed Jul 26, 2019
1 parent 52d5ba3 commit 807f62a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions vehicle/OVMS.V3/components/simcom/src/gsmpppos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#include "ovms_log.h"
static const char *TAG = "gsm-ppp";

#include <lwip/ip_addr.h>
#include <lwip/netif.h>
#include <lwip/dns.h>
#include "gsmpppos.h"
#include "ovms_command.h"
#include "ovms_config.h"
Expand Down Expand Up @@ -61,6 +64,10 @@ static void GsmPPPOS_StatusCallback(ppp_pcb *pcb, int err_code, void *ctx)
ESP_LOGI(TAG, " our_ipaddr = %s", ipaddr_ntoa(&pppif->ip_addr));
ESP_LOGI(TAG, " his_ipaddr = %s", ipaddr_ntoa(&pppif->gw));
ESP_LOGI(TAG, " netmask = %s", ipaddr_ntoa(&pppif->netmask));
ip_addr_t dns = dns_getserver(0);
ESP_LOGI(TAG, " DNS#0 = %s", ipaddr_ntoa(&dns));
dns = dns_getserver(1);
ESP_LOGI(TAG, " DNS#1 = %s", ipaddr_ntoa(&dns));
#endif /* PPP_IPV4_SUPPORT */
#if PPP_IPV6_SUPPORT
ESP_LOGI(TAG, " our6_ipaddr = %s", ip6addr_ntoa(netif_ip6_addr(pppif, 0)));
Expand Down Expand Up @@ -198,6 +205,7 @@ void GsmPPPOS::Connect()
pppapi_set_auth(m_ppp, PPPAUTHTYPE_PAP,
MyConfig.GetParamValue("modem", "apn.user").c_str(),
MyConfig.GetParamValue("modem", "apn.password").c_str());
ppp_set_usepeerdns(m_ppp, 1); // Ask the peer for up to 2 DNS server addresses
pppapi_connect(m_ppp, 0);
}

Expand Down

2 comments on commit 807f62a

@mjuhanne
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting compile failure after this commit. Is there a missing dependency somewhere?

CXX build/can/src/canlog.o
In file included from /Users/markojuhanne/esp/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/simcom/src/simcom.h:34:0,
from /Users/markojuhanne/esp/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/ovms_peripherals.h:71,
from /Users/markojuhanne/esp/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/can/src/canlog.cpp:41:
/Users/markojuhanne/esp/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/simcom/src/gsmpppos.h:43:30: fatal error: netif/ppp/pppapi.h: No such file or directory
compilation terminated.

@mjuhanne
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, resolved by updating to esp-idf v3.3

Please sign in to comment.