Skip to content

NiusBus: One Arduino Library for CAN, RS-485, Modbus and W5500 Ethernet

Unified Arduino drivers for CAN, CAN FD, RS-485, Modbus and W5500 Ethernet, with diagnostics, DHCP, sockets and portable no-heap design.

irina

Published October 12, 2026

Original author: dunknowcodingOriginal source (new tab)

NiusBus: One Arduino Library for CAN, RS-485, Modbus and W5500 Ethernet

Components

Hardware components Software Apps and online services

WIZnet parts

Project description

๐Ÿ“Œ ์„œ๋ž ์† ํ†ต์‹  ๋ชจ๋“ˆ์„ ํ•˜๋‚˜์˜ Library๋กœ

NiusBus๋Š” Arduino ํ™˜๊ฒฝ์—์„œ ์ž์ฃผ ์‚ฌ์šฉํ•˜๋Š” CAN, CAN FD, RS-485 ๋ฐ Ethernet module์„ ํ•˜๋‚˜์˜ library์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก ๋งŒ๋“  communication driver collection์ž…๋‹ˆ๋‹ค. 

๋‹จ์ˆœํžˆ ์—ฌ๋Ÿฌ chip driver๋ฅผ ํ•œ ํด๋”์— ๋ชจ์€ ๊ฒƒ์ด ์•„๋‹ˆ๋ผ, ๊ฐ™์€ ์ข…๋ฅ˜์˜ bus์—์„œ๋Š” ๊ฐ€๋Šฅํ•œ ํ•œ ๋™์ผํ•œ API ๊ตฌ์กฐ๋ฅผ ์‚ฌ์šฉํ•˜๋„๋ก ์„ค๊ณ„๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

์˜ˆ๋ฅผ ๋“ค์–ด Classic CAN์—์„œ๋Š” Mcp2515, Esp32Twai๊ฐ€ ์„œ๋กœ ๋‹ค๋ฅธ hardware๋ฅผ ์‚ฌ์šฉํ•˜์ง€๋งŒ ๋น„์Šทํ•œ API๋กœ frame์„ ์†ก์ˆ˜์‹ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Ethernet์—์„œ๋Š” WIZnet W5500์„ ์ด์šฉํ•œ socket networking๊ณผ DHCP๋ฅผ ์ง€์›ํ•˜๋ฉฐ, RS-485์—์„œ๋Š” Modbus RTU, Ethernet์—์„œ๋Š” Modbus TCP๊นŒ์ง€ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

 

๐ŸŒ W5500์œผ๋กœ Ethernet์„ ์ถ”๊ฐ€ํ•˜๋‹ค

WIZnet ๊ด€์ ์—์„œ ๊ฐ€์žฅ ์ค‘์š”ํ•œ ๋ถ€๋ถ„์€ W5500 class์ž…๋‹ˆ๋‹ค.

 
W5500 eth(/*cs_pin=*/10, /*reset_pin=*/9);
 DhcpLease lease;
eth.beginDhcp(
    localMac(0xA1, 0xB2, 0xC3, 0x01),
    &lease
);

DHCP๋ฟ ์•„๋‹ˆ๋ผ static IP configuration๊ณผ TCP client/server๋„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.

Repository์—๋Š” ๋‹ค์Œ Ethernet ๊ด€๋ จ example์ด ์ œ๊ณต๋ฉ๋‹ˆ๋‹ค.

Example๊ธฐ๋Šฅ
09_EthernetSetupW5500 Link / Static IP / DHCP
10_ModbusTcpClientModbus TCP Client + reconnect
11_EthernetTcpServerListening TCP Socket
13_SerialBridgeConfigWIZnet/USR Serial Bridge ์„ค์ •
15_HardwareProbeRegister dump / self-test

์ฆ‰, NiusBus์—์„œ W5500์€ ๋‹จ์ˆœํ•œ Ethernet interface๊ฐ€ ์•„๋‹ˆ๋ผ TCP/IP application์„ ์œ„ํ•œ hardware socket controller ์—ญํ• ์„ ํ•ฉ๋‹ˆ๋‹ค. W5500์ด ARP, IP, ICMP, TCP, UDP๋ฅผ ์นฉ ์•ˆ์—์„œ 8๊ฐœ socket์œผ๋กœ ์ฒ˜๋ฆฌํ•˜๋ฏ€๋กœ MCU๋Š” payload byte๋งŒ ์˜ฎ๊ธฐ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

Socket ํ•˜๋‚˜๋ฅผ transport๋กœ ๋ณด๊ธฐ

๊ตฌ์กฐ์ ์œผ๋กœ ํฅ๋ฏธ๋กœ์šด ์ ์€ W5500 socket ํ•˜๋‚˜๊ฐ€ W5500Socket์ด๋ผ๋Š” FullDuplexTransport(write, readSome, readExactly)๋กœ ๋…ธ์ถœ๋œ๋‹ค๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ModbusTcpClient๋Š” ์ด transport ์œ„์—์„œ ๋™์ž‘ํ•˜๊ณ , ๊ฐ™์€ ์ธํ„ฐํŽ˜์ด์Šค๋กœ ์ž‘์„ฑ๋œ ๋‹ค๋ฅธ protocol code๋„ ๊ทธ๋Œ€๋กœ ์˜ฌ๋ฆด ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

setSocketBufferSizes()๋กœ 16 KB ๋ฒ„ํผ๋ฅผ socket๋ณ„๋กœ ๋‚˜๋ˆŒ ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ์ปจ๋Œ€ socket ํ•˜๋‚˜๋งŒ ์“ฐ๋Š” TCP echo server ์˜ˆ์ œ๋Š” ๊ธฐ๋ณธ 2 KB ๋Œ€์‹  8 KB๋ฅผ ํ• ๋‹นํ•ฉ๋‹ˆ๋‹ค.

 

