Network Access to External Devices

Dear Community,

We are working with a WiFi camera that supports internet access via both Ethernet and WiFi. Our goal is to provide internet connectivity to this camera using the Quectel EC200U module via the USBNET class in ECM mode. However, we have encountered several challenges:

  1. We attempted using a USB-to-Ethernet converter, but it was unsuccessful due to missing drivers (Windows/Linux).
  2. We tested EC200U USBNET in ECM mode with ESP32-S3 TinyUSB, following the official ESP-IDF NCM example. However, this approach did not work since it supports only NCM mode, whereas our EC200U module operates in ECM mode.
  3. We also attempted the ESP-IoT-Solution USB dongle example on ESP32-S3, but this did not yield the desired results.

Additionally, our system uses UART2 for Modbus RS-485 communication, meaning we cannot utilize UART2 for alternative connectivity solutions.

We came across documentation indicating possible ESP8266/ESP32 support for ECM mode, but it appears incomplete when we attempt to integrate it.

Request for Guidance

We seek a reliable approach to provide internet access to the camera from the EC200U module, using either Ethernet or WiFi.

Any insights, alternative solutions, or suggestions on how to achieve this effectively would be greatly appreciated.

Thank you in advance for your support!

hi

EC200U Support usbnet and ESP8266.
If you use usbnet, in the windows environment, you only need to install the driver of the module.
And if you use ESP8266.You need a custom firmware to test.
Please confirm which option you finally choose.

Hi Felix,

Our team has decided that we will use Ethernet W5500. So, we are working on it. We have created the circuit by follow documentation of W5500. Just, I want a confirmation from your end. Is EC200U supports ethernet protocol using W5500 for providing internet to another devices ?

Please provide your concern.

Thank you :slight_smile:

Hi sumeri

yes, EC200U supports W5500, the firmware on the official website supports W5500, please test it, thank you

1 Like

Hi Felix,

I am currently integrating the W5500 Ethernet module with the EC200U-CN-AC. The module has been updated to the latest firmware version, which officially supports W5500. The setup is configured to use SPI1, and the initialization code is as follows:

import dataCall
import ethernet
from machine import Pin

nic = None

def netStatusCallback(args):
    pdp = args[0]
    datacallState = args[1]
    if datacallState == 0:
        print('modem network {} disconnected.'.format(pdp))
    elif datacallState == 1:
        print('modem network {} connected.'.format(pdp))
        if nic != None:
            lte=dataCall.getInfo(1, 0)
            print(lte)
            nic.set_default_NIC(lte[2][2])

def eth_init():
    lte=dataCall.getInfo(1, 0)
    print('modem net config: {}'.format(lte))
    workMode=1
    global nic
    print('eth init start')
    nic = ethernet.W5500(b'\x00\x08\xDC\x01\x02\x03','192.168.1.1','','', 1, Pin.GPIO2, Pin.GPIO11 , Pin.GPIO10, workMode)
    if lte != -1 and lte[2][0] == 1:
        print('eth set default nic {}'.format(lte[2][2]))
        nic.set_default_NIC(lte[2][2])
    nic.set_dns('8.8.8.8', '114.114.114.114')
    print('eth net config: {}'.format(nic.ipconfig()))
    nic.set_up()
    print('eth startup success')

dataCall.setCallback(netStatusCallback)
eth_init()

When executing the script, the following error is raised during the Ethernet initialization:

eth init start
Traceback (most recent call last):
  File "/usr/ethernet_w5500.py", line 35, in <module>
  File "/usr/ethernet_w5500.py", line 25, in eth_init
OSError: 3

Analysis:

I suspect the issue may be related to the MAC address configuration passed during the initialization. The current implementation uses a placeholder MAC address: 00:08:DC:01:02:03. Since the EC200U-CN-AC does not expose a built-in MAC address for Ethernet, we are unsure whether this is appropriate or if a unique MAC is required for successful operation.

Request:

  • Could you please confirm the correct procedure for assigning a MAC address to the W5500 on EC200U?
  • Is it acceptable to use a random MAC address in this format, or is there a method to retrieve a valid hardware-based MAC from the EC200U module?
  • Additionally, can you elaborate on the meaning of OSError: 3 in this context (e.g., does it specifically indicate an SPI communication failure, MAC issue, or something else)?

Your assistance in resolving this would be greatly appreciated.