Skip to content

vladdancer/pirust

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pirust

Prerequisites

  • Rust (with armv7-unknown-linux-musleabihf target)
  • LLVM
  • arm-linux-gnueabihf-binutils

Building commands

Building publisher

cargo build --bin pirust_pub_weight --target armv7-unknown-linux-musleabihf

Running publisher locally

cargo run --bin pirust_pub_weight

Running subscriber locally

cargo run --bin pirust_sub_weight

Setting up MacOS environment

Installing rust on MacOS

curl https://sh.rustup.rs -sSf | sh -s -- --no-modify-path 

Adding a new target (for compiling armv7 binaries)

xcode-select --install
brew install arm-linux-gnueabihf-binutils llvm rsync
rustup target add armv7-unknown-linux-musleabihf

MQTT stuff

We use mosquitto as a MQTT server.

Install mosquitto

(Skip if you don't need mosquitto CLI tools and want to run it just in Docker.)

brew install mosquitto

Run MQTT broker in docker container

 docker run -ti -p 1883:1883 -p 91:9001 toke/mosquitto

Publish message example

mosquitto_pub  -h ip_or_hostname -p 1883 -m "test message" -t roomId/topicId

Listen for specific topic

mosquitto_sub  -h ip_or_hostname -p 1883 -t roomId/topicId

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%