Closed manojsai17 closed 4 years ago
use the pppos_client
example, it also uses esp_mqtt
examples\protocols\pppos_client
problem is that I used a traditional at commands method to connect to internet using sim 7000 gsm module .
@manojsai17 Please start with this example as @umer-ilyas suggested. It also uses AT
commands before switching to the PPP mode. If you have any specific issue or question, please post it here.
In case you are already connected to the network (got an IP address from the GSM module), please look at some mqtt example and just use everything after example_connect() , so replacing the WiFi/Ethernet connection with your own GSM.
how to link the ip address or tcp method got from my gsm module to esp module . and use default mqtt library to send data I dont want to use ppos method . becuase i dont have knowledge exposure on ppos method .
@manojsai17 I still don't quite understand. Could you please describe your setup in more detail? So you've already received an IP address from the GSM module and you can interface it from the ESP to talk to the internet over TCP, correct? Could you give an example of such interface?
we interface the gsm module to esp uart . I able to data transfer to cloud using wifi with default mqtt library . whenever there is no wifi connectivity , i have to use gsm module . So we interfaced gsm module to esp uart . with traditional at command i will get the network and ip address . so how to link the ip of gsm module which is attached to esp32 .to transfer the data to cloud using mqtt
okay, so if I understand correctly you can open a TCP/IP "socket" using the at commands and talk to remote servers, right? In that case it's much easier to use the pppos approach since it is already implemented and you can directly get to the lwip, the ESP network stack, as the mqtt library uses tcp_transport component connecting to it. It is possible however to add another "layer" in tcp_transport
component to pass the TCP traffic to custom interface (network by uart in your case) to bypass the ESP network stack. This might be a lot of work though.
actually i dont have experience on pppos related concept . I written code upto , with at commands , where netwrok connecton , getting ip address . so is there any way link the ip address , open the tcp port .and send the data using default mqtt library .
Not really, If you open a tcp port/socket all traffic goes to the underlying TCP/IP stack and then the network data could de passed to any arbitrary interface (such as uart), but these are level 2 data, not only the tcp traffic. AFAICT these three options are available to pass the mqtt data over uart as tcp only data:
tcp_transport
bypassing the lwip socket and direct the tcp traffic to arbitrary interfaceesp_netif
driver to direct the network data to an arbitrary interface, but also add a logic to strip the lower layers and pick only the tcp data.Ive been trying to use the PPPoS client example with SIM7000 let-m modem, there are differences in the initial AT commands and there are some random crashing that causes it to connects and disconnect right after.
Also was not able to reconnect after the connection was lost, could not find much example/documentation about how we should handle connection loss and stuff..
But I was able to occasionally connect, get IP and publish to the MQTT server with it, the overall process is the same to the SIM800.
After I get it working ok (I have 2 week for that ðŸ˜) is desirable to have more modems configurations in the example and I should make a pull request? Is there a place to share this kind of stuff? Im new to this embedded ecosystem thing
Anyway, if anyone is struggling with the same issues and want to share experiences get in touch, maybe I can pay you a beer and we talk about making some nice modem support on idf.
@diogoviannaaraujo Yes, please. if you're willing to share your implementation, please file a PR. would really appreciate to have another modem supported, thanks for your help!
@diogoviannaaraujo Thanks for reporting. Will close the issue now, feel free to reopen with more updates or file a PR which would be appreciated. Thanks.
we interfaced the simcom 7000 gsm module to esp-wroom 32 , how to use default mqtt library when esp module is interfaced with sim 7000 e gsm module