Skip to content

Ethernet disconnected on RF gateways #2222

@toi-go

Description

@toi-go

Describe the bug
Hardware: Olimex ESP32 PoE, CC1101
The gateway works well if I use WiFi. However, if I enable Ethernet, I receive the following message after startup:

W: Ethernet Disconnected

************* WELCOME TO OpenMQTTGateway **************
N: SYS config not found
N: OpenMQTTGateway Version: version_tag
T: mounting FS...
T: mounted file system
T: reading config file
T: opened config file
T: 
parsed json, size: 1667
N: OTA server cert hash: 02118cbaf5cc02748398d93ecdb0ef2a444c37358a617bfb2206dfe351dc7cf2
N: Config loaded from flash
N: Spl eth cfg
T: Ethernet Started
N: Ethernet Connected
N: OpenMQTTGateway Ethernet MAC: 98:98:98:98:98:98
N: OpenMQTTGateway Ethernet IP: 192.168.178.44
N: OpenMQTTGateway Ethernet link speed: 100 Mbps
N: Ethernet started
T: OpenMQTTGateway mac: 98:98:98:98:98:98
T: OpenMQTTGateway ip: 0.0.0.0
T: OpenMQTTGateway index 0
T: OpenMQTTGateway mqtt topic: MyOMG/
T: OpenMQTTGateway mqtt discovery prefix: homeassistant
T: OpenMQTTGateway gateway name: MyOMG
T: OpenMQTTGateway mqtt server: 192.168.178.40
T: OpenMQTTGateway mqtt port: 1883
T: OpenMQTTGateway mqtt user: mymqttuser
T: OpenMQTTGateway secure connection: false
T: OpenMQTTGateway validate cert: false
N: No WebUI config to load
T: [WebUI] displayMetric true
T: [WebUI] WebUI Secure true
N: OpenMQTTGateway URL: http://0.0.0.0/
N: ZwebUI setup done
N: RF Config not found using default
T: enableActiveReceiver: 4
E: C1101 spi Connection Error
E: C1101 spi Connection Error
W: Ethernet Disconnected

(MAC address obfuscated in the log above)

The error also does not occur for BLE to Ethernet gateways which work well. It seems that the problem is the combination of Ethernet and RF gateway (rf, rf2 or rtl_433) and/or CC1101.

The error ocuurs no matter which pins I use for SPI/GDOx. It occurs even if I remove the CC1101 hardware.

The error E: C1101 spi Connection Error also occurs in the working case (with WiFi instead of Ethernet), but after a few attempts, it eventually succeeds. In the non-working case, it stops trying after two or three attempts.

To Reproduce

[platformio]
default_envs = MY_esp32-olimex

[env:MY_esp32-olimex]
platform = ${com.esp32_platform}
board = esp32-poe
extra_scripts = ${com-esp32.extra_scripts}
board_build.partitions = min_spiffs.csv

lib_deps =
  ${com-esp32.lib_deps}
;  ${libraries.rtl_433_ESP}
 ${libraries.smartrc-cc1101-driver-lib}

  ${libraries.ble}
  ${libraries.decoder}

  ${libraries.rc-switch}
  ${libraries.smartrc-cc1101-driver-lib}
  ${libraries.newremoteswitch}


build_flags =
  ${com-esp32.build_flags}
  ; '-DZgatewayRTL_433="rtl_433"'
  ;  '-DZgatewayBT="BT"'
 '-DZgatewayRF="RF"'
  ; '-DZgatewayRF2="RF2"'
  ; '-DZgatewayRTL_433="RTL_433"'
  '-DESP32_ETHERNET=true'
  '-DGateway_Name="MyOMG"'
  '-DvalueAsATopic=true'       ; MQTT topic includes model and device
  '-DZradioCC1101="CC1101"'

  '-DLOG_LEVEL=LOG_LEVEL_VERBOSE'

  ; '-DESPWifiManualSetup=true'
  '-Dwifi_ssid=""'
  '-Dwifi_password=""'
  '-DMQTT_SERVER="192.168.178.40"'
  '-DMQTT_USER="mymqttuser"'
  '-DMQTT_PASS="(hidden)"'

  '-Dgw_password="(hidden)"'

 ; *** rtl_433_ESP Options ***
  '-DSIGNAL_RSSI=true'             ; Display during signal receive

 ; *** RF Module Options ***
  '-DRF_MODULE_GDO0=14'        ; CC1101 pin GDO0
  '-DRF_MODULE_GDO2=15'        ; CC1101 pin GDO2
  '-DRF_MODULE_MOSI=33'
  '-DRF_MODULE_MISO=4'
  '-DRF_MODULE_SCK=32'
  '-DRF_MODULE_CS=2'

  '-DRF_MODULE_INIT_STATUS="DRF_MODULE_INIT_STATUS"'    ; Display transceiver config during startup

custom_description = MY Gateway using ethernet, need to be configured through PIO
custom_hardware = MY OLIMEX ESP32 Gateway with POE

Expected behavior
Ethernet should stay connected and it should continue CC1101 initialization attempts .

Environment (please complete the following information):

  • OpenMQTTGateway version used (1.8.1 from branch "v181")
  • Library version related to the problem you have (if you have troubles with RF provide the version of RCSwitch library):
    I haven't changed any library versions - I use the versions which are referenced by default in the v181 branch.
  • I haven't tested with the basic examples, but with WiFi instead of Ethernet, as well as BLE instead of RF, and both worked well with the same library versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions