This project is a rust application compiled for an raspberry pi to control IKEA lamps by faking an Ansluta remote. Thanks to NDBCK for his great research and example code in C++. In this project I used the first time ever rust language so please don't judge about code style :D.
- Raspberry PI 3 (€33,99 at Amazon)
- CC2500 2.4 GHz chip (€3 at Amazon)
- Breadboard & Jumper cables (€8.99 at Amazon)
- Rust
- Cargo make
- Cargo watch
- Linux Subsystem if you are on windows
- GCC for Raspberry ARM processor
1) Open linux shell (bash.exe
for linux subsystem on windows)
2) Install rustup, rust and cargo
$ curl https://sh.rustup.rs -sSf | sh
3) Install cargo-make
$ cargo install --force cargo-make
4) Install cargo-make
$ cargo install --force cargo-watch
5) Install ARM gcc to cross compile for raspberry pi. Note: If you choose another gcc version you have to update the linker used in the Cargo.toml file.
$ apt-get install gcc-8-multilib-arm-linux-gnueabihf
6) Add target in rustup
$ rustup target add armv7-unknown-linux-gnueabihf
7) Update ip in Cargo.toml to directly upload to raspberry pi on build
$ sed -i 's/xxx.xxx.xxx.xxx/your-ip/g' ./Cargo.toml
Build: Compile and upload to raspberry pi
$ cargo make --makefile Cargo.toml debug-raspberry
Watch: Compile and upload on every file change
cargo watch -x "make --makefile Cargo.toml debug-raspberry"
NOTE: Seems like there is no remote debug functionality at all. I didn't managed it to have breakpoints working. Neither CLion with GDBRemote nor CLI worked and I just found bugs / issues raised by other users complaining about the same.