์ƒ์„ฑ ๋‹ค์ด์–ด๊ทธ๋žจ: NiusBus docs/architecture.md์™€ W5500.h์˜ ํด๋ž˜์Šค ์ฃผ์„์— ์„ค๋ช…๋œ ๊ณ„์ธต ๊ตฌ์กฐ.
์ƒ์„ฑ ๋‹ค์ด์–ด๊ทธ๋žจ: NiusBus docs/architecture.md์™€ W5500.h์˜ ํด๋ž˜์Šค ์ฃผ์„์— ์„ค๋ช…๋œ ๊ณ„์ธต ๊ตฌ์กฐ.

 

๐Ÿ”„ Modbus RTU์™€ Modbus TCP๋ฅผ ํ•œ Library์—์„œ

NiusBus๋Š” serial๊ณผ Ethernet์„ ํ•˜๋‚˜์˜ communication library ์•ˆ์—์„œ ํ•จ๊ป˜ ๋‹ค๋ฃน๋‹ˆ๋‹ค.

MAX485 โ†’ RS-485 โ†’ Modbus RTU

W5500 โ†’ TCP Socket โ†’ Modbus TCP

RS-485์—์„œ๋Š” ModbusRtuMaster, Ethernet์—์„œ๋Š” ModbusTcpClient๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋”ฐ๋ผ์„œ ์‚ฐ์—…์šฉ serial device์™€ Ethernet device๋ฅผ ํ•จ๊ป˜ ๋‹ค๋ฃจ๊ฑฐ๋‚˜, RTU์™€ TCP๋ฅผ ํ•จ๊ป˜ ์‚ฌ์šฉํ•˜๋Š” ์‹œ์Šคํ…œ์˜ ๊ธฐ๋ฐ˜ library๋กœ ํ™œ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์†Œ์Šค์—์„œ ์ฐธ๊ณ ํ•  ๋งŒํ•œ ๊ตฌํ˜„ ํฌ์ธํŠธ๊ฐ€ ๋‘ ๊ฐ€์ง€ ์žˆ์Šต๋‹ˆ๋‹ค.

  • TCP client๋Š” ๊ณ ์ • 6๋ฐ”์ดํŠธ header๋ฅผ ๋จผ์ € ์ฝ์Šต๋‹ˆ๋‹ค. "TCP๋Š” message๋ฅผ ์–ด๋””์„œ๋“  ์ชผ๊ฐค ์ˆ˜ ์žˆ๊ธฐ" ๋•Œ๋ฌธ์ด๋ฉฐ, header๊ฐ€ ์•Œ๋ ค ์ค€ ๊ธธ์ด๋งŒํผ ๋‚˜๋จธ์ง€๋ฅผ ์ฝ์Šต๋‹ˆ๋‹ค. RTU์˜ CRC ๋Œ€์‹  length์™€ transaction id๊ฐ€ ๋“ค์–ด๊ฐ€๋Š” ๊ฒƒ์ด ๋‘ framing์˜ ์ฐจ์ด์ž…๋‹ˆ๋‹ค.
  • Troubleshooting ๋ฌธ์„œ๋Š” unit id๋ฅผ ์‹ค์ œ ์‹คํŒจ ์›์ธ์œผ๋กœ ๋‹ค๋ฃน๋‹ˆ๋‹ค. Native TCP device์—์„œ๋Š” ๋ณดํ†ต ๋ฌด์‹œ๋˜์ง€๋งŒ RTU gateway๋ฅผ ๊ฑฐ์น˜๋ฉด gateway ๋’ค์˜ serial slave๋ฅผ ์„ ํƒํ•˜๋ฏ€๋กœ, ๊ฐ’์ด ํ‹€๋ฆฌ๋ฉด ๋ชจ๋“  request๊ฐ€ timeout๋ฉ๋‹ˆ๋‹ค.

 

๐Ÿ” ์‹ค์ œ PCB ์ด๋ฆ„์„ ๊ธฐ์ค€์œผ๋กœ Hardware๋ฅผ ๊ตฌ๋ถ„

NiusBus์˜ ๋…ํŠนํ•œ ๋ถ€๋ถ„์€ chip name๋ฟ ์•„๋‹ˆ๋ผ ์‹ค์ œ PCB silkscreen์„ ๊ธฐ์ค€์œผ๋กœ module์„ ๊ตฌ๋ถ„ํ•œ๋‹ค๋Š” ์ ์ž…๋‹ˆ๋‹ค.

์˜ˆ๋ฅผ ๋“ค์–ด MCP2515 module์„ ๋ชจ๋‘ ๋™์ผํ•˜๊ฒŒ ์ทจ๊ธ‰ํ•˜์ง€ ์•Š๊ณ  ๋‹ค์Œ์ฒ˜๋Ÿผ ์‹ค์ œ ํŒ๋งค board๋ฅผ ๊ตฌ๋ถ„ํ•ฉ๋‹ˆ๋‹ค.

  • HW-184
  • MCP2515 CAN MODULE
  • NiRen MCP2515_CAN

W5500 ๊ณ„์—ด๋„ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์‹ค์ œ board ์ด๋ฆ„์„ ๋ฌธ์„œํ™”ํ•ฉ๋‹ˆ๋‹ค.

  • W5500 Lite
  • USR-ES1
  • WIZ850io

Module catalog์—๋Š” ์ด 48๊ฐœ board๊ฐ€ ์ •๋ฆฌ๋˜์–ด ์žˆ์œผ๋ฉฐ pin order์™€ board๋ณ„ ์ฃผ์˜์‚ฌํ•ญ์„ ํ•จ๊ป˜ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. W5500 ์ชฝ ์˜ˆ๋ฅผ ๋“ค๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

  • ์‹ ํ˜ธ pin์€ ์ •ํ’ˆ WIZnet ์นฉ์—์„œ 5 V tolerant์ง€๋งŒ, 3.3V๋กœ ํ‘œ์‹œ๋œ ์ „์› pin์— 5 V๋ฅผ ๋„ฃ์œผ๋ฉด board๊ฐ€ ํŒŒ์†๋ฉ๋‹ˆ๋‹ค.
  • W5500 Ethernet Shield๋Š” network๋ฅผ ์“ฐ๊ธฐ ์ „์— D4(SD card CS)๋ฅผ HIGH๋กœ ์˜ฌ๋ ค์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ์ง€ ์•Š์œผ๋ฉด SD slot์ด W5500๊ณผ MISO๋ฅผ ๋‘๊ณ  ๋‹คํˆฌ์–ด "์ด๋”๋„ท board๊ฐ€ ์ฃฝ์€ ๊ฒƒ๊ณผ ๋˜‘๊ฐ™์•„" ๋ณด์ž…๋‹ˆ๋‹ค.
  • Arduino Ethernet Shield(W5100)์™€ WIZ820io(W5200)๋Š” "์ฐธ๊ณ ์šฉ, ๊ตฌ๋™ ์•ˆ ํ•จ"์œผ๋กœ ๋ถ„๋ฅ˜๋˜๋ฉฐ, W5100์—๋Š” ๊ธฐ๋ณธ Ethernet.h ์‚ฌ์šฉ์„ ๊ถŒํ•ฉ๋‹ˆ๋‹ค.

 

๐Ÿ› ๏ธ ํ†ต์‹  ์‹คํŒจ๋ฅผ Error Code ํ•˜๋‚˜๋กœ ๋๋‚ด์ง€ ์•Š๋Š”๋‹ค

NiusBus๋Š” ์ •์ƒ ํ†ต์‹ ๋ฟ ์•„๋‹ˆ๋ผ ๋ฌธ์ œ ๋ฐœ์ƒ ์‹œ ์›์ธ์„ ์ฐพ๋Š” ๊ธฐ๋Šฅ๋„ ์ค‘์š”ํ•˜๊ฒŒ ๋‹ค๋ฃน๋‹ˆ๋‹ค.

 
CanDiagnostics health;
can.driver().diagnostics(&health);

๋˜ํ•œ ๊ฐ bus์—์„œ packet loss statistics๋ฅผ ๊ด€๋ฆฌํ•ฉ๋‹ˆ๋‹ค.

 
modbus.statistics().lossPermille();
canHealth.sendLossPermille();
ethHealth.lossPermille();

๋‹จ์ˆœํ•œ communication failure๊ฐ€ ์•„๋‹ˆ๋ผ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์ƒํƒœ๋ฅผ ๊ตฌ๋ถ„ํ•ฉ๋‹ˆ๋‹ค.

  • timeout
  • CRC mismatch
  • no acknowledgement
  • bus-off
  • packet loss

Ethernet์—์„œ๋„ EthDiagnostics๊ฐ€ link up ์—ฌ๋ถ€, ์†ก์ˆ˜์‹  frame ์ˆ˜, ์ˆ˜์‹  overflow, CRC error, ์†ก์‹ /์—ฐ๊ฒฐ ์‹คํŒจ ํšŸ์ˆ˜๋ฅผ ๋ˆ„์ ํ•˜๊ณ , ๋งˆ์ง€๋ง‰ ์˜ค๋ฅ˜๋ฅผ link down, no ARP reply, connection refused, connection timed out, no DHCP server answered ๊ฐ™์€ ๊ตฌ์ฒด์  ์›์ธ์œผ๋กœ ์•Œ๋ ค ์ค๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด connect()์˜ timeout์ด ์ผ€์ด๋ธ” ๋ฌธ์ œ์ธ์ง€ ๋ฐฉํ™”๋ฒฝ์ธ์ง€๋ฅผ ๊ตฌ๋ถ„ํ•˜๋Š” ๋ฐ ์“ธ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

๐Ÿ”ฌ Register๊นŒ์ง€ ๋‚ด๋ ค๊ฐ€๋Š” Hardware Probe

๊ฐ driver๋Š” ์ž์ฒด bring-up chain์„ ๊ฒ€์‚ฌํ•˜๊ณ  ์–ด๋А ๋‹จ๊ณ„์—์„œ ์‹คํŒจํ–ˆ๋Š”์ง€ ์•Œ๋ ค์ฃผ๋Š” selfTest()์™€ register dump์šฉ probe() ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

 
 
SelfTestResult result;
 can.selfTest(
    &result,
    /*include_loopback=*/true
);

์ด ๊ฒฐ๊ณผ๋Š” ์‚ฌ๋žŒ์ด Serial Monitor๋กœ ํ™•์ธํ•˜๋Š” ๊ฒƒ๋ฟ ์•„๋‹ˆ๋ผ script๋‚˜ automated board test์—์„œ ํ™œ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก number/enum ์ค‘์‹ฌ์œผ๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

W5500์˜ selfTest()๋Š” 5๋‹จ๊ณ„๋ฅผ ์ฐจ๋ก€๋กœ ๊ฑฐ์น˜๊ณ  ์ฒ˜์Œ ์‹คํŒจํ•œ ๋‹จ๊ณ„์—์„œ ๋ฉˆ์ถฅ๋‹ˆ๋‹ค.

  1. ๋ฐฐ์„ : SPI bus, chip select, clock adapter๊ฐ€ ์„ค์ •๋˜์–ด ์žˆ๋Š”๊ฐ€?
  2. SPI link: VERSIONR์ด 0x04์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ „๋ถ€ 0์ด๊ฑฐ๋‚˜ 1์ด๋ฉด SCS์™€ MISO/MOSI ๋’ค๋ฐ”๋€œ์„ ํ™•์ธํ•˜๋ผ๋Š” ๋ฉ”์‹œ์ง€๊ฐ€ ๋‚˜์˜ต๋‹ˆ๋‹ค.
  3. ์„ค์ •: RTR์— 0x1234๋ฅผ ์“ฐ๊ณ  ์ฝ์€ ๋’ค ์›๋ž˜ ๊ฐ’์œผ๋กœ ๋ณต์›ํ•ฉ๋‹ˆ๋‹ค.
  4. MAC: SHAR๊ฐ€ ์ „๋ถ€ 0์ด๋ฉด begin()์ด ์‹คํ–‰๋˜์ง€ ์•Š์€ ๊ฒƒ์ž…๋‹ˆ๋‹ค.
  5. Carrier: PHYCFGR bit 0์„ ๋งˆ์ง€๋ง‰์— ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. ์ผ€์ด๋ธ”์ด ๋น ์ ธ ์žˆ์–ด๋„ ์•ž ๋‹จ๊ณ„๋Š” ํ†ต๊ณผํ•  ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.
