Skip to content

Commit

Permalink
Basic working pubber connection
Browse files Browse the repository at this point in the history
  • Loading branch information
grafnu committed Apr 18, 2024
1 parent 05b4c1a commit ef4c4e5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bin/test_mosquitto
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ sleep 1
echo Checking received message
fgrep Racket out/mosquitto.sub

DEV_USER=nobody
hash_pass=$(sha256sum < $site_path/devices/$device_id/rsa_private.pkcs8)
dev_pass=${hash_pass:0:8}
mosquitto_ctrl -u $AUTH_USER -P $AUTH_PASS dynsec createClient $DEV_USER -p $dev_pass -c $client_id
mosquitto_ctrl -u $AUTH_USER -P $AUTH_PASS dynsec addClientRole $DEV_USER device

sleep 1

cat <<EOF > /tmp/pubber_config.json
Expand All @@ -63,8 +69,8 @@ cat <<EOF > /tmp/pubber_config.json
"port": 1883,
"auth_provider": {
"basic": {
"username": "$MQTT_USER",
"password": "$MQTT_PASS"
"username": "$DEV_USER",
"password": "$dev_pass"
}
}
},
Expand Down

0 comments on commit ef4c4e5

Please sign in to comment.