How Could W5500 Ethernet Improve an ESP32 LoRa Smart Dairy Farm Gateway?
The Smart Farm System is an ESP32 and LoRa-based platform for monitoring cow health, location, activity, and milk quality.
ESP32 LoRa 스마트 축산 게이트웨이에 W5500 Ethernet을 추가한다면?
Smart Farm System은 ESP32와 LoRa Mesh를 기반으로 젖소의 체온, 심박수, 활동량, 위치 및 우유 품질을 수집하는 스마트 축산 플랫폼입니다. 현재 공개된 Gateway 펌웨어는 Wi-Fi와 MQTT를 사용하지만, 상위 시스템 설계에는 Ethernet Gateway가 제안되어 있습니다. 본 콘텐츠는 현재 구현을 분석하고, 농장 현장의 안정적인 유선 백홀을 위해 W5500 Ethernet을 적용할 수 있는 확장 구조를 살펴봅니다.
LoRa 기반 스마트 축산 시스템
Smart Farm System은 젖소의 건강 상태와 우유 품질을 자동으로 수집하고, 농장 운영자가 원격에서 확인할 수 있도록 설계된 IoT 프로젝트입니다.
시스템은 다음 세 가지 노드로 구성됩니다.
- Cow Node: 개별 젖소의 건강과 위치 측정
- Milk Station Node: 우유의 품질과 생산량 측정
- Gateway Node: LoRa 데이터 수집 및 Cloud 전송
원본 저장소:
https://github.com/FreeFelix/smart-farm-system
Cow Node
각 젖소에 장착되는 Cow Node는 ESP32-WROOM-32를 중심으로 다음 센서를 사용합니다.
| 구성 요소 | 측정 항목 |
|---|---|
| MAX30102 | 심박수 및 산소포화도 |
| DS18B20 | 체온 |
| MPU6050 | 움직임과 활동량 |
| NEO-6M | GPS 위치 |
| RC522 | 개체 RFID 식별 |
| SX1276 | LoRa 통신 |
Cow Node는 태양광 패널과 2,500mAh 배터리를 사용하도록 설계되어 있으며, 장거리 LoRa 연결을 통해 Gateway로 데이터를 전달합니다.
Milk Station Node
착유 설비에 배치되는 Milk Station Node는 다음 데이터를 측정합니다.
- 우유 온도
- pH
- 전도도
- 유량
- 총 생산량
- 품질 상태
측정값은 로컬 LCD에 표시하고 SD 카드에 저장할 수 있도록 설계되어 있습니다.
Gateway Node
Gateway Node는 ESP32와 LoRa 모듈을 이용해 Cow Node와 Milk Station Node의 데이터를 수집합니다.
수집되는 데이터에는 다음 정보가 포함됩니다.
- 젖소 ID
- 체온
- 심박수
- 활동량
- 배터리 상태
- GPS 좌표
- 우유 온도
- pH와 전도도
- 우유 유량과 생산량
Gateway는 데이터를 JSON으로 구성해 MQTT Broker로 전송하며, Cloud에서 농장 상태를 시각화할 수 있습니다.
현재 구현된 네트워크 구조
현재 공개된 Gateway 펌웨어는 Wi-Fi를 사용합니다.
전체 흐름은 다음과 같습니다.
Cow and Milk Nodes → LoRa → ESP32 Gateway → Wi-Fi / MQTT → Cloud
Gateway 코드는 다음 기능을 제공합니다.
- Wi-Fi 연결
- 연결 손실 시 자동 재접속
- RSSI 모니터링
- MQTT Publish와 Subscribe
- JSON 형식 데이터 전송
- HiveMQ, ThingSpeak와 AWS IoT Core 연동 구조
- OLED 기반 로컬 상태 표시
따라서 상위 README에 Ethernet Module이 언급되어 있더라도, 현재 공개된 코드에서 실제 Ethernet 통신은 확인되지 않습니다.
W5500 Ethernet 확장 제안
농장에서는 Gateway가 축사, 착유장 또는 장비실에 고정 설치될 가능성이 높습니다.
이러한 환경에서는 Wi-Fi 신호가 금속 구조물, 장거리, 습기와 장비 간섭의 영향을 받을 수 있습니다.
ESP32 Gateway에 W5500을 추가하면 다음 구조로 확장할 수 있습니다.
Cow and Milk Nodes → LoRa → ESP32 Gateway → W5500 Ethernet → MQTT Broker
W5500은 SPI로 ESP32에 연결할 수 있으며, Gateway의 Wi-Fi 백홀을 유선 Ethernet으로 대체하거나 보조할 수 있습니다.
예상 W5500 역할
W5500은 다음 기능을 담당할 수 있습니다.
- 유선 LAN 연결
- MQTT Broker 접속
- Cow 및 Milk 데이터 전송
- Gateway 상태 Publish
- Cloud 명령 Subscribe
- Wi-Fi 장애 시 유선 백업 통신
- 고정 IP 기반의 현장 관리
W5500은 하드웨어 TCP/IP를 사용하므로 ESP32가 LoRa 패킷 처리, 데이터 집계와 센서 상태 관리에 집중할 수 있습니다.
적용 시 필요한 변경
현재 프로젝트에 W5500을 적용하려면 다음 개발이 필요합니다.
하드웨어
- ESP32와 W5500의 SPI 연결
- CS, RESET 및 INT 핀 지정
- 3.3V 전원 용량 확인
- LoRa와 W5500의 SPI 버스 공유 여부 확인
- 각 모듈의 독립적인 CS 제어
- RJ45와 네트워크 케이블 설치
펌웨어
- Wi-Fi Client 대신 Ethernet Client 초기화
- DHCP 또는 정적 IP 설정
- MQTT Client의 네트워크 Client 교체
- Ethernet Link 상태 확인
- 케이블 분리 시 재연결 처리
- Wi-Fi와 Ethernet의 우선순위 또는 Failover 정책 구현
LoRa와 Ethernet을 결합하는 이유
LoRa는 넓은 농장에 분산된 저전력 센서 데이터를 Gateway까지 전달하는 데 적합합니다.
그러나 LoRa는 Cloud에 직접 접속하는 인터넷 기술이 아닙니다.
Gateway 이후에는 Wi-Fi, Ethernet 또는 셀룰러와 같은 IP 백홀이 필요합니다.
유선 Ethernet은 고정 설치 Gateway에 다음 장점을 제공합니다.
- 안정적인 장시간 연결
- 무선 간섭 감소
- 기존 농장 네트워크 활용
- 고정 IP 관리
- MQTT 연결 안정성 향상
- 장비실과 제어실 간의 예측 가능한 통신
현재 프로젝트에서 주의할 점
리포지토리 문서에는 최대 15km LoRa 거리, 99.5% 네트워크 가용성, 30일 연속 동작과 같은 성능 수치가 제시되어 있습니다.
그러나 별도의 시험 보고서나 원시 측정 데이터는 공개되어 있지 않습니다.
또한 현재 GitHub 저장소의 Star와 Fork가 없기 때문에 외부 커뮤니티 검증이나 실제 농장 배포 사례도 추가 확인이 필요합니다.
따라서 본 프로젝트는 완성된 상용 시스템보다는 구체적인 코드와 문서를 포함한 스마트 축산 프로토타입으로 보는 것이 적절합니다.
WIZnet 관점의 가치
현재 공개된 프로젝트에는 WIZnet 제품이 구현되어 있지 않습니다.
다만 LoRa Sensor Network와 MQTT Cloud 사이에 위치하는 고정형 Gateway는 W5500을 적용하기 좋은 구조입니다.
특히 다음 개발자에게 참고가 될 수 있습니다.
- LoRa 농업 센서망을 구축하는 개발자
- 농장 Gateway의 Wi-Fi 불안정 문제를 해결하려는 시스템 통합업체
- ESP32와 W5500을 이용한 MQTT Gateway 개발자
- 축사와 온실에 유선 백홀을 도입하려는 개발자
- LoRa와 Ethernet을 결합한 Edge Gateway 설계자
FAQ
Q1. 현재 Smart Farm System이 W5500을 사용하나요?
아닙니다.
상위 문서에는 Ethernet Module이 언급되지만, 현재 공개된 Gateway 코드와 문서는 Wi-Fi/MQTT 연결을 사용합니다. W5500이나 WIZnet Ethernet 라이브러리는 확인되지 않습니다.
Q2. 이 프로젝트를 WIZnet Maker에 그대로 등록할 수 있나요?
WIZnet 제품 적용 사례로 등록하기에는 근거가 부족합니다.
W5500을 실제로 연결하고 Ethernet 통신 코드와 테스트 결과를 추가한 뒤 등록하는 것이 적절합니다.
Q3. W5500을 추가하면 LoRa 통신도 변경해야 하나요?
LoRa Sensor Network는 그대로 유지할 수 있습니다.
변경되는 부분은 Gateway에서 Cloud로 연결되는 Wi-Fi 백홀입니다.
Q4. LoRa와 W5500이 같은 SPI 버스를 사용할 수 있나요?
가능합니다.
각 모듈에 독립적인 CS 핀을 배정하고, 사용하지 않는 모듈의 CS를 HIGH로 유지해야 합니다. 통신량과 SPI Clock 설정도 함께 검토해야 합니다.
Q5. Wi-Fi와 Ethernet을 모두 사용할 수 있나요?
가능합니다.
Ethernet을 기본 연결로 사용하고 Wi-Fi를 백업으로 사용하거나, 반대로 Wi-Fi 장애 시 Ethernet으로 전환하는 Failover 구조를 구현할 수 있습니다.
Q6. W5500은 Cow Node마다 필요한가요?
아닙니다.
Cow Node는 저전력 LoRa 통신을 유지하고, 중앙 Gateway에만 W5500을 추가하는 구조가 적합합니다.
Q7. 이 프로젝트의 핵심 가치는 무엇인가요?
젖소 건강, 위치와 우유 품질을 서로 다른 노드에서 수집하고, LoRa Gateway를 통해 하나의 Cloud 관리 시스템으로 통합한다는 점입니다.
결론
Smart Farm System은 ESP32와 LoRa를 이용해 젖소 건강, 위치와 우유 품질 데이터를 수집하는 스마트 축산 프로토타입입니다.
현재 Gateway는 Wi-Fi/MQTT 방식으로 Cloud에 연결되며, 실제 W5500 Ethernet 구현은 포함되어 있지 않습니다.
그러나 Gateway가 고정 설치되고 안정적인 장시간 통신이 필요한 농장 환경을 고려하면, W5500 Ethernet은 실용적인 확장 방향이 될 수 있습니다.
WIZnet Maker 콘텐츠로 사용하려면 W5500 하드웨어 연결, Ethernet 초기화, MQTT 전송 및 장애 복구 테스트를 실제로 추가한 후 그 결과를 중심으로 소개해야 합니다.
How Could W5500 Ethernet Improve an ESP32 LoRa Smart Dairy Farm Gateway?
The Smart Farm System is an ESP32 and LoRa-based platform for monitoring cow health, location, activity, and milk quality. Its currently published Gateway firmware uses Wi-Fi and MQTT, although the high-level system documentation also refers to an Ethernet-capable gateway. This article reviews the current implementation and explores how W5500 Ethernet could provide a stable wired backhaul for farm deployments.
An ESP32 and LoRa Smart Dairy Farm System
The Smart Farm System is an IoT prototype designed to collect cow-health and milk-quality data and make it available to farm operators remotely.
It consists of three node types:
- Cow Node
- Milk Station Node
- Gateway Node
Original repository:
https://github.com/FreeFelix/smart-farm-system
Cow Node
Each Cow Node uses an ESP32-WROOM-32 and several sensors.
| Component | Measurement |
|---|---|
| MAX30102 | Heart rate and pulse oximetry |
| DS18B20 | Body temperature |
| MPU6050 | Movement and activity |
| NEO-6M | GPS location |
| RC522 | RFID identification |
| SX1276 | LoRa communication |
The Cow Node is designed to use a solar panel and a 2,500mAh battery and sends its data to the Gateway through LoRa.
Milk Station Node
The Milk Station Node measures:
- Milk temperature
- pH
- Conductivity
- Flow rate
- Total milk volume
- Quality status
- The design also includes a local LCD and SD-card storage.
Gateway Node
The Gateway Node collects LoRa messages from the Cow Nodes and Milk Station Nodes.
It aggregates:
- Animal ID
- Temperature
- Heart rate
- Activity
- Battery level
- GPS coordinates
- Milk temperature
- pH and conductivity
- Flow rate and production volume
- The Gateway formats the data as JSON and publishes it to an MQTT broker.
Currently Implemented Network Architecture
The published Gateway firmware currently uses Wi-Fi.
Cow and Milk Nodes → LoRa → ESP32 Gateway → Wi-Fi / MQTT → Cloud
The firmware provides:
- Wi-Fi connection and reconnection
- RSSI monitoring
- MQTT publishing and subscription
- JSON payloads
- Support structures for HiveMQ, ThingSpeak, and AWS IoT Core
- A local OLED status display
Although the top-level README refers to an Ethernet module, the available Gateway implementation does not include W5500 initialization, Ethernet libraries, or WIZnet-specific pin definitions.
Proposed W5500 Ethernet Expansion
A farm Gateway may be installed permanently in a barn, milking station, or equipment room.
Wi-Fi in these environments may be affected by metal structures, distance, moisture, or interference.
Adding a W5500 could change the architecture to:
Cow and Milk Nodes → LoRa → ESP32 Gateway → W5500 Ethernet → MQTT Broker
The W5500 can connect to the ESP32 through SPI and replace or supplement the Wi-Fi backhaul.
Potential Role of the W5500
The W5500 could provide:
- Wired LAN connectivity
- MQTT broker access
- Cow and milk data publishing
- Gateway-status publishing
- Cloud-command subscription
- Wired backup when Wi-Fi fails
- Static-IP local management
Its hardware TCP/IP engine can reduce the networking burden on the ESP32 while the MCU processes LoRa packets and farm data.
Required Changes
Hardware
- SPI wiring between the ESP32 and W5500
- CS, RESET, and interrupt pin assignment
- 3.3V power-budget verification
- SPI sharing with the LoRa module
- Independent chip-select management
- RJ45 and Ethernet cabling
Firmware
- Ethernet client initialization
- DHCP or static-IP configuration
- Replacing the MQTT network client
- Ethernet link-state monitoring
- Cable-disconnection recovery
- Wi-Fi/Ethernet priority or failover policy
Why Combine LoRa and Ethernet?
LoRa is suitable for low-power sensors distributed across a large farm.
It does not itself provide Internet access, so the Gateway requires an IP backhaul such as Wi-Fi, Ethernet, or cellular communication.
Ethernet can provide:
- Stable continuous connectivity
- Reduced wireless interference
- Integration with existing farm networks
- Fixed-IP management
- More predictable MQTT connectivity
Important Limitations
The repository presents performance claims including long LoRa range, high network availability, and extended continuous operation.
Independent test reports and raw measurement data are not included.
The repository also currently has no GitHub stars or forks, so community validation and real farm deployment should be verified separately.
The project should therefore be viewed as a documented smart-agriculture prototype rather than a proven commercial deployment.
FAQ
Q1. Does the current Smart Farm System use a W5500?
No.
The top-level documentation mentions an Ethernet module, but the published Gateway firmware uses Wi-Fi and MQTT. No WIZnet-specific implementation is currently visible.
Q2. Can it be registered as a WIZnet project as it is?
Not as a confirmed WIZnet application.
A W5500 should first be integrated and tested, with code and network results added to the repository.
Q3. Would adding W5500 change the LoRa network?
No.
The LoRa sensor network can remain unchanged. Only the Gateway-to-cloud backhaul needs to be modified.
Q4. Can LoRa and W5500 share an SPI bus?
Yes.
They require independent chip-select pins, and every inactive device must remain deselected.
Q5. Can Wi-Fi and Ethernet both be supported?
Yes.
Ethernet can be used as the primary link with Wi-Fi backup, or a failover policy can switch between the two.
Q6. Is a W5500 required on every Cow Node?
No.
The Cow Nodes should retain low-power LoRa communication. The W5500 is most appropriate at the central Gateway.
Conclusion
The Smart Farm System is an ESP32 and LoRa prototype for collecting cow-health, location, and milk-quality data.
Its currently published Gateway uses Wi-Fi and MQTT and does not include a confirmed W5500 implementation.
W5500 Ethernet could nevertheless be a practical expansion for a permanently installed farm Gateway that requires stable, continuous connectivity.
Before presenting it as a WIZnet Maker project, the developer should add and document the W5500 hardware, Ethernet initialization, MQTT transmission, and recovery tests.

