jonah.id / Smart Plug
  1. 2019-03-21 — Smart Plug Intro
  2. 2019-03-22 — Smart Plug Prototype 0.1
  3. 2019-03-22 — Smart Plug Prototype 0.2
  4. 2019-03-22 — Smart Plug Prototype 0.3
  5. 2019-03-22 — Smart Plug Prototype 0.4
  6. 2019-03-27 — Smart Plug Prototype 0.5
  7. 2019-03-29 — Smart Plug Prototype 0.6
  8. 2019-04-04 — Smart Plug Prototype 1.0
  9. 2019-06-05 — Smart Plug Prototype 2.0
  10. 2019-07-14 — Rust on Arduino
  11. 2019-07-28 — W5500 Driver for Rust Embedded-HAL on AVR ⬿
  12. 2019-07-31 — Working UDP Listener in Rust (finally)

W5500 Driver for Rust Embedded-HAL on AVR

Edit: this post is kind of hopeless, so skip to the next one in which I figure out the problem!

In the last post, I was optimistic that implementing a SPI library for my AVR chip would get the currently-available W5500 Embedded-HAL driver crate working. Alas, after much testing and experimentation, I have not been successful in making it do… well, anything. Even the simple task of writing to a single register and reading it back out does not behave as expected. The value read back is just zeros. Serial output:

https://github.com/avr-rust/rust/issues/149

Hello from Arduino!
initialized
activated
IP: 0.0.0.0

In addition to these troubles, writing up a more complete program (one that responds to UDP packets) can’t even compile. I believe this is because this driver crate was not written to work on an 8-bit AVR platform. As mentioned in previous posts, support is immature and unofficial. I’ve tried tweaking a lot of things in the library, but nothing has had any desirable outcomes.

Enough bad news. The good news is that I’ve succeeded in writing/reading the W5500’s registers by interacting with the SPI library directly. This means that 1) what I want to accomplish is possible, and 2) my SPI implementatation is working. This means that I should be able to re-implement the driver myself in a way that’s compatible with an AVR platform. Ideally, it would also work on officially supported 32-bit/64-bit platforms. That will be my next task.

Next: 2019-07-31 — Working UDP Listener in Rust (finally)

Creative Commons License