์ƒ์„ฑ ๋‹ค์ด์–ด๊ทธ๋žจ: W5500.h์˜ selfTest() ๋‹จ๊ณ„์™€ docs/architecture.md์— ์„ค๋ช…๋œ DHCP ๊ตํ™˜.
์ƒ์„ฑ ๋‹ค์ด์–ด๊ทธ๋žจ: W5500.h์˜ selfTest() ๋‹จ๊ณ„์™€ docs/architecture.md์— ์„ค๋ช…๋œ DHCP ๊ตํ™˜.

 

๐Ÿ’พ Arduino UNO์—์„œ ๊ฐ€๋Šฅํ•œ DHCP

DHCP message๋Š” ์•ฝ 300๋ฐ”์ดํŠธ์ด๊ณ  ์‘๋‹ต์€ 548๋ฐ”์ดํŠธ๊นŒ์ง€ ๋  ์ˆ˜ ์žˆ์–ด์„œ UNO์˜ RAM์—๋Š” ๋งŒ๋“ค ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. NiusBus๋Š” message๋ฅผ W5500์˜ ์†ก์‹  buffer์— 16๋ฐ”์ดํŠธ ์กฐ๊ฐ์œผ๋กœ ์ง์ ‘ ์กฐ๋ฆฝํ•˜๊ณ , ์‘๋‹ต์€ ์นฉ์˜ random-access peek๋กœ ์ œ์ž๋ฆฌ์—์„œ ํ›‘์Šต๋‹ˆ๋‹ค. ๋ฌธ์„œ๋Š” ๋น„์šฉ์„ stack ์•ฝ 80๋ฐ”์ดํŠธ๋กœ ์ ์Šต๋‹ˆ๋‹ค. beginDhcp()๋Š” IP, subnet, gateway, DNS, server, lease time์„ ๋ฐ˜ํ™˜ํ•˜๋ฉฐ, ๋งŒ๋ฃŒ ์ „ ๊ฐฑ์‹ ์€ sketch๊ฐ€ ํ•ด์•ผ ํ•  ์ผ์ž…๋‹ˆ๋‹ค.

 

๐Ÿงฉ Arduino ์œ„์™€ ์•„๋ž˜๋ฅผ ๋ถ„๋ฆฌํ•œ 2-Layer ๊ตฌ์กฐ

 
Application
     โ”‚
     โ–ผ
Mcp2515 / Rs485 / W5500
     โ”‚
  .driver()
     โ–ผ
Mcp2515Driver / W5500Driver / Rs485Driver
ModbusRtuMaster / ModbusTcpClient
     โ”‚
     โ–ผ
SPI / GPIO / Clock / ByteStream

์œ„์ชฝ์€ Arduino์—์„œ ์‰ฝ๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” convenience layer์ด๊ณ , ์•„๋ž˜์ชฝ driver layer๋Š” Arduino ์ž์ฒด์— ์ง์ ‘ ์˜์กดํ•˜์ง€ ์•Š๋„๋ก ๊ตฌ์„ฑ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

๋˜ํ•œ library ๋‚ด๋ถ€์—์„œ๋Š” ๋‹ค์Œ ์›์น™์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

No new ยท No delete ยท No String ยท No recursion

Buffer ์—ญ์‹œ object member ๋˜๋Š” caller-supplied memory๋ฅผ ์‚ฌ์šฉํ•˜๋„๋ก ์„ค๊ณ„๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. W5500 ๊ฐ์ฒด๋Š” RAM ์•ฝ 50๋ฐ”์ดํŠธ, 48์ข… module catalog๋Š” Serial ํฌํ•จ UNO RAM ์•ฝ 440๋ฐ”์ดํŠธ์ž…๋‹ˆ๋‹ค.

 

โš™๏ธ W5500๋ฟ ์•„๋‹ˆ๋ผ WIZnet Serial-to-Ethernet๋„ ์ง€์›

NiusBus์—๋Š” WIZnet Serial-to-Ethernet module์„ ์„ค์ •ํ•˜๊ธฐ ์œ„ํ•œ WizS2E๋„ ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

์ง€์› ๋Œ€์ƒ์œผ๋กœ ๋ฌธ์„œํ™”๋œ ์ œํ’ˆ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

  • WIZ750SR
  • W5500S2E-S1
  • WIZ550S2E

์ฆ‰, MCU๊ฐ€ W5500์„ ์ง์ ‘ SPI๋กœ ์ œ์–ดํ•˜๋Š” ๋ฐฉ์‹๊ณผ WIZnet S2E module์„ ์„ค์ •ํ•˜๋Š” ๋ฐฉ์‹ ๋ชจ๋‘๋ฅผ ํ•˜๋‚˜์˜ library์—์„œ ๋‹ค๋ฃน๋‹ˆ๋‹ค.

S2E module์€ ๋‘ ๊ธ€์ž command๋ฅผ ์“ฐ๋ฉฐ, +++์™€ guard time์œผ๋กœ ์ง„์ž…ํ•˜๊ฑฐ๋‚˜ ์ „์› ์ธ๊ฐ€ ์‹œ CFGn์„ LOW๋กœ ๋‹น๊ฒจ ์ง„์ž…ํ•ฉ๋‹ˆ๋‹ค. ๋ฌธ์„œ๋Š” SV๋ฅผ ๋ณด๋‚ด๊ธฐ ์ „๊นŒ์ง€ ์„ค์ •์ด RAM์—๋งŒ ์žˆ์–ด ์ €์žฅ ์—†์ด ์žฌ๋ถ€ํŒ…ํ•˜๋ฉด session์ด ์กฐ์šฉํžˆ ์‚ฌ๋ผ์ง„๋‹ค๊ณ  ๊ฒฝ๊ณ ํ•ฉ๋‹ˆ๋‹ค.

 

๐Ÿ“Š Project Snapshot (v0.2.0)

