You will need:
- A 21 Bitcoin Computer, or a DIY Bitcoin Computer
- An Adafruit MPL3115A2 Breakout Board
- A set of female to female jumper wires
For a full walkthrough, see the sensor21 tutorial here.
Connect your 21BC / DIY 21BC to the MPL3115A2 breakout board. See the connection diagrams on the tutorial page for more information.
Get the latest version of the 21 software. If you don't have 21 installed yet, run curl https://21.co | sh
. Then, join the 21 marketplace network.
# Install 21 if required
curl https://21.co | sh
# Run 21 update
21 update
# Join the `21market` network
21 join
Clone the sensor21 repository, and run the setup script. You will be asked for user input multiple times.
cd ~/
# Install git to clone the Sensor21 code
sudo apt-get install git
# git clone the code
git clone https://github.com/21dotco/sensor21.git
# run the setup script
cd sensor21
source setup.sh
Start the server with the following:
python3 sensor21-server.py -d
After the server is running, pubish your endpoint with the 21 publish command. Replace the name and email fields with your information.
21 publish submit manifest.yaml -p 'name="Joe Smith" email="[email protected]" price="5" host="AUTO" port="6002"'
After a few minutes, you should be able to use 21 publish list
to see the endpoint you just put up:
21 publish list
You can also use the verify endpoint on the sensor21 aggregator. Load your zerotier ip address, and then query the enpoint to verify you are part of the pool.
# grab your ZeroTier IP address and save it to shell variable ZT_IP
ZT_IP=$(ifconfig | grep -A2 zt | grep inet | sed 's|[^0-9. ]||g' | sed 's|[^ \t]*||' | awk 'NR==1{print $1}')
# verify your endpoint is part of the pool
curl https://mkt.21.co/21dotco/sensor21_aggregator/sensor21/verify?zt_ip=$ZT_IP
After your server has been online for ~30 minutes, you can start to see transaction logs from the aggregator in your 21 log. You can see your incomes from sensor21 by running 21 log.
21 log
See the detail on troubleshooting your application here.
If you have further support requests, please join our public slack channel #iot here.