๐ CRT Software โ Trainee 2026.1
CRT Software: Hybrid Rocket Ground Control That Falls Back from LoRa to Fiber โ A Dual-Link Design with ESP32 and W5500
0
Project description
Summary
CRT Software is the hybrid rocket telemetry and control system of Capital Rocket Team (CRT), a student rocketry team at the University of Brasรญlia (UnB). Three ESP32 nodes (the rocket node uses two boards, a Master and a Slave) split the flight, launch pad, and operator roles. The primary link is LoRa, and the backup link is W5500 UDP over about 1 km of fiber. Both links carry the same packet with the same CRC and only swap the transport. Once filling has started, the launch pad puts itself into a safe state if both links drop. That combination is what makes the project worth a look.
Overview
A hybrid rocket is loaded with nitrous oxide (NโO) at the pad. Once filling starts, the operator has to work the valves and ignition from a control box far away. If the link carrying those commands drops, there is no longer a way to reach the equipment being filled.
Capital Rocket Team is a student team at UnB's Gama Faculty of Engineering (FGA). Local press reported that the team launched the hybrid rocket "Circe" at the 2022 Latin American Space Challenge and described it as the first hybrid rocket launch in Latin America. This repository is the software the team built in its 2026 trainee (new member) program.
- Developers: Pedro Oliveira Melo, Joรฃo Gabryel, Cecรญlia
- Timeline: first commit 2026-06-24, last commit 2026-08-23, 30 commits
- Environment: ESP32-DevKit-V1, Arduino framework, PlatformIO, Wokwi simulator
โ GitHub: https://github.com/joaogscosta/software-trainee-crt
โ Report on the team's 2022 hybrid rocket launch (Jornal de Brasรญlia): https://jornaldebrasilia.com.br/brasilia/equipe-da-unb-lanca-primeiro-foguete-hibrido-da-america-latina/
Why Two Links
How the Repository Has Been Used
- Unconfirmed: pin numbers, IP addresses, and MAC addresses still carry "provisional, confirm with the hardware team before soldering" TODOs, and the repository includes a Wokwi simulator setup. We found no record of it being used in a physical test or launch
- Team track record confirmed: the 2022 hybrid rocket launch and the team's planned entry in the hybrid/liquid category of the 2023 Spaceport America Cup were both reported in the press
- Activity: 1 star, 1 fork, no license
โ Report on the 2023 competition entry (JB): https://www.jb.com.br/ciencia-e-tecnologia/2023/06/1044266-universidades-brasileiras-disputam-copa-mundial-de-foguetes-nos-eua.html
What the Competition Rules Require
The Design, Test & Evaluation Guide (DTEG) from ESRA, which runs the Spaceport America Cup (IREC), sets these requirements for hybrid propulsion and launch equipment.
| Section | Requirement |
|---|---|
| 5.10.1 | Hybrid and liquid systems must be able to remotely vent or offload all liquid and gaseous propellants |
| 11.3.4 | Hybrid launch controllers must include oxidizer fill level instrumentation |
| 11.5.3 | Hybrid launch controllers must have a failsafe that automatically vents oxidizer if power or communication is lost during fill |
[Inferred: the repository gives no reason for the dual link and never mentions these rules] With a single link, losing that link means losing remote control of the NโO being filled. CRT adds a wired path, and once filling has started, the launch pad moves itself into a venting state if both paths drop. In other words, the code contains behavior that matches the "automatic venting on communication loss" called for in 11.5.3.
The edition cited here is Revision 2024 V1.1.3 for the 2025 IREC (effective 2024-10-22). We could not confirm whether the rules of the Latin American Space Challenge (LASC), which the team entered in 2022, contain the same provisions.
โ ESRA IREC DTEG (2024 V1.1.3): https://www.soundingrocket.org/uploads/9/0/6/4/9064598/2025_irec_dteg_v1.1.3_10-22-24.pdf
Architecture
- ESP1 (rocket): sends flight data to the control box (ESP3) over LoRa and handles parachute deployment. The rocket code has a LoRa command receiver, but the control box never sends commands to the rocket
- ESP2 (launch pad GCU): measures fill mass and pressure and drives the valves and igniter through relays. Once filling has started, it moves itself to a safe state if all links drop
- ESP3 (control box): reads the operator's switches, sends commands, and shows the returned telemetry on LEDs and as CSV
- Both links exist only between ESP2 and ESP3. The rocket (ESP1) uses LoRa alone
Technology Background
LoRa and RadioHead Reliable Delivery
LoRa is a low-power, long-range radio scheme that uses chirp spread spectrum (CSS) modulation. Raising the spreading factor (SF) extends range but slows the link; lowering it speeds the link up at the cost of range. CRT uses SF7, 125 kHz bandwidth, 4/5 coding rate, and 17 dBm, and a comment in the configuration file puts the range of this setup at about 1 km.
LoRa by itself does not tell the sender whether a packet arrived. CRT therefore uses RHReliableDatagram from the RadioHead library, which adds node addressing, ACKs, and retries.
- 3 retries and a 200 ms ACK timeout (
RH_MAX_RETRIES,RH_TIMEOUT_MS) - When the command send function
sendtoWait()reports failure, the control box immediately switches to the wired path and sends the same command again
It reaches far without a cable, but obstacles or interference can break it.
โ RadioHead documentation: https://www.airspayce.com/mikem/arduino/RadioHead/
Media Converters and Single-Mode Fiber
Copper Ethernet (100BASE-TX) is limited by the standard to 100 m per segment. To run a wired link over 1 km, CRT uses media converters. A media converter turns the Ethernet signal from its RJ45 port into light on a fiber, and the converter at the other end turns it back into an RJ45 signal.
- Single-mode fiber has a thin core and is used for spans of several kilometers or more
- Fiber does not conduct electricity, so it can electrically isolate the launch pad, with its ignition circuit and relays, from the control box [Inferred: the repository does not say why fiber was chosen]
- The W5500 at each end never touches the fiber. As far as the chip is concerned, it just has an RJ45 cable plugged in
According to a comment in the configuration file, this link used to be an RS-485 (MAX485) serial link and was later replaced with Ethernet over fiber.
Watchdogs and the Failsafe State Machine
A watchdog is a monitor that treats "no signal within a set time" as a fault. CRT implements it with software timers.
| Constant | Value | Meaning |
|---|---|---|
WATCHDOG_ESP2_MS |
3,000 ms | No packet for this long means switching links or aborting |
CABLE_TIMEOUT_MS |
3,000 ms | (Control box) No packet for this long after switching to the wired path means COMM_ABORT. The pad does not use this constant and aborts as soon as 3 s pass after the last packet |
CABLE_RETRY_LORA_MS |
30,000 ms | Interval for trying to restore LoRa while in wired mode |
Failsafe is the design principle of "fail toward the safe side." On the launch pad, CRT's safe-state function executeSafeState() does the following in one step.
- Fill valve closed, main valve closed, igniter off
- Vent open, tank purge and line purge open โ the direction that relieves tank pressure
According to the comments in config.h, the tank purge valve is normally open (NA) and opens when power is lost (the vent is normally closed and closes when power is lost). During filling, however, this relay is energized to keep the purge closed, so if the MCU hangs while power stays on, the purge stays closed.
Technical Highlights
- Two shared headers tie the three nodes together: all three nodes include
config.h(pins, LoRa settings, IP addresses, mass and pressure limits, timing) andpacket_protocol.h(packet structs, state and command codes, CRC8) through relative paths. The rule "no pin or packet is defined outside these files" is written down inCONVENCOES.md - Transport-independent packets: a command is a 3-byte
CommandPacket,[type 1B][command ID 1B][CRC8 1B]. The same struct goes out whether it travels over LoRa or UDP - Actual valve state comes back: the pad reads its relay pins directly and returns them as a 5-bit
valve_state. The control box compares this with the operator's switches and shows each LED in one of three states: off (switch off, pad reports closed) / blinking (switch position and pad report differ) / on (switch on, pad confirms open) - Mission state machine:
BOOT โ SAFE โ ARMED โ IGNITION โ READY_TO_LAUNCH โ LAUNCHED, and every state except BOOT can go toABORTED. The control box aborts on any of three conditions: the manual ABORT button, manifold pressure at or above 58 bar, or loss of communication - Separate manager classes: the control box code is split into
CommManager,MissionManager,InputManager,LedManager, andTelemetryManager - Testing without hardware: a simulation mode and a single-file Wokwi version (1,054 lines) let you mimic switches and link failures through serial key input
Where WIZnet Fits
TOE in Use: Yes
CRT uses the W5500 as a hardware TCP/IP offload engine (TOE).
- Both nodes use
Ethernet.init(),Ethernet.begin(), andEthernetUDPfrom the ArduinoEthernetlibrary (arduino-libraries/Ethernet). This library opens a hardware socket inside the W5500 in UDP mode - The ESP32 has its own TCP/IP stack (lwIP) and Ethernet MAC, but this link does not use them (
ETH.h,esp_eth). As the W5500 datasheet describes, the chip handles UDP, IP, and ARP
Configuration
| Item | Value | Location |
|---|---|---|
| Chip | Two W5500s (one each on ESP2 and ESP3) | UnidadeDeControle.ino, CommManager.cpp |
| Transport | UDP, port 5000 | config.h |
| Addresses | ESP3 192.168.10.10, ESP2 192.168.10.20, /24, no gateway | config.h |
| SPI | Same bus as LoRa (SCK 18, MISO 19, MOSI 23), W5500 CS = GPIO16 | config.h |
| Physical path | RJ45 โ media converter โ about 1 km of single-mode fiber โ media converter โ RJ45 | config.h comment |
Pins, IP addresses, and MAC addresses are all still marked as "provisional" TODOs.
โ W5500 datasheet: https://docs.wiznet.io/Product/Chip/Ethernet/W5500/datasheet
How One Command Travels over the Wired Path
- Detect LoRa failure โ when the operator turns on the fill switch, the control box (ESP3) builds a 3-byte
CMD_OPEN_FILLpacket and sends it over LoRa. If RadioHead gets no ACK after its retries,sendtoWait()returns failure - Switch to wired โ ESP3 sets the link state to
COMM_CABLEand passes the same packet tosendUDPPacket() - Write to the chip โ
beginPacket(192.168.10.20, 5000),write(3 bytes),endPacket(). The data the MCU sends over SPI is the destination address and port plus the 3-byte payload; the rest is the send command and status checks - The chip builds the frame โ the W5500 resolves the peer's MAC with ARP, adds the UDP header, IP header, and Ethernet framing, and sends it out the RJ45 port
- Fiber segment โ the media converter turns it into light for the 1 km run, and the converter at the other end turns it back into Ethernet for the pad's W5500
- The chip holds the data โ the pad's W5500 checks the destination IP and port and stores the payload in its internal receive buffer
- Fetch and verify โ on every loop, the pad's ESP2 checks for arrivals with
parsePacket(), reads 3 bytes, and checks the CRC8 - Execute โ
handleCommand()processes the command with the same function used for LoRa.CMD_OPEN_FILLmoves the pad into the fill phase (FASE_ENCHENDO) when it is in the SAFE state, and the state machine turns on the fill valve relay on the next loop. From then on, the pad sends its telemetry back over the same UDP path
What the MCU does not do: ARP, building and checking IP and UDP headers, sending and receiving Ethernet frames, buffering received data
What the MCU does: build the 3-byte packet, check the CRC, decide the link state, drive the relays
Analogy: Same Envelope, Two Delivery Routes
A command packet is an envelope of a fixed size. Normally it goes by mail (LoRa). If the first attempt and all three retries come back without a delivery confirmation, the same envelope is loaded onto a dedicated delivery van (W5500 + fiber). The van's driver (the W5500) handles the address check, the route, and the packaging, so the sender (the ESP32) only has to hand over the envelope. At the other end, the envelope is opened the same way no matter which route it took, and its contents are carried out.
What If the Chip Were Not There [Inferred]
The ESP32 has a built-in Ethernet MAC, so another option would be to attach an external PHY over RMII and use lwIP.
- That would need nine RMII signal lines, including the 50 MHz reference clock (per the ESP-IDF documentation). On CRT's boards, which already use GPIOs for relays, sensors, and switches, pin assignment could get tight
- The W5500 attaches to the SPI bus LoRa already uses, adding just one CS pin. In
config.h, CRT reassigned GPIO16, 17, and 4, previously used by RS-485, to the W5500's CS, RST, and INT; the current code actually uses only CS - On the software side, the send code is three lines:
beginPacket(),write(), andendPacket()
Similar Projects on WIZnet Makers
Several projects in student rocketry and remote telemetry already build their ground links with the W5500. They place the same chip in different spots, which makes CRT's choice easier to see.
- warp-core โ launch control firmware from the Oregon State University hybrid rocket team. It links mission control and the pad with a single W5500 TCP socket on an 8-bit ATmega1284p. The biggest difference from CRT is that it has only one link and its firmware does not detect communication loss
โ Project link: https://maker.wiznet.io/scott/projects/warp-core/ - Hybrid PCC โ the hybrid rocket pad control box from the CU InSpace team at Carleton University in Canada. A wireless bridge covers the long span between mission control and the pad, and the W5500 handles the wired segment on the control box side. CRT does the opposite: it lays the W5500 and fiber across the long span itself and uses it as the backup to the radio
โ Project link: https://maker.wiznet.io/Sunny_/projects/hybrid-pcc/ - Aerostat-GCS-ESP32-TelemetryHub โ a ground control telemetry hub for a tethered aerostat. It puts the ESP32 + W5500 TCP output onto fiber through a media converter and runs it down the tether. It shares the "W5500 โ media converter โ fiber" setup with CRT, but fiber is the primary link, with no wireless backup
โ Project link: https://maker.wiznet.io/lawrence/projects/prvin-embed-aerostat-gcs-esp32-telemetryhub/
According to their maker articles, warp-core and Aerostat GCS let the W5500 handle the protocol in hardware sockets while the MCU deals only with data (this is not confirmed in public material for Hybrid PCC). What differs is where the wired link sits and what role it plays.
| Item | CRT Software (UnB) | warp-core (OSU) | Hybrid PCC (Carleton) | Aerostat GCS |
|---|---|---|---|---|
| Purpose | Hybrid rocket fill and ignition | Hybrid rocket launch control | Hybrid rocket pad control | Tethered aerostat telemetry |
| MCU | ESP32 ร3 nodes (4 boards) | ATmega1284p | RP2040 | ESP32 + Arduino Mega |
| W5500 mode | TOE | TOE | Unknown | TOE |
| Transport | UDP | TCP | Unknown | TCP |
| Long-range span | LoRa + fiber, redundant | Single wired Ethernet | Wireless bridge | Single fiber |
| Link-loss handling | Automatic ABORT (pad: 3 s after filling starts) | None in firmware | Unknown | Waits for reconnection, keeps logging to SD |
Of the four projects compared, CRT is the only one confirmed by public material to use a wired link as the backup to radio, and it defines in code what happens when both paths drop.
Use Cases
- Remote control with radio as the primary link and a wired backup โ the same structure is worth considering for engine test stands, launch sites, and equipment spread across a large site, where radio is convenient day to day but must not fail. When CRT moved its backup link from RS-485 to UDP, it kept the packet structure unchanged
- Teams replacing RS-485 with Ethernet over fiber โ CRT took this path in code and configuration. It reassigned the pins RS-485 used to the W5500 and noted a media converter and about 1 km of fiber in the configuration comments (no record of a physical build)
- Designs that share one SPI bus between a radio module and the W5500 โ an example of pin assignment that runs LoRa and Ethernet together by giving each its own CS pin
- Collaboration structure for student teams โ the shared headers and the
CONVENCOES.mdrules show one way to keep pin and packet definitions for several boards in one place
Limitations and Future Improvements
In about two months of a trainee program, CRT Software gained a three-node state machine, a redundant link, automatic ABORT, and a simulator. Pins and IP addresses are still provisional, and we found no record of physical testing, so a team turning it into field equipment should look at the following first.
1. The Heartbeat Runs One Way โ A Spot Where ABORT Can Happen on a Healthy Link
- Today: once filling has started (during filling and after it completes, including after ARM, until DISARM or ABORT), the launch pad (ESP2) aborts if it receives no packet at all for 3 seconds (
checkWatchdog()). The control box (ESP3), however, sends valve commands only when a switch changes. The only repeated sends are in the ignition state (every loop for 2 seconds) and the ABORT state (every 500 ms). Even then, when the abort was caused by communication loss, the link is inCOMM_ABORT, sosendCommand()sends nothing. PINGs go out only every 30 seconds over LoRa while in wired mode - [Inferred] Impact: if the operator turns on the fill switch and touches nothing else for 3 seconds, the pad may treat a healthy link as lost and abort. We could not confirm this behavior on real hardware
- Improvement: have the control box send a PING at a fixed interval (for example, every 500 ms) regardless of state. The pad's UDP receiver reads into a 3-byte buffer and checks the last byte as the CRC, so a 6-byte
PingPacketsent over UDP is dropped on a CRC mismatch (the LoRa path checks against the actual length and accepts PINGs). The read length and CRC position need to depend on the packet type
2. No Ignition Interlock on the Pad Side
- Today: the ARM key check lives only in the control box's state machine. The pad's
CMD_IGNITIONhandler ignores the current state and turns on the main valve and the igniter immediately - Improvement: add a one-line condition on the pad so ignition is accepted only when
g_estadoAtual == STATE_ARMED. That gives the executing side a second chance to block a bad command
3. Waiting for DHCP at Boot
- Today: both nodes call
Ethernet.begin(mac)first to try DHCP and fall back to a static IP if it fails. The Arduino Ethernet library's default DHCP timeout is 60 seconds. A point-to-point fiber link has no DHCP server, so every boot can wait up to about 60 seconds - Improvement: use a static IP from the start with
Ethernet.begin(mac, ip, dns, gateway, subnet)
โ Arduino Ethernet library Ethernet.h: https://github.com/arduino-libraries/Ethernet/blob/master/src/Ethernet.h
4. Each Node Decides the Link State on Its Own
- Today: ESP2 and ESP3 each decide when to switch to
COMM_CABLE(the control box by timer and send failure, the pad by the fill-phase timer and the path a packet arrived on). The pad sends telemetry over UDP only while it is in wired mode, so if the two nodes briefly disagree, replies can go down a different path - Improvement: send telemetry over both paths and let the receiver use whichever arrives first, or align the link state between nodes through the packet's
comm_statefield
5. Provisional Values and Documentation
- GPIO33 overlap: the tank purge NF relay and the manifold vent relay are defined on the same pin, and the code carries a TODO to check it
- Pressure conversion: a provisional formula maps the ADC value linearly to 0โ100 bar. The automatic ABORT at 58 bar depends on this value, so sensor calibration should come first
- Documentation: the CRC comment says "CRC-8/MAXIM," but the implementation uses the non-reflected polynomial 0x31. The README says the Ethernet library is "included in the ESP32 core," but it is actually pulled in separately through PlatformIO
lib_deps - The repository has no LICENSE file. Check with the team before reuse
FAQ
Q1. Why UDP instead of TCP for the backup link?
The repository does not say. [Inferred] Command packets are only 3 bytes, and the application handles integrity with CRC8 and link monitoring with watchdogs, so UDP, with no connection to manage, was probably the simpler choice. UDP has no delivery confirmation, though, and valve commands are not retransmitted. In wired mode, the only practical confirmation for a valve command is the operator checking the returned valve_state on the LEDs. ARM, ignition, and ABORT commands have no such confirmation path.
Q2. Why not just run a long LAN cable instead of fiber?
Copper Ethernet is limited by the standard to 100 m per segment. Covering 1 km in copper would take several switches along the way. A pair of media converters and a fiber cover that distance in one run and also electrically isolate the two ends. The repository does not say whether that is why CRT chose fiber.
Q3. What happens when both links are up at the same time?
Normally only LoRa is used. The pad listens on both LoRa and UDP and executes a command from either one, but the control box sends over UDP only when LoRa fails. In wired mode, the control box still sends a LoRa PING every 30 seconds, and it returns to LoRa when a PING succeeds or pad telemetry arrives over LoRa.
Q4. Can I test it without the hardware?
Yes. The control box code has a simulation mode, and a single-file Wokwi version is included. Serial key input lets you mimic the ARM key, valve switches, ABORT, and link failures and watch the state machine and LEDs respond. Actual W5500 and LoRa communication cannot be checked in the simulator.
์์ฝ
CRT Software๋ ๋ธ๋ผ์ง๋ฆฌ์๋ํ๊ต(UnB) ํ์ ๋ก์ผ ํ **Capital Rocket Team(CRT)**์ ํ์ด๋ธ๋ฆฌ๋ ๋ก์ผ ํ ๋ ๋ฉํธ๋ฆฌยท์ ์ด ์์คํ ์ ๋๋ค. ESP32 ๋ ธ๋ 3๊ฐ(๋ก์ผ ๋ ธ๋๋ MasterยทSlave ๋ณด๋ 2๊ฐ)๊ฐ ๋นํ, ๋ฐ์ฌ๋, ์ด์์ ์ญํ ์ ๋๋ ๋งก๊ณ , 1์ฐจ ๋งํฌ๋ LoRa, ์๋น ๋งํฌ๋ W5500 UDP์ ์ฝ 1km ๊ด์ฌ์ ์ ๋๋ค. ๋ ๋งํฌ๊ฐ ๊ฐ์ ํจํท๊ณผ ๊ฐ์ CRC๋ฅผ ์ค์ด ๋๋ฅด๊ณ ์ ์ก ์๋จ๋ง ๋ฐ๊ฟ ๋ผ์ฐ๋ฉฐ, ์ถฉ์ ์ ์์ํ ๋ค ๋ ๋ค ๋๊ธฐ๋ฉด ๋ฐ์ฌ๋๊ฐ ์ค์ค๋ก ์์ ์ํ๋ก ๋ค์ด๊ฐ๋ค๋ ์ ์ด ์ด ํ๋ก์ ํธ์ ํต์ฌ์ ๋๋ค.
๊ฐ์
ํ์ด๋ธ๋ฆฌ๋ ๋ก์ผ์ ๋ฐ์ฌ๋์์ **์์ฐํ์ง์(NโO)**๋ฅผ ์ถฉ์ ํฉ๋๋ค. ์ถฉ์ ์ด ์์๋๋ฉด ์ด์์๋ ๋ฉ๋ฆฌ ๋จ์ด์ง ์กฐ์ข ์์์์ ๋ฐธ๋ธ์ ์ ํ๋ฅผ ๋ค๋ค์ผ ํ๊ณ , ๊ทธ ๋ช ๋ น์ด ์ค๊ฐ๋ ํต์ ๋งํฌ๊ฐ ๋๊ธฐ๋ฉด ์ถฉ์ ์ค์ธ ์ค๋น๋ฅผ ์๊ฒฉ์ผ๋ก ๋ค๋ฃฐ ์ ์๊ฒ ๋ฉ๋๋ค.
Capital Rocket Team์ UnB ๊ฐ๋ง ๊ณต๊ณผ๋ํ(FGA)์ ํ์ ํ์ ๋๋ค. ํ์ง ์ธ๋ก ์ ์ด ํ์ด 2022๋ Latin American Space Challenge์์ ํ์ด๋ธ๋ฆฌ๋ ๋ก์ผ **"Circe"**๋ฅผ ๋ฐ์ฌํ๋ค๊ณ ๋ณด๋ํ๋ฉด์, ๋ผํด์๋ฉ๋ฆฌ์นด ์ต์ด์ ํ์ด๋ธ๋ฆฌ๋ ๋ก์ผ ๋ฐ์ฌ๋ก ์๊ฐํ์ต๋๋ค. ์ด ์ ์ฅ์๋ ๊ทธ ํ์ 2026๋ ํธ๋ ์ด๋(์ ์ ) ๊ณผ์ ์์ ๋ง๋ ์ํํธ์จ์ด์ ๋๋ค.
- ๊ฐ๋ฐ: Pedro Oliveira Melo, Joรฃo Gabryel, Cecรญlia
- ๊ธฐ๊ฐ: 2026-06-24 ์ฒซ ์ปค๋ฐ ~ 2026-08-23 ๋ง์ง๋ง ์ปค๋ฐ, ์ปค๋ฐ 30๊ฐ
- ํ๊ฒฝ: ESP32-DevKit-V1, Arduino ํ๋ ์์ํฌ, PlatformIO, Wokwi ์๋ฎฌ๋ ์ดํฐ
โ GitHub: https://github.com/joaogscosta/software-trainee-crt
โ ํ์ 2022๋
ํ์ด๋ธ๋ฆฌ๋ ๋ก์ผ ๋ฐ์ฌ ๋ณด๋(Jornal de Brasรญlia): https://jornaldebrasilia.com.br/brasilia/equipe-da-unb-lanca-primeiro-foguete-hibrido-da-america-latina/
์ ๋งํฌ๋ฅผ ๋๋ก ๋๋ด๋
์ ์ฅ์์ ์ค์ ์ฌ์ฉ
- ํ์ธ ๋ถ๊ฐ: ํ ๋ฒํธ, IP, MAC ์ฃผ์์ "์์๊ฐ, ๋ฉ๋ ์ ์ ํ๋์จ์ด ํ๊ณผ ํ์ธ" TODO๊ฐ ๋จ์ ์๊ณ , ์ ์ฅ์์ Wokwi ์๋ฎฌ๋ ์ดํฐ ์ค์ ์ด ๋ค์ด ์์ต๋๋ค. ์ค๋ฌผ ์ํ์ด๋ ๋ฐ์ฌ์ ์ฐ์๋ค๋ ๊ธฐ๋ก์ ์ฐพ์ง ๋ชปํ์ต๋๋ค
- ํ ์ค์ ์ ํ์ธ๋จ: 2022๋ ํ์ด๋ธ๋ฆฌ๋ ๋ก์ผ ๋ฐ์ฌ์, 2023๋ Spaceport America Cup ํ์ด๋ธ๋ฆฌ๋ยท์ก์ฒด ๋ถ๋ฌธ ์ถ์ ์์ ์ด ๋ณด๋๋์์ต๋๋ค
- ํ๋ ์งํ: Star 1, Fork 1, ๋ผ์ด์ ์ค ์์
โ 2023๋ ๋ํ ์ถ์ ๋ณด๋(JB): https://www.jb.com.br/ciencia-e-tecnologia/2023/06/1044266-universidades-brasileiras-disputam-copa-mundial-de-foguetes-nos-eua.html
๋ํ ๊ท์ ์ด ์๊ตฌํ๋ ๊ฒ
Spaceport America Cup(IREC)์ ์ฃผ๊ดํ๋ ESRA์ ์ค๊ณยท์ํยทํ๊ฐ ์ง์นจ(DTEG)์ ํ์ด๋ธ๋ฆฌ๋ ์ถ์ง๊ณ์ ๋ฐ์ฌ ์ฅ๋น์ ๋ค์์ ์๊ตฌํฉ๋๋ค.
| ์กฐํญ | ์๊ตฌ ๋ด์ฉ |
|---|---|
| 5.10.1 | ํ์ด๋ธ๋ฆฌ๋ยท์ก์ฒด ์ถ์ง์ ๋ชจ๋ ์ก์ฒดยท๊ธฐ์ฒด ์ถ์ง์ ๋ฅผ ์๊ฒฉ์ผ๋ก ๋ฐฐ์ถ(venting)ํ๊ฑฐ๋ ๋นผ๋ผ ์๋จ์ ๊ฐ์ถ ๊ฒ |
| 11.3.4 | ํ์ด๋ธ๋ฆฌ๋ ๋ฐ์ฌ ์ ์ด๊ธฐ๋ ์ฐํ์ ์ถฉ์ ๋ ๊ณ์ธก์ ํฌํจํ ๊ฒ |
| 11.5.3 | ์ถฉ์ ์ค ์ ์ ๋๋ ํต์ ์ด ๋๊ธฐ๋ฉด ์ฐํ์ ๋ฅผ ์๋ ๋ฐฐ์ถํ๋ ํ์ผ์ธ์ดํ๋ฅผ ๊ฐ์ถ ๊ฒ |
[์ถ์ : ์ ์ฅ์์๋ ์ด์คํ ์ด์ ๋, ์ด ๊ท์ ์ ๋ํ ์ธ๊ธ๋ ์์ต๋๋ค] ๋งํฌ๊ฐ ํ๋๋ฟ์ด๋ฉด ๊ทธ ๋งํฌ๊ฐ ๋๊ธฐ๋ ์๊ฐ ์ถฉ์ ์ค์ธ NโO๋ฅผ ์๊ฒฉ์ผ๋ก ๋ค๋ฃฐ ์ ์๊ฒ ๋ฉ๋๋ค. CRT๋ ์ ์ ๊ฒฝ๋ก๋ฅผ ํ๋ ๋ ๋๊ณ , ์ถฉ์ ์ ์์ํ ๋ค ๋ ๊ฒฝ๋ก๊ฐ ๋ชจ๋ ๋๊ธฐ๋ฉด ๋ฐ์ฌ๋๊ฐ ์ค์ค๋ก ๋ฐฐ์ถ ์ํ๋ก ๋ค์ด๊ฐ๊ฒ ํ์ต๋๋ค. 11.5.3์ด ์๊ตฌํ๋ "ํต์ ๋์ ์ ์๋ ๋ฐฐ์ถ"์ ํด๋นํ๋ ๋์์ด ์ฝ๋์ ์๋ ์ ์ ๋๋ค.
์ธ์ฉํ ํ๋ณธ์ 2025 IREC์ฉ Revision 2024 V1.1.3(2024-10-22 ๋ฐํจ)์ ๋๋ค. ํ์ด 2022๋ ์ ์ถ์ ํ Latin American Space Challenge(LASC) ๊ท์ ์ ๊ฐ์ ์กฐํญ์ด ์๋์ง๋ ํ์ธํ์ง ๋ชปํ์ต๋๋ค.
โ ESRA IREC DTEG (2024 V1.1.3): https://www.soundingrocket.org/uploads/9/0/6/4/9064598/2025_irec_dteg_v1.1.3_10-22-24.pdf
์์คํ ๊ตฌ์ฑ
- ESP1 (๋ก์ผ): ๋นํ ๋ฐ์ดํฐ๋ฅผ LoRa๋ก ์กฐ์ข ์์(ESP3)์ ๋ณด๋ ๋๋ค. ๋ํ์ฐ ์ ๊ฐ๋ ๋งก์ต๋๋ค. ๋ก์ผ ์ฝ๋์ LoRa ๋ช ๋ น ์์ ๋ถ๊ฐ ์์ง๋ง, ์กฐ์ข ์์๋ ๋ก์ผ์ ๋ช ๋ น์ ๋ณด๋ด์ง ์์ต๋๋ค
- ESP2 (๋ฐ์ฌ๋ GCU): ์ถฉ์ ๋๊ณผ ์๋ ฅ์ ์ฌ๊ณ , ๋ฆด๋ ์ด๋ก ๋ฐธ๋ธ์ ์ ํ๊ธฐ๋ฅผ ์์ง์ ๋๋ค. ์ถฉ์ ์ ์์ํ ๋ค ๋งํฌ๊ฐ ๋ชจ๋ ๋๊ธฐ๋ฉด ์ค์ค๋ก ์์ ์ํ๋ก ๊ฐ๋๋ค
- ESP3 (์กฐ์ข ์์): ์ด์์์ ์ค์์น๋ฅผ ์ฝ์ด ๋ช ๋ น์ ๋ณด๋ด๊ณ , ๋ฐ์ ํ ๋ ๋ฉํธ๋ฆฌ๋ฅผ LED์ CSV๋ก ๋ณด์ฌ ์ค๋๋ค
- ๋ ๋งํฌ๋ ESP2์ ESP3 ์ฌ์ด์๋ง ์์ต๋๋ค. ๋ก์ผ(ESP1)์ LoRa ํ๋๋ง ์๋๋ค
๊ธฐ์ ๋ฐฐ๊ฒฝ
LoRa์ RadioHead ์ ๋ขฐ ์ ์ก
LoRa๋ ์ฒํ ํ์ฐ ์คํํธ๋ผ(CSS) ๋ณ์กฐ๋ฅผ ์ฐ๋ ์ ์ ๋ ฅ ์ฅ๊ฑฐ๋ฆฌ ๋ฌด์ ๋ฐฉ์์ ๋๋ค. **ํ์ฐ ๊ณ์(SF)**๋ฅผ ๋์ด๋ฉด ๋ ๋ฉ๋ฆฌ ๊ฐ์ง๋ง ๋๋ ค์ง๊ณ , ๋ฎ์ถ๋ฉด ๋นจ๋ผ์ง๋ ๋์ ๊ฑฐ๋ฆฌ๊ฐ ์ค์ด๋ญ๋๋ค. CRT๋ SF7, ๋์ญํญ 125 kHz, ์ฝ๋ฉ๋ฅ 4/5, 17 dBm์ ์ฐ๊ณ , ์ค์ ํ์ผ ์ฃผ์์ ์ด ์กฐํฉ์ ๊ฑฐ๋ฆฌ๋ฅผ ์ฝ 1km๋ก ์ ์์ต๋๋ค.
LoRa ์์ฒด๋ ํจํท์ด ๋์ฐฉํ๋์ง ์๋ ค์ฃผ์ง ์์ต๋๋ค. ๊ทธ๋์ CRT๋ RadioHead ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ RHReliableDatagram์ ์๋๋ค. ์ด ๊ณ์ธต์ด ๋
ธ๋ ์ฃผ์, ACK, ์ฌ์๋๋ฅผ ๋ถ์
๋๋ค.
- ์ฌ์๋ 3ํ, ACK ๋๊ธฐ 200 ms (
RH_MAX_RETRIES,RH_TIMEOUT_MS) - ๋ช
๋ น ์ก์ ํจ์
sendtoWait()๊ฐ ์คํจ๋ฅผ ๋๋ ค์ฃผ๋ฉด, ์กฐ์ข ์์๋ ์ฆ์ ์ ์ ์ผ๋ก ๋์ด๊ฐ ๊ฐ์ ๋ช ๋ น์ ๋ค์ ๋ณด๋ ๋๋ค
์ ์์ด ๋ฉ๋ฆฌ ๊ฐ์ง๋ง, ์ฅ์ ๋ฌผ์ด๋ ๊ฐ์ญ์ด ์๊ธฐ๋ฉด ๋๊ธธ ์ ์์ต๋๋ค.
โ RadioHead ๋ฌธ์: https://www.airspayce.com/mikem/arduino/RadioHead/
๋ฏธ๋์ด ์ปจ๋ฒํฐ์ ์ฑ๊ธ๋ชจ๋ ๊ด์ฌ์
๊ตฌ๋ฆฌ Ethernet(100BASE-TX)์ ํ์ค์ ํ ๊ตฌ๊ฐ์ด 100 m๊น์ง์ ๋๋ค. 1km๋ฅผ ์ ์ ์ผ๋ก ์๊ธฐ ์ํด CRT๋ ๋ฏธ๋์ด ์ปจ๋ฒํฐ๋ฅผ ์๋๋ค. ๋ฏธ๋์ด ์ปจ๋ฒํฐ๋ RJ45๋ก ๋ค์ด์จ Ethernet ์ ํธ๋ฅผ ๋น์ผ๋ก ๋ฐ๊ฟ ๊ด์ฌ์ ๋ก ๋ณด๋ด๊ณ , ๋ฐ๋ํธ ์ปจ๋ฒํฐ๊ฐ ๋ค์ RJ45 ์ ํธ๋ก ๋๋๋ฆฝ๋๋ค.
- ์ฑ๊ธ๋ชจ๋ ๊ด์ฌ์ ๋ ์ km ์ด์์ ์๋ ๋ฐ ์ฐ๋ ๊ฐ๋ ์ฝ์ด์ ๊ด์ฌ์ ์ ๋๋ค
- ๊ด์ฌ์ ๋ ์ ๊ธฐ๋ฅผ ํตํ์ง ์์ผ๋ฏ๋ก, ์ ํ ํ๋ก์ ๋ฆด๋ ์ด๊ฐ ์๋ ๋ฐ์ฌ๋์ ์กฐ์ข ์์๋ฅผ ์ ๊ธฐ์ ์ผ๋ก ๋ถ๋ฆฌํ ์ ์์ต๋๋ค [์ถ์ : ์ ์ฅ์์๋ ๊ด์ฌ์ ๋ฅผ ๊ณ ๋ฅธ ์ด์ ๊ฐ ์ ํ ์์ง ์์ต๋๋ค]
- ์ ๋์ W5500์ ๊ด์ฌ์ ๋ฅผ ์ง์ ๋ค๋ฃจ์ง ์์ต๋๋ค. ์นฉ ์ ์ฅ์์๋ ๊ทธ๋ฅ RJ45 ์ผ์ด๋ธ์ด ํ๋ ๊ฝํ ์๋ ๊ฒ์ ๋๋ค
์ค์ ํ์ผ ์ฃผ์์ ๋ฐ๋ฅด๋ฉด ์ด ์๋ฆฌ๋ ์๋ RS-485(MAX485) ์ง๋ ฌ ๋งํฌ์๊ณ , Ethernet๊ณผ ๊ด์ฌ์ ๋ก ๋ฐ๋์์ต๋๋ค.
์์น๋ ๊ณผ ํ์ผ์ธ์ดํ ์ํ๋จธ์
์์น๋ ์ "์ ํด์ง ์๊ฐ ์์ ์ ํธ๊ฐ ์ค์ง ์์ผ๋ฉด ๋ฌธ์ ๊ฐ ์๊ธด ๊ฒ์ผ๋ก ๋ณธ๋ค"๋ ๊ฐ์ ์ฅ์น์ ๋๋ค. CRT๋ ์ด๋ฅผ ์ํํธ์จ์ด ํ์ด๋จธ๋ก ๊ตฌํํฉ๋๋ค.
| ์์ | ๊ฐ | ์๋ฏธ |
|---|---|---|
WATCHDOG_ESP2_MS |
3,000 ms | ์ด ์๊ฐ ๋์ ํจํท์ด ์์ผ๋ฉด ๋งํฌ๋ฅผ ๋ฐ๊พธ๊ฑฐ๋ ์ค๋จ |
CABLE_TIMEOUT_MS |
3,000 ms | (์กฐ์ข
์์) ์ ์ ์ผ๋ก ๋์ด๊ฐ ๋ค์๋ ์ด ์๊ฐ ๋์ ์์ผ๋ฉด COMM_ABORT. ๋ฐ์ฌ๋๋ ์ด ์์๋ฅผ ์ฐ์ง ์๊ณ , ๋ง์ง๋ง ํจํท์์ 3์ด๊ฐ ์ง๋๋ฉด ๋ฐ๋ก ์ค๋จ |
CABLE_RETRY_LORA_MS |
30,000 ms | ์ ์ ๋ชจ๋์์ LoRa ๋ณต๊ตฌ๋ฅผ ์๋ํ๋ ๊ฐ๊ฒฉ |
ํ์ผ์ธ์ดํ๋ "๊ณ ์ฅ์ด ๋๋ฉด ์์ ํ ์ชฝ์ผ๋ก ๊ฐ๋ค"๋ ์ค๊ณ ์์น์
๋๋ค. CRT ๋ฐ์ฌ๋์ ์์ ์ํ ํจ์ executeSafeState()๋ ๋ค์์ ํ ๋ฒ์ ํฉ๋๋ค.
- ์ถฉ์ ๋ฐธ๋ธ ๋ซํ, ๋ฉ์ธ ๋ฐธ๋ธ ๋ซํ, ์ ํ๊ธฐ ๊บผ์ง
- ๋ฒคํธ ์ด๋ฆผ, ํฑํฌ ํผ์ง์ ๋ผ์ธ ํผ์ง ์ด๋ฆผ โ ํฑํฌ์ ์๋ ฅ์ ๋นผ๋ ๋ฐฉํฅ
config.h ์ฃผ์์ ๋ฐ๋ฅด๋ฉด ํฑํฌ ํผ์ง ๋ฐธ๋ธ๋ NA(ํ์์ ์ด๋ฆผ) ํ์ด๋ผ ์ ์์ด ๋๊ธฐ๋ฉด ์ด๋ฆฌ๋๋ก ๋์ด ์์ต๋๋ค(๋ฒคํธ๋ NFํ์ด๋ผ ์ ์์ด ๋๊ธฐ๋ฉด ๋ซํ๋๋ค). ๋ค๋ง ์ถฉ์ ์ค์๋ ์ด ๋ฆด๋ ์ด๋ฅผ ํต์ ํด ํผ์ง๋ฅผ ๋ซ์ ๋๋ฏ๋ก, ์ ์์ด ์ด์ ์๋ ์ฑ๋ก MCU๊ฐ ๋ฉ์ถ๋ฉด ๋ซํ ์ํ๊ฐ ์ ์ง๋ฉ๋๋ค.
๊ธฐ์ ํน์ง
- ๊ณต์ ํค๋ ๋ ๊ฐ๋ก ์ธ ๋
ธ๋๋ฅผ ๋ฌถ์:
config.h(ํ, LoRa ์ค์ , IP, ์ง๋ยท์๋ ฅ ํ๊ณ, ํ์ด๋ฐ)์packet_protocol.h(ํจํท ๊ตฌ์กฐ์ฒด, ์ํยท๋ช ๋ น ์ฝ๋, CRC8)๋ฅผ ์ธ ๋ ธ๋๊ฐ ์๋ ๊ฒฝ๋ก๋ก ํจ๊ป ํฌํจํฉ๋๋ค. "์ด ํ์ผ ๋ฐ์์ ํ์ด๋ ํจํท์ ์ ์ํ์ง ์๋๋ค"๋ ๊ท์น์CONVENCOES.md๋ก ๋ฌธ์ํํ์ต๋๋ค - ์ ์ก ์๋จ๊ณผ ๋ฌด๊ดํ ํจํท: ๋ช
๋ น์
[์ ํ 1B][๋ช ๋ น ID 1B][CRC8 1B]์ 3๋ฐ์ดํธCommandPacket์ ๋๋ค. LoRa๋ก ๋ณด๋ด๋ UDP๋ก ๋ณด๋ด๋ ๊ฐ์ ๊ตฌ์กฐ์ฒด๋ฅผ ๊ทธ๋๋ก ์๋๋ค - ์ค์ ๋ฐธ๋ธ ์ํ๋ฅผ ๋๋๋ ค ๋ฐ์: ๋ฐ์ฌ๋๋ ๋ฆด๋ ์ด ํ์ ์ง์ ์ฝ์ด 5๋นํธ
valve_state๋ก ๋๋ ค๋ณด๋ ๋๋ค. ์กฐ์ข ์์๋ ์ด๊ฒ์ ์ด์์๊ฐ ์ผ ์ค์์น์ ๋น๊ตํด LED๋ฅผ ๊บผ์ง(์ค์์น ๊บผ์งยท๋ฐ์ฌ๋ ๋ซํ) / ๊น๋นก์(์ค์์น ์์น์ ๋ฐ์ฌ๋ ๋ณด๊ณ ๊ฐ ๋ค๋ฆ) / ์ผ์ง(์ค์์น ์ผ์งยท๋ฐ์ฌ๋ ์ด๋ฆผ ํ์ธ) ์ธ ๊ฐ์ง๋ก ๋ณด์ฌ ์ค๋๋ค - ์๋ฌด ์ํ๋จธ์ :
BOOT โ SAFE โ ARMED โ IGNITION โ READY_TO_LAUNCH โ LAUNCHED, ๊ทธ๋ฆฌ๊ณ BOOT๋ฅผ ๋บ ๋ชจ๋ ์ํ์์ABORTED๋ก ๊ฐ ์ ์์ต๋๋ค. ์กฐ์ข ์์๋ ์๋ ABORT ๋ฒํผ, ๋งค๋ํด๋ ์๋ ฅ 58 bar ์ด์, ํต์ ๋์ ์ค ํ๋๋ผ๋ ๊ฑธ๋ฆฌ๋ฉด ABORT๋ก ๊ฐ๋๋ค - ๊ด๋ฆฌ ํด๋์ค ๋ถ๋ฆฌ: ์กฐ์ข
์์ ์ฝ๋๋ฅผ
CommManager,MissionManager,InputManager,LedManager,TelemetryManager๋ก ๋๋ด์ต๋๋ค - ์ค๋ฌผ ์์ด ์ํ: ์๋ฎฌ๋ ์ด์ ๋ชจ๋์ Wokwi์ฉ ๋จ์ผ ํ์ผ ๋ฒ์ (1,054์ค)์ด ์์ด, ์๋ฆฌ์ผ ํค ์ ๋ ฅ์ผ๋ก ์ค์์น์ ๋งํฌ ์ฅ์ ๋ฅผ ํ๋ด ๋ผ ์ ์์ต๋๋ค
W5500์ด ๋งก์ ์ผ
TOE ์ฌ์ฉ ํ์ : ์
CRT๋ W5500์ ํ๋์จ์ด TCP/IP ์คํ๋ก๋(TOE) ์นฉ์ผ๋ก ์๋๋ค.
- ๋ ๋
ธ๋ ๋ชจ๋ Arduino
Ethernet๋ผ์ด๋ธ๋ฌ๋ฆฌ(arduino-libraries/Ethernet)์Ethernet.init(),Ethernet.begin(),EthernetUDP๋ฅผ ์๋๋ค. ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ W5500 ๋ด๋ถ์ ํ๋์จ์ด ์์ผ์ UDP ๋ชจ๋๋ก ์ด์ด ์๋๋ค - ESP32์๋ ์์ฒด TCP/IP ์คํ(lwIP)๊ณผ Ethernet MAC์ด ์์ง๋ง, ์ด ๋งํฌ๋ ๊ทธ์ชฝ(
ETH.h,esp_eth)์ ์ฐ์ง ์์ต๋๋ค. W5500 ๋ฐ์ดํฐ์ํธ๊ฐ ๋ฐํ ๋๋ก UDPยทIPยทARP ์ฒ๋ฆฌ๋ ์นฉ์ด ํฉ๋๋ค
์ค์ ๊ฐ
| ํญ๋ชฉ | ๊ฐ | ์์น |
|---|---|---|
| ์นฉ | W5500 2๊ฐ (ESP2, ESP3์ ํ๋์ฉ) | UnidadeDeControle.ino, CommManager.cpp |
| ์ ์ก | UDP, ํฌํธ 5000 | config.h |
| ์ฃผ์ | ESP3 192.168.10.10, ESP2 192.168.10.20, /24, ๊ฒ์ดํธ์จ์ด ์์ | config.h |
| SPI | LoRa์ ๊ฐ์ ๋ฒ์ค(SCK 18, MISO 19, MOSI 23), W5500 CS = GPIO16 | config.h |
| ๋ฌผ๋ฆฌ ๊ตฌ๊ฐ | RJ45 โ ๋ฏธ๋์ด ์ปจ๋ฒํฐ โ ์ฑ๊ธ๋ชจ๋ ๊ด์ฌ์ ์ฝ 1km โ ๋ฏธ๋์ด ์ปจ๋ฒํฐ โ RJ45 | config.h ์ฃผ์ |
ํ, IP, MAC์ ๋ชจ๋ "์์๊ฐ" TODO ์ํ์ ๋๋ค.
โ W5500 ๋ฐ์ดํฐ์ํธ: https://docs.wiznet.io/Product/Chip/Ethernet/W5500/datasheet
๋ช ๋ น ํ๋๊ฐ ์ ์ ์ผ๋ก ๊ฐ๋ ์์
- LoRa ์คํจ ๊ฐ์ง โ ์ด์์๊ฐ ์ถฉ์ ์ค์์น๋ฅผ ์ผ๋ฉด ์กฐ์ข
์์(ESP3)๊ฐ 3๋ฐ์ดํธ
CMD_OPEN_FILLํจํท์ ๋ง๋ค์ด LoRa๋ก ๋ณด๋ ๋๋ค. RadioHead๊ฐ ์ฌ์๋ 3ํ ๋์ ACK๋ฅผ ๋ฐ์ง ๋ชปํ๋ฉดsendtoWait()๊ฐ ์คํจ๋ฅผ ๋๋ ค์ค๋๋ค - ์ ์ ์ผ๋ก ์ ํ โ ESP3๊ฐ ๋งํฌ ์ํ๋ฅผ
COMM_CABLE๋ก ๋ฐ๊พธ๊ณ , ๊ฐ์ ํจํท์sendUDPPacket()์ผ๋ก ๋๊น๋๋ค - ์นฉ์ ์ฐ๊ธฐ โ
beginPacket(192.168.10.20, 5000),write(3๋ฐ์ดํธ),endPacket(). MCU๊ฐ SPI๋ก ๋๊ธฐ๋ ๋ฐ์ดํฐ๋ ๋ชฉ์ ์ง ์ฃผ์ยทํฌํธ์ 3๋ฐ์ดํธ ํ์ด๋ก๋์ด๊ณ , ๋๋จธ์ง๋ ์ก์ ๋ช ๋ น๊ณผ ์ํ ํ์ธ์ ๋๋ค - ์นฉ์ด ํ๋ ์ ์์ฑ โ W5500์ด ARP๋ก ์๋ MAC์ ์ฐพ๊ณ , UDP ํค๋ยทIP ํค๋ยทEthernet ํ๋ ์์ ๋ถ์ฌ RJ45๋ก ๋ด๋ณด๋ ๋๋ค
- ๊ด์ฌ์ ๊ตฌ๊ฐ โ ๋ฏธ๋์ด ์ปจ๋ฒํฐ๊ฐ ๋น์ผ๋ก ๋ฐ๊ฟ 1km๋ฅผ ๋ณด๋ด๊ณ , ๋ฐ๋ํธ ์ปจ๋ฒํฐ๊ฐ ๋ค์ Ethernet์ผ๋ก ๋๋ ค ๋ฐ์ฌ๋ W5500์ ๋ฃ์ต๋๋ค
- ์นฉ์ด ์์ ๋ณด๊ด โ ๋ฐ์ฌ๋ W5500์ด ๋ชฉ์ ์ง IP์ ํฌํธ๋ฅผ ํ์ธํ๊ณ , ํ์ด๋ก๋๋ฅผ ๋ด๋ถ ์์ ๋ฒํผ์ ๋ณด๊ดํฉ๋๋ค
- ๊บผ๋ด๊ธฐ์ ๊ฒ์ฆ โ ๋ฐ์ฌ๋ ESP2๊ฐ ๋ฃจํ๋ง๋ค
parsePacket()์ผ๋ก ๋์ฐฉ ์ฌ๋ถ๋ฅผ ํ์ธํ๊ณ , 3๋ฐ์ดํธ๋ฅผ ์ฝ์ด CRC8์ ๋ง์ถฐ ๋ด ๋๋ค - ์คํ โ
handleCommand()๊ฐ LoRa๋ก ๋ฐ์์ ๋์ ๊ฐ์ ํจ์๋ก ๋ช ๋ น์ ์ฒ๋ฆฌํฉ๋๋ค.CMD_OPEN_FILL์ ๋ฐ์ฌ๋๊ฐ SAFE ์ํ์ผ ๋ ์ถฉ์ ๋จ๊ณ(FASE_ENCHENDO)๋ก ๋ฐ๊พธ๊ณ , ๋ค์ ๋ฃจํ์ ์ํ๋จธ์ ์ด ์ถฉ์ ๋ฐธ๋ธ ๋ฆด๋ ์ด๋ฅผ ์ผญ๋๋ค. ๋ฐ์ฌ๋๋ ์ดํ ํ ๋ ๋ฉํธ๋ฆฌ๋ฅผ ๊ฐ์ UDP ๊ฒฝ๋ก๋ก ๋๋ ค๋ณด๋ ๋๋ค
MCU๊ฐ ํ์ง ์๋ ์ผ: ARP, IPยทUDP ํค๋ ์์ฑ๊ณผ ํ์ธ, Ethernet ํ๋ ์ ์ก์์ , ์์ ๋ฐ์ดํฐ ๋ฒํผ๋ง
MCU๊ฐ ํ๋ ์ผ: 3๋ฐ์ดํธ ํจํท ๋ง๋ค๊ธฐ, CRC ํ์ธ, ๋งํฌ ์ํ ํ๋จ, ๋ฆด๋ ์ด ๊ตฌ๋
๋น์ : ๊ฐ์ ๋ดํฌ, ๋ ๊ฐ์ ๋ฐฐ์ก ๊ฒฝ๋ก
๋ช ๋ น ํจํท์ ๊ท๊ฒฉ์ด ์ ํด์ง ๋ดํฌ์ ๋๋ค. ํ์์๋ ์ฐํธ(LoRa)์ผ๋ก ๋ณด๋ ๋๋ค. ์ฐํธ์ด ์ฒ์ ํ ๋ฒ๊ณผ ์ฌ์๋ ์ธ ๋ฒ ๋ชจ๋ ๋ฐฐ๋ฌ ํ์ธ์ ๋ชป ๋ฐ์ผ๋ฉด, ๊ฐ์ ๋ดํฌ๋ฅผ **์ ์ฉ ๋ฐฐ์ก์ฐจ(W5500 + ๊ด์ฌ์ )**์ ์ฃ์ต๋๋ค. ๋ฐฐ์ก์ฐจ ์ด์ ์ฌ(W5500)๊ฐ ์ฃผ์ ํ์ธ, ๊ธธ ์ฐพ๊ธฐ, ํฌ์ฅ์ ๋ค ํ๋ฏ๋ก, ๋ณด๋ด๋ ์ฌ๋(ESP32)์ ๋ดํฌ๋ฅผ ๊ฑด๋ค๊ธฐ๋ง ํ๋ฉด ๋ฉ๋๋ค. ๋ฐ๋ ์ชฝ์ ์ด๋ ๊ฒฝ๋ก๋ก ์๋ ๊ฐ์ ๋ฐฉ์์ผ๋ก ๋ดํฌ๋ฅผ ์ด๊ณ ๋ด์ฉ์ ์คํํฉ๋๋ค.
๋ง์ฝ ์ด ์นฉ์ด ์์๋ค๋ฉด [์ถ์ ]
ESP32๋ Ethernet MAC์ ๋ด์ฅํ๊ณ ์์ด, ์ธ๋ถ PHY ์นฉ์ RMII๋ก ๋ถ์ด๊ณ lwIP๋ฅผ ์ฐ๋ ๋ฐฉ๋ฒ๋ ์์ต๋๋ค.
- ๊ทธ ๊ฒฝ์ฐ 50 MHz ๊ธฐ์ค ํด๋ก์ ํฌํจํ RMII ์ ํธ์ 9๊ฐ(ESP-IDF ๋ฌธ์ ๊ธฐ์ค)๊ฐ ํ์ํ๊ณ , ๋ฆด๋ ์ดยท์ผ์ยท์ค์์น์ ์ด๋ฏธ GPIO๋ฅผ ์ฐ๊ณ ์๋ CRT ๋ณด๋์์๋ ํ ๋ฐฐ์ ์ด ๋น ๋ฏํด์ง ์ ์์ต๋๋ค
- W5500์ LoRa๊ฐ ์ด๋ฏธ ์ฐ๋ SPI ๋ฒ์ค์ CS ํ ํ๋๋ง ๋ํด ๋ถ์ต๋๋ค. CRT๋
config.h์์ RS-485๊ฐ ์ฐ๋ GPIO16ยท17ยท4๋ฅผ W5500์ CSยทRSTยทINT๋ก ์ฌ๋ฐฐ์ ํ๊ณ , ํ์ฌ ์ฝ๋๊ฐ ์ค์ ๋ก ์ฐ๋ ๊ฒ์ CS ํ๋์ ๋๋ค - ์ํํธ์จ์ด ์ชฝ์์๋ ์ก์ ์ฝ๋๊ฐ
beginPacket()ยทwrite()ยทendPacket()์ธ ์ค์ ๋๋ค
WIZnet Makers ์ ์ฌ ์ฌ๋ก
ํ์ ๋ก์ผ ํ๊ณผ ์๊ฒฉ ๊ณ์ธก ๋ถ์ผ์์ W5500์ผ๋ก ์ง์ ๋งํฌ๋ฅผ ๋ง๋ ์ฌ๋ก๊ฐ ์์ต๋๋ค. ๊ฐ์ ์นฉ์ ์๋ก ๋ค๋ฅธ ์์น์ ๋ ์ฌ๋ก๋ค์ด๋ผ ํจ๊ป ์ฝ์ผ๋ฉด CRT์ ์ ํ์ด ์ ๋ณด์ ๋๋ค.
- warp-core โ ์ค๋ฆฌ๊ฑด์ฃผ๋ฆฝ๋ ํ์ด๋ธ๋ฆฌ๋ ๋ก์ผ ํ์ ๋ฐ์ฌ ์ ์ด ํ์จ์ด์
๋๋ค. 8๋นํธ ATmega1284p์ W5500 TCP ์์ผ ํ๋๋ก ๊ด์ ์ ๋ฐ์ฌ๋๋ฅผ ์์ต๋๋ค. ๋งํฌ๊ฐ ํ๋๋ฟ์ด๊ณ ํ์จ์ด๊ฐ ํต์ ๋์ ์ ๊ฐ์งํ์ง ์๋๋ค๋ ์ ์ด CRT์ ๊ฐ์ฅ ํฌ๊ฒ ๋ค๋ฆ
๋๋ค
โ ํ๋ก์ ํธ ๋งํฌ: https://maker.wiznet.io/scott/projects/warp-core/ - Hybrid PCC โ ์บ๋๋ค ์นผํด๋ CU InSpace ํ์ ํ์ด๋ธ๋ฆฌ๋ ๋ก์ผ ๋ฐ์ฌ๋ ์ ์ด ์์์
๋๋ค. ๊ด์ ์ ๋ฐ์ฌ๋ ์ฌ์ด์ ์ฅ๊ฑฐ๋ฆฌ ๊ตฌ๊ฐ์ ๋ฌด์ ๋ธ๋ฆฌ์ง๊ฐ ๋งก๊ณ , W5500์ ์ ์ด ์์ ์ชฝ ์ ์ ๊ตฌ๊ฐ์ ๋งก์ต๋๋ค. CRT๋ ๋ฐ๋๋ก ์ฅ๊ฑฐ๋ฆฌ ๊ตฌ๊ฐ ์์ฒด์ W5500๊ณผ ๊ด์ฌ์ ๋ฅผ ๊น์ ๋ฌด์ ์ ์๋น ๊ฒฝ๋ก๋ก ์๋๋ค
โ ํ๋ก์ ํธ ๋งํฌ: https://maker.wiznet.io/Sunny_/projects/hybrid-pcc/ - Aerostat-GCS-ESP32-TelemetryHub โ ๊ณ๋ฅ ๊ธฐ๊ตฌ(aerostat)์ ์ง์ ๊ด์ ํ
๋ ๋ฉํธ๋ฆฌ ํ๋ธ์
๋๋ค. ESP32 + W5500 TCP ์ถ๋ ฅ์ ๋ฏธ๋์ด ์ปจ๋ฒํฐ๋ก ๊ด์ฌ์ ์ ์ค์ด ํ
๋๋ฅผ ๋ฐ๋ผ ๋ด๋ ค๋ณด๋
๋๋ค. CRT์ ๊ฐ์ "W5500 โ ๋ฏธ๋์ด ์ปจ๋ฒํฐ โ ๊ด์ฌ์ " ๊ตฌ์ฑ์ด์ง๋ง, ๋ฌด์ ๋ฐฑ์
์์ด ๊ด์ฌ์ ๊ฐ ์ฃผ ๋งํฌ์
๋๋ค
โ ํ๋ก์ ํธ ๋งํฌ: https://maker.wiznet.io/lawrence/projects/prvin-embed-aerostat-gcs-esp32-telemetryhub/
๊ฐ maker ๊ธ์ ๋ฐ๋ฅด๋ฉด warp-core์ Aerostat GCS๋ W5500์ด ํ๋์จ์ด ์์ผ์ผ๋ก ํ๋กํ ์ฝ์ ์ฒ๋ฆฌํ๊ณ MCU๋ ๋ฐ์ดํฐ๋ง ๋ค๋ฃน๋๋ค(Hybrid PCC๋ ๊ณต๊ฐ ์๋ฃ๋ก ํ์ธ๋์ง ์์ต๋๋ค). ์ฐจ์ด๋ ์ ์ ์ ์ด๋์, ์ด๋ค ์ญํ ๋ก ๋๋๋์ ๋๋ค.
| ํญ๋ชฉ | CRT Software (UnB) | warp-core (OSU) | Hybrid PCC (Carleton) | Aerostat GCS |
|---|---|---|---|---|
| ์ฉ๋ | ํ์ด๋ธ๋ฆฌ๋ ๋ก์ผ ์ถฉ์ ยท์ ํ | ํ์ด๋ธ๋ฆฌ๋ ๋ก์ผ ๋ฐ์ฌ ์ ์ด | ํ์ด๋ธ๋ฆฌ๋ ๋ก์ผ ๋ฐ์ฌ๋ ์ ์ด | ๊ณ๋ฅ ๊ธฐ๊ตฌ ํ ๋ ๋ฉํธ๋ฆฌ |
| MCU | ESP32 ๋ ธ๋ ร3(๋ณด๋ 4๊ฐ) | ATmega1284p | RP2040 | ESP32 + Arduino Mega |
| W5500 ๋ชจ๋ | TOE | TOE | ๋ฏธ์ | TOE |
| ์ ์ก | UDP | TCP | ๋ฏธ์ | TCP |
| ์ฅ๊ฑฐ๋ฆฌ ๊ตฌ๊ฐ | LoRa + ๊ด์ฌ์ ์ด์คํ | ์ ์ Ethernet ํ๋ | ๋ฌด์ ๋ธ๋ฆฌ์ง | ๊ด์ฌ์ ํ๋ |
| ํต์ ๋์ ์ฒ๋ฆฌ | ์๋ ABORT(๋ฐ์ฌ๋: ์ถฉ์ ์์ ํ 3์ด) | ํ์จ์ด์ ์์ | ๋ฏธ์ | ์ฌ์ ์ ๋๊ธฐ, SD ๊ธฐ๋ก ์ง์ |
๋น๊ตํ ๋ค ์ฌ๋ก ์ค ์ ์ ์ ๋ฌด์ ์ ์๋น ๊ฒฝ๋ก๋ก ๋ ๊ฒ์ด ๊ณต๊ฐ ์๋ฃ๋ก ํ์ธ๋๋ ๊ฒ์ CRT๋ฟ์ด๊ณ , ๋ ๊ฒฝ๋ก๊ฐ ๋ชจ๋ ๋๊ฒผ์ ๋์ ๋์๊น์ง ์ฝ๋๋ก ์ ํด ๋์์ต๋๋ค.
์ด๋์ ์ฐ๋
- ๋ฌด์ ์ด ์ฃผ ๋งํฌ์ด๊ณ ์ ์ ์ ์๋น๋ก ๋๋ ์๊ฒฉ ์ ์ด โ ์์ง ์ํ๋, ๋ฐ์ฌ์ฅ, ๋์ ๋ถ์ง์ ํ์ฅ ์ค๋น์ฒ๋ผ ํ์์๋ ๋ฌด์ ์ด ํธํ์ง๋ง ๋๊ธฐ๋ฉด ์ ๋๋ ๊ณณ์ ๊ฐ์ ๊ตฌ์กฐ๋ฅผ ๊ฒํ ํด ๋ณผ ์ ์์ต๋๋ค. CRT๋ ์๋น ๋งํฌ๋ฅผ RS-485์์ UDP๋ก ๋ฐ๊ฟ ๋ ํจํท ๊ตฌ์กฐ๋ฅผ ๊ทธ๋๋ก ์ ์งํ์ต๋๋ค
- RS-485๋ฅผ Ethernet๊ณผ ๊ด์ฌ์ ๋ก ๋ฐ๊พธ๋ ค๋ ํ โ CRT๊ฐ ์ฝ๋์ ์ค์ ์์ ๋ฐ์ ๊ฒฝ๋ก์ ๋๋ค. RS-485๊ฐ ์ฐ๋ ํ์ W5500์ ์ฌ๋ฐฐ์ ํ๊ณ , ์ค์ ์ฃผ์์ ๋ฏธ๋์ด ์ปจ๋ฒํฐ์ ๊ด์ฌ์ ์ฝ 1km ๊ตฌ์ฑ์ ์ ์ด ๋์์ต๋๋ค(์ค๋ฌผ ๊ตฌ์ถ ๊ธฐ๋ก์ ์์)
- ๋ฌด์ ๋ชจ๋๊ณผ W5500์ ํ SPI ๋ฒ์ค์ ํจ๊ป ๋๋ ์ค๊ณ โ CS ํ๋ง ๋๋ LoRa์ Ethernet์ ํจ๊ป ์ฐ๋ ํ ๋ฐฐ์น์ ์์ ๋๋ค
- ํ์ ํ์ ํ์
๊ตฌ์กฐ โ ๊ณต์ ํค๋์
CONVENCOES.md๊ท์น์ผ๋ก ์ฌ๋ฌ ๋ณด๋์ ํยทํจํท ์ ์๋ฅผ ํ๊ณณ์ ๋ฌถ๋ ๋ฐฉ์์ ์ฐธ๊ณ ํ ์ ์์ต๋๋ค
ํ๊ณ์ ๊ฐ์ ๋ฐฉํฅ
CRT Software๋ ๋ ๋ฌ ๋จ์งํ ํธ๋ ์ด๋ ๊ณผ์ ์์ 3๋ ธ๋ ์ํ๋จธ์ , ์ด์คํ ๋งํฌ, ์๋ ABORT, ์๋ฎฌ๋ ์ดํฐ๊น์ง ๊ฐ์ถ ์ ์ฅ์์ ๋๋ค. ํยทIP๊ฐ ์์ง ์์๊ฐ์ด๊ณ ์ค๋ฌผ ์ํ ๊ธฐ๋ก๋ ์ฐพ์ง ๋ชปํ์ผ๋ฏ๋ก, ์ค์ ์ฅ๋น๋ก ๋ค๋ฌ์ ๋ ์๋๋ฅผ ๋จผ์ ๋ณด๋ ๊ฒ์ด ์ข์ต๋๋ค.
1. ํํธ๋นํธ๊ฐ ํ์ชฝ์๋ง ์๋ค โ ์ ์ ๋งํฌ์์๋ ABORT๊ฐ ๋ ์ ์๋ ์ง์
- ํ์ฌ: ๋ฐ์ฌ๋(ESP2)๋ ์ถฉ์ ์ ์์ํ ๋ค(์ถฉ์ ์ค๊ณผ ์ถฉ์ ์๋ฃ ํ, ARM ์ดํ ํฌํจ, DISARM์ด๋ ABORT ์ ๊น์ง) 3์ด ๋์ ํจํท์ ํ๋๋ ๋ฐ์ง ๋ชปํ๋ฉด ABORTํฉ๋๋ค(
checkWatchdog()). ๊ทธ๋ฐ๋ฐ ์กฐ์ข ์์(ESP3)๋ ๋ฐธ๋ธ ๋ช ๋ น์ ์ค์์น๊ฐ ๋ฐ๋ ๋๋ง ๋ณด๋ด๊ณ , ๋ฐ๋ณตํด์ ๋ณด๋ด๋ ๊ฒ์ ์ ํ ์ํ(2์ด ๋์ ๋ฃจํ๋ง๋ค)์ ABORT ์ํ(500 ms๋ง๋ค)๋ฟ์ ๋๋ค. ๊ทธ๋๋ง ํต์ ๋์ ๋ก ABORT๋ ๊ฒฝ์ฐ์๋ ๋งํฌ๊ฐCOMM_ABORT๋ผsendCommand()๊ฐ ์๋ฌด๊ฒ๋ ๋ณด๋ด์ง ์์ต๋๋ค. PING๋ ์ ์ ๋ชจ๋์์ 30์ด๋ง๋ค LoRa๋ก ๋ณด๋ผ ๋๋ง ๋๊ฐ๋๋ค - [์ถ์ ] ์ํฅ: ์ถฉ์ ์ค์์น๋ฅผ ์ผ ๋ค 3์ด ์์ ๋ค๋ฅธ ์กฐ์์ด ์์ผ๋ฉด, ๋งํฌ๊ฐ ๋ฉ์ฉกํด๋ ๋ฐ์ฌ๋๊ฐ ํต์ ๋์ ๋ก ํ๋จํด ABORTํ ์ ์์ต๋๋ค. ์ค๋ฌผ์์ ์ด๋ ๊ฒ ๋์ํ๋์ง๋ ํ์ธํ์ง ๋ชปํ์ต๋๋ค
- ๊ฐ์ ๋ฐฉํฅ: ์กฐ์ข
์์๊ฐ ์ํ์ ๊ด๊ณ์์ด ์ฃผ๊ธฐ์ ์ผ๋ก(์: 500 ms) PING์ ๋ณด๋ด๋๋ก ํฉ๋๋ค. ๋ฐ์ฌ๋์ UDP ์์ ๋ถ๋ 3๋ฐ์ดํธ ๋ฒํผ๋ก๋ง ์ฝ๊ณ ๊ทธ ๋ง์ง๋ง ๋ฐ์ดํธ๋ฅผ CRC๋ก ๊ฒ์ฌํ๋ฏ๋ก, 6๋ฐ์ดํธ
PingPacket์ UDP๋ก ๋ณด๋ด๋ฉด CRC ๋ถ์ผ์น๋ก ๋ฒ๋ ค์ง๋๋ค(LoRa ๊ฒฝ๋ก๋ ๊ธธ์ด์ ๋ง์ถฐ ๊ฒ์ฌํ๋ฏ๋ก PING์ ๋ฐ์ต๋๋ค). ํจํท ์ ํ๋ณ๋ก ์ฝ๋ ๊ธธ์ด์ CRC ์์น๋ฅผ ๋๋ ์ผ ํฉ๋๋ค
2. ๋ฐ์ฌ๋ ์ชฝ์ ์ ํ ์ธํฐ๋ก์ด ์๋ค
- ํ์ฌ: ARM ํค ํ์ธ์ ์กฐ์ข
์์์ ์ํ๋จธ์ ์๋ง ์์ต๋๋ค. ๋ฐ์ฌ๋์
CMD_IGNITION์ฒ๋ฆฌ๋ ํ์ฌ ์ํ๋ฅผ ๋ณด์ง ์๊ณ ๋ฉ์ธ ๋ฐธ๋ธ์ ์ ํ๊ธฐ๋ฅผ ๋ฐ๋ก ์ผญ๋๋ค - ๊ฐ์ ๋ฐฉํฅ: ๋ฐ์ฌ๋์์๋
g_estadoAtual == STATE_ARMED์ผ ๋๋ง ์ ํ๋ฅผ ๋ฐ๋๋ก ํ ์ค ์กฐ๊ฑด์ ๋ฃ์ต๋๋ค. ๋ช ๋ น์ด ์๋ชป ๋ค์ด์๋ ์คํ ์ชฝ์์ ํ ๋ฒ ๋ ๋ง๋ ๊ตฌ์กฐ๊ฐ ๋ฉ๋๋ค
3. ๋ถํ ๋ DHCP๋ฅผ ๊ธฐ๋ค๋ฆฐ๋ค
- ํ์ฌ: ๋ ๋
ธ๋ ๋ชจ๋
Ethernet.begin(mac)์ผ๋ก ๋จผ์ DHCP๋ฅผ ์๋ํ๊ณ , ์คํจํ๋ฉด ๊ณ ์ IP๋ก ๋์ด๊ฐ๋๋ค. Arduino Ethernet ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ DHCP ๊ธฐ๋ณธ ํ์์์์ 60์ด์ ๋๋ค. ์ ๋์ ๊ด ๋งํฌ์๋ DHCP ์๋ฒ๊ฐ ์์ผ๋ฏ๋ก ๋ถํ ํ ๋๋ง๋ค ์ต๋ ์ฝ 60์ด๋ฅผ ๊ธฐ๋ค๋ฆฌ๊ฒ ๋ฉ๋๋ค - ๊ฐ์ ๋ฐฉํฅ: ์ฒ์๋ถํฐ
Ethernet.begin(mac, ip, dns, gateway, subnet)์ผ๋ก ๊ณ ์ IP๋ฅผ ์๋๋ค
โ Arduino Ethernet ๋ผ์ด๋ธ๋ฌ๋ฆฌ Ethernet.h: https://github.com/arduino-libraries/Ethernet/blob/master/src/Ethernet.h
4. ๋งํฌ ํ๋จ์ ๋ ๋ ธ๋๊ฐ ๋ฐ๋ก ํ๋ค
- ํ์ฌ: ESP2์ ESP3๊ฐ
COMM_CABLE์ ํ์ ๋ฐ๋ก ์ ํฉ๋๋ค(์กฐ์ข ์์๋ ํ์ด๋จธ์ ์ก์ ์คํจ๋ก, ๋ฐ์ฌ๋๋ ์ถฉ์ ์ค ํ์ด๋จธ์ ํจํท์ด ๋ค์ด์จ ๊ฒฝ๋ก๋ก). ๋ฐ์ฌ๋๋ ์๊ธฐ๊ฐ ์ ์ ๋ชจ๋์ผ ๋๋ง UDP๋ก ํ ๋ ๋ฉํธ๋ฆฌ๋ฅผ ๋ณด๋ด๋ฏ๋ก, ๋ ๋ ธ๋์ ํ๋จ์ด ์ ๊น ์ด๊ธ๋๋ฉด ์๋ต์ด ๋ค๋ฅธ ๊ฒฝ๋ก๋ก ๊ฐ ์ ์์ต๋๋ค - ๊ฐ์ ๋ฐฉํฅ: ํ
๋ ๋ฉํธ๋ฆฌ๋ฅผ ๋ ๊ฒฝ๋ก๋ก ๋์์ ๋ณด๋ด๊ณ ๋ฐ๋ ์ชฝ์ด ๋จผ์ ์จ ๊ฒ์ ์ฐ๊ฑฐ๋, ๋งํฌ ์ํ๋ฅผ ํจํท์
comm_stateํ๋๋ก ์๋ก ๋ง์ถฅ๋๋ค
5. ์์๊ฐ๊ณผ ๋ฌธ์
- GPIO33 ๊ฒน์นจ: ํฑํฌ ํผ์ง NF ๋ฆด๋ ์ด์ ๋งค๋ํด๋ ๋ฒคํธ ๋ฆด๋ ์ด๊ฐ ๊ฐ์ ํ์ผ๋ก ์ ์๋์ด ์๊ณ , ์ฝ๋์๋ ํ์ธํ๋ผ๋ TODO๊ฐ ์์ต๋๋ค
- ์๋ ฅ ๋ณํ์: ADC ๊ฐ์ 0~100 bar๋ก ๋จ์ ๋น๋ก ๋ณํํ๋ ์์์์ ๋๋ค. 58 bar ์๋ ABORT๊ฐ ์ด ๊ฐ์ ๊ธฐ๋๋ฏ๋ก ์ผ์ ๋ณด์ ์ด ๋จผ์ ์ ๋๋ค
- ๋ฌธ์ ํ๊ธฐ: CRC ์ฃผ์์ "CRC-8/MAXIM"์ด๋ผ๊ณ ํ์ง๋ง ๊ตฌํ์ ๋น๋ฐ์ฌํ ๋คํญ์ 0x31์
๋๋ค. README๋ Ethernet ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ "ESP32 core์ ํฌํจ"์ด๋ผ๊ณ ํ์ง๋ง, ์ค์ ๋ก๋ PlatformIO
lib_deps๋ก ๋ฐ๋ก ๋ฐ์ต๋๋ค - ์ ์ฅ์์ LICENSE ํ์ผ์ด ์์ต๋๋ค. ์ฌ์ฌ์ฉ ์ ํ์ ํ์ธํ๋ ๊ฒ์ด ์ข์ต๋๋ค
FAQ
Q1. ์๋น ๋งํฌ์ ์ TCP๊ฐ ์๋๋ผ UDP๋ฅผ ์ผ๋์?
์ ์ฅ์์ ์ด์ ๋ ์ ํ ์์ง ์์ต๋๋ค. [์ถ์ ] ๋ช
๋ น ํจํท์ด 3๋ฐ์ดํธ๋ก ์๊ณ , ๋ฌด๊ฒฐ์ฑ์ CRC8, ๋งํฌ ๊ฐ์๋ ์์น๋
์ผ๋ก ์ฑ์ด ์ง์ ์ฑ๊ธฐ๋ ๊ตฌ์กฐ๋ผ ์ฐ๊ฒฐ ๊ด๋ฆฌ๊ฐ ํ์ ์๋ UDP๊ฐ ๋จ์ํ์ ๊ฒ์ผ๋ก ๋ณด์
๋๋ค. ๋ค๋ง UDP๋ ๋์ฐฉ ํ์ธ์ด ์๊ณ ๋ฐธ๋ธ ๋ช
๋ น์ ์ฌ์ ์ก๋ ์์ผ๋ฏ๋ก, ์ ์ ๋ชจ๋์์ ๋ฐธ๋ธ ๋ช
๋ น์ ๋ฐ์ฌ๋๊ฐ ๋๋ ค๋ณด๋ด๋ valve_state๋ฅผ ์ด์์๊ฐ LED๋ก ๋ณด๊ณ ํ์ธํ๋ ๊ฒ์ด ์ฌ์ค์ ์ ์ผํ ํ์ธ ์๋จ์
๋๋ค. ARMยท์ ํยทABORT ๋ช
๋ น์๋ ์ด๋ฐ ํ์ธ ๊ฒฝ๋ก๊ฐ ์์ต๋๋ค.
Q2. ๊ด์ฌ์ ๋์ ๊ธด LAN ์ผ์ด๋ธ์ ์ฐ๋ฉด ์ ๋๋์?
๊ตฌ๋ฆฌ Ethernet์ ํ์ค์ ํ ๊ตฌ๊ฐ์ด 100 m๊น์ง์
๋๋ค. 1km๋ฅผ ๊ตฌ๋ฆฌ๋ก ๊ฐ๋ ค๋ฉด ์ค๊ฐ์ ์ค์์น๋ฅผ ์ฌ๋ฌ ๊ฐ ๋์ด์ผ ํฉ๋๋ค. ๋ฏธ๋์ด ์ปจ๋ฒํฐ ํ ์๊ณผ ๊ด์ฌ์ ๋ ๊ทธ ๊ฑฐ๋ฆฌ๋ฅผ ํ ๋ฒ์ ์๊ณ , ์ ๋์ ์ ๊ธฐ์ ์ผ๋ก ๋ถ๋ฆฌํ๋ ์ด์ ๋ ์์ต๋๋ค. CRT๊ฐ ์ด ์ด์ ๋ก ๊ด์ฌ์ ๋ฅผ ๊ณจ๋๋์ง๋ ์ ์ฅ์์ ์ ํ ์์ง ์์ต๋๋ค.
Q3. ๋ ๋งํฌ๊ฐ ๋์์ ์ด์ ์์ผ๋ฉด ์ด๋ป๊ฒ ๋๋์?
ํ์์๋ LoRa๋ง ์๋๋ค. ๋ฐ์ฌ๋๋ LoRa์ UDP ์์ชฝ์ ๋ชจ๋ ๋ฃ๊ณ ์์ด ์ด๋ ์ชฝ์ผ๋ก ๋ช
๋ น์ด ์ค๋ ์คํํ์ง๋ง, ์กฐ์ข
์์๋ LoRa๊ฐ ์คํจํ์ ๋๋ง UDP๋ก ๋ณด๋
๋๋ค. ์ ์ ๋ชจ๋์์๋ 30์ด๋ง๋ค LoRa PING์ ๋ณด๋ด๊ณ , PING์ด ์ฑ๊ณตํ๊ฑฐ๋ ๋ฐ์ฌ๋ ํ
๋ ๋ฉํธ๋ฆฌ๊ฐ LoRa๋ก ๋ค์ด์ค๋ฉด ๋ค์ LoRa๋ก ๋์๊ฐ๋๋ค.
Q4. ์ค๋ฌผ ๋ณด๋ ์์ด ์ํํ ์ ์๋์?
๋ค. ์กฐ์ข
์์ ์ฝ๋์ ์๋ฎฌ๋ ์ด์
๋ชจ๋๊ฐ ์๊ณ , Wokwi์ฉ ๋จ์ผ ํ์ผ ๋ฒ์ ์ด ํจ๊ป ๋ค์ด ์์ต๋๋ค. ์๋ฆฌ์ผ ํค ์
๋ ฅ์ผ๋ก ARM ํค, ๋ฐธ๋ธ ์ค์์น, ABORT, ๋งํฌ ์ฅ์ ๋ฅผ ํ๋ด ๋ด๋ฉฐ ์ํ๋จธ์ ๊ณผ LED ๋์์ ๋ณผ ์ ์์ต๋๋ค. W5500๊ณผ LoRa์ ์ค์ ํต์ ์ ์๋ฎฌ๋ ์ดํฐ์์ ํ์ธํ ์ ์์ต๋๋ค.
