Using a cheap USB 4G dongle as ethernet connection

FrankJensen
Posts: 72
Joined: Sun Mar 10, 2024 9:34 pm

Using a cheap USB 4G dongle as ethernet connection

Postby FrankJensen » Mon Dec 02, 2024 9:26 pm

Hi forum.

I have been browsing for the last week, but have found no answers.

I have a Huawei 4G E3372 usb modem. The type, that when plugged into a PC, MAC or even a Raspberry, it connects to the 4G and provides internet to the device.

I want this modem, to provide internet to an ESP32-S3. I have been looking at ESP_MODEM and PPPOS examples, but it seems that the examples I can find, works the other way around, where ESP32 is client, and provides ethernet to the connected computer.

I want to connect this modem directly to the USB port of the ESP32-S3 as host, and ideally inject the connection into the lwIP, so that I can use all standard libraries and use the internet via the modem.

Alternatively I would be happy, if I could just send MQTT data via the modem, but I would like to avoid going the AT command way. I would like it to be as easy as possible, and as modem independant as possible.

But is this possible at all? If yes, what libraries and what protocol should I use as buzzwords, in order to get some examples or at least leads, how to optain that?

Br. Frank.

FrankJensen
Posts: 72
Joined: Sun Mar 10, 2024 9:34 pm

Re: Using a cheap USB 4G dongle as ethernet connection

Postby FrankJensen » Thu Dec 05, 2024 8:45 pm

If its not possible, that is also a helpfull answer :D

Sprite
Espressif staff
Espressif staff
Posts: 10650
Joined: Thu Nov 26, 2015 4:08 am

Re: Using a cheap USB 4G dongle as ethernet connection

Postby Sprite » Fri Dec 06, 2024 2:12 am

From what I know, that is exactly what ESP_MODEM and PPPOS should do. Where do you get the idea that it's a client-type thing?

FrankJensen
Posts: 72
Joined: Sun Mar 10, 2024 9:34 pm

Re: Using a cheap USB 4G dongle as ethernet connection

Postby FrankJensen » Wed Jan 22, 2025 9:53 pm

I am back, and a lot wiser, but with little success.

ESP_MODEM and PPPOS does exactly that, and I have a much better understanding now. In order to get started, I purchased a Waveshare module, with a SIM7600, that is supported, well documented and after a short struggle, I got it up running, and am able to send MQTT this way.

SO, now back to the original idea, to use a cheap Huawei 3372 - or similar - modem, that comes with all approvals, to be used in almost any country, without any hazzle. But that is a struggle. I AM able to register the modem as a USB thing, and connect to it via USB, but that is where the fun stops. No matter, what I send of commands, there is nothing comming back. I tried all supported modems in ESP_MODEM, and I also tried to send costum AT commands to it.

I have read, that its caused by the plug and play features, that is default at boot. Teoretical is should be possible to switch this modem (or at least the ones with old firmware) into AT and Data mode. I have tried all hacks and tricks, that I have found on the internet. I simply can get NO connection.

Does anyone have a working example, how to do that??
Or is there a modem, that is much easier to use, than the Huawei? (that have world acknowledged approvals).

I would be greatefull, if anyone could point me to a direction to go, point to a specific modem, or anything, that can be usefull for me.

Thank you in advance.

chegewara
Posts: 2505
Joined: Wed Jun 14, 2017 9:00 pm

Re: Using a cheap USB 4G dongle as ethernet connection

Postby chegewara » Thu Jan 23, 2025 3:41 am


kunaalkk1
Posts: 1
Joined: Mon Feb 20, 2023 9:01 am

Re: Using a cheap USB 4G dongle as ethernet connection

Postby kunaalkk1 » Wed May 14, 2025 1:31 pm

Hi @chegewara,
I want to know if you can share with me the code and process, or any resources of how to connect ESP32S3 to SIM7600 for USB Data Sharing. Moreover, if I can use the same ESP32 to send data to AWS IoT using MQTT, I'd like any sources for that as well. I have literally searched the entire internet but I am unable to find sources on this, you seem to have found out a way to make PPP work, so... yeah.

If the code was in Arduino IDE, I'd prefer that, because, whether we like it or not, my company decided to use Arduino IDE for codebase. If that doesnt exist, I have to convince them to shift to ESP-IDF.

dmitrij999
Posts: 102
Joined: Sat Mar 02, 2019 8:06 pm

Re: Using a cheap USB 4G dongle as ethernet connection

Postby dmitrij999 » Sat Aug 02, 2025 8:29 pm

Hello @kunaalkk1
I think you definitely need to shift to ESP-IDF.
At least ESP-IDF Project + esp32-arduino component.
For Arduino IDE I couldn't find any solution for even USB Host, but that time I researched the working with USB-CDC-ACM class. I think it's similar for 3G modems.
As for 4G, I think it uses CDC-RNDIS driver, and I'd like to dig to there. At least if I need this one.

Who is online

Users browsing this forum: ChatGPT-User, Google [Bot] and 4 guests