ํ•ญ๋ชฉ๋‚ด์šฉ
W5500 driverW5500.h 1,406์ค„; socket 8๊ฐœ, TCP/UDP, DHCP, interrupt, keep-alive, selfTest(), register probe
Board catalog48์ข…
์ƒ์œ„ protocolModbus RTU (RS-485), Modbus TCP (W5500 socket), raw Ethernet frame (ENC28J60)
Example16๊ฐœ
Build ๊ฒ€์ฆ๋ชจ๋“  example์„ AVR, megaAVR, SAMD, ESP32, Renesas RA4์šฉ์œผ๋กœ compile

๐Ÿงญ ํ™œ์šฉ ๊ฐ€์น˜์™€ ํ•œ๊ณ„

๊ฐ€์น˜๋Š” ๊ทœ์œจ์— ์žˆ์Šต๋‹ˆ๋‹ค. Driver๋Š” ์‹คํ–‰ ์ „์— ์นฉ์ด ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๊ณ , ๋ญ‰๋šฑ๊ทธ๋ฆฐ ์‹คํŒจ ๋Œ€์‹  hardware๊ฐ€ ๋งํ•œ ๋‚ด์šฉ์„ ๋ณด๊ณ ํ•˜๋ฉฐ, ์ดˆ๋ณด์ž์˜ ์‹œ๊ฐ„์„ ๋นผ์•—๋Š” board ์ˆ˜์ค€์˜ ํ•จ์ •์„ ๋ฌธ์„œํ™”ํ•ฉ๋‹ˆ๋‹ค. ์•ˆ์ •์ ์ธ bring-up ๊ฒฝ๋กœ๊ฐ€ ํ•„์š”ํ•œ W5500 ํ”„๋กœ์ ํŠธ๋ผ๋ฉด socket์—๋Š” ๋‹ค๋ฅธ library๋ฅผ ์“ฐ๋”๋ผ๋„ selfTest()์™€ SCS/RST/INT ๋ฐฐ์„  ๋…ธํŠธ๋Š” ๊ฐ€์ ธ๋‹ค ์“ธ ๋งŒํ•ฉ๋‹ˆ๋‹ค.

ํ•œ๊ณ„๋„ ๋ถ„๋ช…ํ•ฉ๋‹ˆ๋‹ค.

  • W5500 ์ชฝ์€ socket, DHCP, Modbus TCP๋ฅผ ๋‹ค๋ฃจ๋ฉฐ ๋ฌธ์„œ์— MQTT, HTTP, TLS ๊ณ„์ธต์€ ์—†์Šต๋‹ˆ๋‹ค. ํ•„์š”ํ•˜๋ฉด ๋‹ค๋ฅธ library์™€ ์กฐํ•ฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
  • DHCP ๊ฐฑ์‹ ์€ sketch์˜ ๋ชซ์ž…๋‹ˆ๋‹ค.
  • README์˜ hardware ๊ฒ€์ฆ ๋ฌธ๊ตฌ๋Š” CAN, RS-485, Modbus์— ๋Œ€ํ•œ ๊ฒƒ์ด๊ณ  Ethernet driver ๋ณ„๋„ ๊ฒฐ๊ณผ๋Š” ์ ํ˜€ ์žˆ์ง€ ์•Š์œผ๋ฏ€๋กœ, W5500 ๊ฒฝ๋กœ๋Š” ์†Œ์Šค ๊ฒ€ํ† ์™€ example compile ์ˆ˜์ค€์œผ๋กœ ๋ณด๊ณ  ์‚ฌ์šฉ ํ™˜๊ฒฝ์—์„œ ์ง์ ‘ ํ™•์ธํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.
  • ๊ฐœ์ธ์ด ๊ด€๋ฆฌํ•˜๋Š” library(v0.2.0)์ด๋ฏ€๋กœ vendor ์ง€์› ์ œํ’ˆ๊ณผ๋Š” ์ง€์†์„ฑ ๋ฉด์—์„œ ๋‹ค๋ฆ…๋‹ˆ๋‹ค.

๐Ÿ”— ๋น„์Šทํ•œ WIZnet Maker ํ”„๋กœ์ ํŠธ์™€ ๋น„๊ต

Project์ฃผ์š” InterfaceW5500 ์—ญํ• NiusBus์™€ ์ฐจ์ด
NiusBusCAN / CAN FD / RS-485 / Modbus / EthernetLibrary-level TCP/IP socket driver์—ฌ๋Ÿฌ bus๋ฅผ ํ•˜๋‚˜์˜ library์—์„œ ์ง€์›
Modbus RTU-to-TCP Gateway with W5500 and STM32RS-485 + EthernetModbus RTU โ†” Modbus TCP Gatewayํ•˜๋‚˜์˜ ์™„์„ฑ๋œ gateway application์— ์ง‘์ค‘
ETH_CANable FirmwareDual CAN + EthernetCAN frame์„ UDP/Ethernet์œผ๋กœ ์ „๋‹ฌCAN-to-Ethernet application์— ์ง‘์ค‘
Wiznet-W5500-library-for-ArduinoEthernetArduino์šฉ W5500 driver/libraryW5500 Ethernet ์ž์ฒด์— ์ง‘์ค‘

Modbus RTU-to-TCP Gateway with W5500 and STM32

Maker Project ๋ณด๊ธฐ

STM32F103๊ณผ W5500io-M module์„ ์ด์šฉํ•ด ๊ธฐ์กด RS-485 Modbus RTU ์žฅ์น˜๋ฅผ Ethernet ๊ธฐ๋ฐ˜ Modbus TCP network์— ์—ฐ๊ฒฐํ•˜๋Š” ํ”„๋กœ์ ํŠธ์ž…๋‹ˆ๋‹ค. RTU์˜ CRC16์„ ๋–ผ๊ณ  MBAP header๋ฅผ ๋ถ™์ด๋Š” ๋ณ€ํ™˜์„ STM32๊ฐ€ ์ˆ˜ํ–‰ํ•˜๊ณ , W5500์€ TCP/UDP/ARP/ICMP์™€ socket ๊ด€๋ฆฌ๋ฅผ hardware๋กœ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค.

NiusBus๋Š” ์ด๋Ÿฐ ํ•˜๋‚˜์˜ gateway application์„ ๋งŒ๋“œ๋Š” ๋Œ€์‹  RS-485, Modbus RTU, W5500, Modbus TCP ๊ฐ๊ฐ์˜ building block์„ library ํ˜•ํƒœ๋กœ ์ œ๊ณตํ•œ๋‹ค๋Š” ์ ์ด ๋‹ค๋ฆ…๋‹ˆ๋‹ค. ๋‘ ํ”„๋กœ์ ํŠธ๋Š” ๊ฒฝ์Ÿ ๊ด€๊ณ„๋ณด๋‹ค๋Š” ์œ„์•„๋ž˜ ๊ด€๊ณ„์— ๊ฐ€๊น์Šต๋‹ˆ๋‹ค. Gateway ๊ฐ™์€ application์ด NiusBus ๊ฐ™์€ library ์œ„์— ๋งŒ๋“ค์–ด์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

ETH_CANable Firmware

Maker Project ๋ณด๊ธฐ

STM32G474 ๊ธฐ๋ฐ˜์˜ dual-channel CAN-to-Ethernet bridge์ž…๋‹ˆ๋‹ค. Host๊ฐ€ UDP ํฌํŠธ 5001๋กœ SLCAN command๋ฅผ ๋ณด๋‚ด๋ฉด STM32๊ฐ€ ํ•ด์„ํ•ด ๋‘ CAN bus๋ฅผ ๊ตฌ๋™ํ•˜๊ณ , W5500์€ hardware UDP socket์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ๋ฌธ์„œํ™”๋œ protocol์€ payload 8๋ฐ”์ดํŠธ ์ดํ•˜์˜ Classic CAN์ž…๋‹ˆ๋‹ค.

NiusBus๋Š” ๊ณ ์ •๋œ CAN-to-Ethernet protocol์„ ๊ตฌํ˜„ํ•˜๋Š” ๋Œ€์‹  CAN๊ณผ W5500์„ reusable communication driver๋กœ ์ œ๊ณตํ•œ๋‹ค๋Š” ์ ์ด ๋‹ค๋ฆ…๋‹ˆ๋‹ค.

Wiznet-W5500-library-for-Arduino

Maker Project ๋ณด๊ธฐ

Arjen Hiemstra์˜ Ethernet55๋ฅผ ์†Œ๊ฐœํ•˜๋Š” W5500์šฉ Arduino library๋กœ, ์ง์ ‘์ ์ธ ๋น„๊ต ๋Œ€์ƒ์ž…๋‹ˆ๋‹ค. ํ•ด๋‹น ํŽ˜์ด์ง€๋Š” working example๊ณผ user guide๊ฐ€ ์—†์–ด ์‚ฌ์šฉ๋ฒ•์„ ์ฝ”๋“œ์—์„œ ์ฝ์–ด์•ผ ํ•œ๋‹ค๊ณ  ์ ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

NiusBus๋Š” W5500 Ethernet ๊ธฐ๋Šฅ์— ๋”ํ•ด 16๊ฐœ example๊ณผ ๋ฌธ์„œ(module reference, troubleshooting, API book), ์ง„๋‹จ ๊ธฐ๋Šฅ์„ ๊ฐ–์ถ”๊ณ , CAN, CAN FD, RS-485, Modbus RTU/TCP๊นŒ์ง€ ํ•˜๋‚˜์˜ library architecture ์•ˆ์—์„œ ๋‹ค๋ฃน๋‹ˆ๋‹ค.

 

Q. NiusBus๋Š” W5500์„ ์ง€์›ํ•˜๋‚˜์š”?
๋„ค. DHCP, static addressing, TCP client/server๋ฅผ ์ง€์›ํ•˜๋ฉฐ W5500 socket์„ ์‚ฌ์šฉํ•˜๋Š” Modbus TCP Client example๋„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

Q. W5500๋งŒ์„ ์œ„ํ•œ Library์ธ๊ฐ€์š”?
์•„๋‹™๋‹ˆ๋‹ค. CAN, CAN FD, RS-485, Modbus RTU, W5500 Ethernet, ENC28J60 raw Ethernet ๋ฐ Serial-to-Ethernet module์„ ํ•จ๊ป˜ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.

Q. CAN๊ณผ Ethernet API๊ฐ€ ์™„์ „ํžˆ ๊ฐ™์€๊ฐ€์š”?
์•„๋‹™๋‹ˆ๋‹ค. ์„œ๋กœ ๋‹ค๋ฅธ bus๋ฅผ ์–ต์ง€๋กœ ํ•˜๋‚˜์˜ API๋กœ ์ถ”์ƒํ™”ํ•˜๊ธฐ๋ณด๋‹ค ๊ฐ™์€ category ์•ˆ์—์„œ ๊ณตํ†ต API๋ฅผ ์ œ๊ณตํ•˜๋Š” ๋ฐฉ์‹์ž…๋‹ˆ๋‹ค.

Q. Arduino UNO์—์„œ๋„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‚˜์š”?
Library๋Š” dynamic allocation์„ ํ”ผํ•˜๋„๋ก ์„ค๊ณ„๋˜์—ˆ์œผ๋ฉฐ AVR๋ฅผ ํฌํ•จํ•œ ์—ฌ๋Ÿฌ Arduino architecture์—์„œ example compilation์„ ๊ฒ€์ฆํ•ฉ๋‹ˆ๋‹ค. DHCP๋„ UNO์—์„œ ์“ธ ์ˆ˜ ์žˆ๋„๋ก W5500์˜ ์†ก์‹  buffer ์•ˆ์—์„œ ์กฐ๋ฆฝํ•ฉ๋‹ˆ๋‹ค.

Q. W5500 Lite๋ฅผ 5 V๋กœ ๊ตฌ๋™ํ•ด๋„ ๋˜๋‚˜์š”?
3.3V๋กœ ํ‘œ์‹œ๋œ pin์—๋Š” ์•ˆ ๋ฉ๋‹ˆ๋‹ค. ์‹ ํ˜ธ pin์€ ์ •ํ’ˆ WIZnet ์นฉ์—์„œ 5 V tolerant์ง€๋งŒ ์ „์› pin์— 5 V๋ฅผ ๋„ฃ์œผ๋ฉด board๊ฐ€ ํŒŒ์†๋œ๋‹ค๊ณ  ๋ฌธ์„œ์— ์ ํ˜€ ์žˆ์Šต๋‹ˆ๋‹ค.

Q. W5500 ์™ธ์˜ WIZnet ์ œํ’ˆ๋„ ์ง€์›ํ•˜๋‚˜์š”?
๋„ค. WizS2E class๋ฅผ ํ†ตํ•ด WIZ750SR, W5500S2E-S1, WIZ550S2E ๊ฐ™์€ Serial-to-Ethernet module๋„ ๋‹ค๋ฃน๋‹ˆ๋‹ค.


๐Ÿ“Œ One Library for the Communication Boards in Your Drawer

NiusBus is an Arduino communication-driver library covering CAN, CAN FD, RS-485, Modbus, and Ethernet hardware.

Rather than exposing one unrelated programming style for every controller, NiusBus provides a consistent API within each bus category. For Classic CAN, for example, Mcp2515 and Esp32Twai use different hardware but a similar API for sending and receiving frames.

Supported hardware includes:

  • MCP2515 Classic CAN
  • MCP2518FD / MCP2517FD CAN FD
  • ESP32 TWAI
  • MAX485-family RS-485
  • WIZnet W5500 Ethernet
  • ENC28J60 raw Ethernet
  • WIZnet and USR serial-to-Ethernet bridges

๐ŸŒ W5500 Ethernet Support

NiusBus provides a dedicated W5500 class for wired Ethernet.

 
W5500 eth(/*cs_pin=*/10, /*reset_pin=*/9);
 DhcpLease lease;
eth.beginDhcp(
    localMac(0xA1, 0xB2, 0xC3, 0x01),
    &lease
);

The repository includes examples for:

ExampleFunction
09_EthernetSetupW5500 link, static IP, DHCP
10_ModbusTcpClientModbus TCP client with reconnect
11_EthernetTcpServerListening TCP socket
13_SerialBridgeConfigWIZnet/USR serial-bridge configuration
15_HardwareProbeRegister dump and self-test

The W5500 therefore serves as NiusBus's hardwired TCP/IP Ethernet controller for socket-based networking: it runs ARP, IP, ICMP, TCP and UDP across eight sockets, so the MCU only moves payload bytes.

One socket, seen as a transport

Each W5500 socket is exposed as a W5500Socket, a FullDuplexTransport with write, readSome and readExactly. ModbusTcpClient runs on that transport, and so can any other protocol code written against the same interface. setSocketBufferSizes() splits the chip's 16 KB of buffer between sockets; the one-socket TCP echo example gives its socket 8 KB instead of the default 2 KB.

Generated diagram: the layering described in NiusBus docs/architecture.md and the class comments in W5500.h
Generated diagram: the layering described in NiusBus docs/architecture.md and the class comments in W5500.h

๐Ÿ”„ Modbus on Serial and Ethernet

NiusBus covers both sides of a common industrial communication split.

RS-485 โ†’ Modbus RTU (ModbusRtuMaster)

W5500 โ†’ TCP Socket โ†’ Modbus TCP (ModbusTcpClient)

This makes the library useful as a common foundation for applications that need to interact with legacy serial devices and Ethernet-connected equipment.

Two implementation details are worth borrowing:

  • The TCP client reads the fixed 6-byte header first because "TCP can split a message anywhere", then reads the rest by the length announced. That header, with its explicit length and transaction id, is what replaces the RTU CRC.
  • The troubleshooting page treats the unit id as a real failure mode. A native TCP device usually ignores it, but through an RTU gateway it selects the serial slave behind the gateway, so a wrong value reaches nothing and every request times out.

 

๐Ÿ” Hardware Identified by Its Actual PCB

One unusual feature of NiusBus is its hardware catalog. Instead of documenting only chip names, the library identifies boards using the silkscreen printed on the real module.

Examples include HW-184, MCP2515 CAN MODULE, and NiRen MCP2515_CAN, and W5500 boards such as W5500 Lite, USR-ES1, and WIZ850io. The repository catalogs 48 boards with header order and known hardware-specific pitfalls. On the W5500 side:

  • Signal pins are 5 V tolerant on genuine WIZnet silicon, but 5 V on the pin marked 3.3V destroys the board.
  • On the W5500 Ethernet Shield, D4 (SD card CS) must be driven high before using the network, or the SD slot fights the W5500 for MISO and "looks exactly like a dead Ethernet board".
  • The W5100-based Arduino Ethernet Shield and the W5200-based WIZ820io are listed as "reference, not driven"; the docs recommend the stock Ethernet.h for the W5100.

 

๐Ÿ› ๏ธ Diagnostics as a First-Class Feature

NiusBus exposes bus-specific diagnostics and cumulative packet-loss statistics so users can distinguish conditions such as:

  • timeout
  • CRC mismatch
  • missing CAN acknowledgement
  • bus-off
  • degraded packet delivery

On Ethernet, EthDiagnostics keeps running totals for link state, frames sent and received, receive overflows, CRC errors, and send or connect failures, and the last error is reported as a specific cause: link down, no ARP reply, connection refused, connection timed out, or no DHCP server answered. That lets a sketch tell whether a connect() timeout came from a dead cable or a firewall.

 

๐Ÿ”ฌ Hardware Probes Down to the Register

Each driver provides a staged selfTest() that reports where its bring-up chain failed, plus a probe() register dump. Results are number- and enum-based so a script or automated board test can use them, not only a person at the Serial Monitor.

W5500Driver::selfTest() walks five stages and stops at the first failure:

  1. Wiring: are the SPI bus, chip select and clock adapter set up?
  2. SPI link: VERSIONR must read 0x04. All zeros or all ones means no answer, and the message says to check SCS and whether MISO and MOSI are swapped.
  3. Configuration: write 0x1234 to RTR, read it back, then restore it.
  4. MAC: an all-zero SHAR means begin() never ran.
  5. Carrier: PHYCFGR bit 0, checked last because everything above can pass with the cable unplugged.
Generated diagram: selfTest() stages from W5500.h, and the DHCP exchange described in docs/architecture.md.
Generated diagram: selfTest() stages from W5500.h, and the DHCP exchange described in docs/architecture.md.

๐Ÿ’พ DHCP on an Arduino UNO

A DHCP message is about 300 bytes and a reply can be 548, which does not fit in a UNO's RAM alongside anything else. NiusBus assembles the message directly in the W5500's own transmit buffer in 16-byte pieces and scans the reply in place with the chip's random-access peek. The docs put the cost at about 80 bytes of stack. beginDhcp() returns IP, subnet, gateway, DNS, server and lease time; renewing before expiry is the sketch's job.

๐Ÿงฉ Two-Layer Architecture

 
 
Sketch
  โ”‚
  โ–ผ
Mcp2515 / Rs485 / W5500
  โ”‚
  โ–ผ
Portable Drivers / Protocols
  โ”‚
  โ–ผ
SPI / GPIO / Clock / ByteStream

The portable driver layer does not depend directly on Arduino. The project also avoids library-owned dynamic allocation:

No new ยท No delete ยท No String ยท No recursion

A W5500 object costs about 50 bytes of RAM, and the 48-board catalog costs about 440 bytes of a UNO's RAM with Serial included.

โš™๏ธ More WIZnet Support Than W5500

NiusBus also includes support for configuring WIZnet Serial-to-Ethernet products through its WizS2E interface. Documented devices include WIZ750SR, W5500S2E-S1 and WIZ550S2E.

These modules use two-letter commands, entered with +++ and a guard time or by pulling CFGn low at power-up. The docs warn that settings stay in RAM until SV is sent, so a reboot without saving silently discards the session.

๐Ÿ“Š Project Snapshot (v0.2.0)

ItemDetail
W5500 driver1,406-line W5500.h; 8 sockets, TCP/UDP, DHCP, interrupts, keep-alive, selfTest(), register probe
Board catalog48 boards
Protocols on topModbus RTU (RS-485), Modbus TCP (W5500 socket), raw Ethernet frames (ENC28J60)
Examples16
Build checkEvery example compiled for AVR, megaAVR, SAMD, ESP32 and Renesas RA4

๐Ÿงญ Where It Fits โ€” Value and Limits

The value is in the discipline. Drivers verify the chip is there before running, report what the hardware said rather than a generic failure, and document the board-level traps that cost beginners hours. A W5500 project that needs a reliable bring-up path can take selfTest() and the SCS/RST/INT wiring notes even if it uses another library for sockets.

The limits are plain:

  • The W5500 side covers sockets, DHCP and Modbus TCP; the docs describe no MQTT, HTTP or TLS layer, so those must come from elsewhere.
  • DHCP renewal is left to the sketch.
  • The README's hardware-validation statement covers CAN, RS-485 and Modbus rather than the Ethernet drivers specifically, so treat the W5500 path as source-reviewed and example-compiled, and verify it on your own hardware.
  • It is a personally maintained v0.2.0 library, with a different continuity profile than a vendor-backed product.

๐Ÿ”— Related WIZnet Maker Projects

ProjectMain InterfaceW5500 RoleDifference from NiusBus
NiusBusCAN / CAN FD / RS-485 / Modbus / EthernetLibrary-level TCP/IP socket driverMultiple buses in one reusable library
Modbus RTU-to-TCP Gateway with W5500 and STM32RS-485 + EthernetModbus RTU โ†” Modbus TCP gatewayFocuses on one complete gateway application
ETH_CANable FirmwareDual CAN + EthernetCAN frames over UDP/EthernetFocuses on one CAN-to-Ethernet application
Wiznet-W5500-library-for-ArduinoEthernetArduino W5500 driver/libraryFocuses specifically on W5500 Ethernet

Modbus RTU-to-TCP Gateway with W5500 and STM32

View Maker Project

This project uses an STM32F103 and a W5500io-M module to connect existing RS-485 Modbus RTU devices to a Modbus TCP network. The STM32 strips the RTU CRC16 and adds the MBAP header, while the W5500 handles TCP, UDP, ARP, ICMP and socket management in hardware.

NiusBus differs by providing the RS-485, Modbus RTU, W5500, and Modbus TCP building blocks as reusable library components rather than one fixed gateway application. The two sit at different levels: a gateway like this could be built on a library like NiusBus.

ETH_CANable Firmware

View Maker Project

This STM32G474-based project is a dual-channel CAN-to-Ethernet bridge: a host sends SLCAN commands over UDP port 5001, the STM32 drives either CAN bus, and the W5500 provides the hardware UDP sockets. The documented protocol carries Classic CAN with payloads up to 8 bytes.

NiusBus instead exposes CAN and W5500 as reusable communication drivers rather than implementing a fixed CAN-to-Ethernet protocol.

Wiznet-W5500-library-for-Arduino

View Maker Project

This is an Arduino library for the W5500 based on Arjen Hiemstra's Ethernet55, and the most direct comparison. Its page notes there are no working examples or user guides, so usage has to be read from the code.

NiusBus adds 16 examples, a module reference, troubleshooting pages and diagnostics around W5500 networking, and places it inside a broader CAN, CAN FD, RS-485, and Modbus framework.

โ“ FAQ

Does NiusBus support W5500?
Yes. It supports network setup, DHCP, TCP client/server sockets and Modbus TCP examples.

Is NiusBus only an Ethernet library?
No. It also supports CAN, CAN FD, RS-485, Modbus RTU, raw Ethernet and serial-to-Ethernet modules.

Does it require dynamic memory allocation?
The library is designed without library-owned dynamic allocation, and DHCP is assembled in the W5500's transmit buffer so it fits on a UNO.

Can I power a W5500 Lite from 5 V?
Not through the pin marked 3.3V. The signal pins are 5 V tolerant on genuine WIZnet silicon, but 5 V on the supply pin destroys the board.

What platforms does it target?
The repository verifies examples for AVR, megaAVR, SAMD, ESP32 and Renesas RA4.

 

Comments

Similar projects you might like

Comments