aws-solutions / real-time-iot-device-monitoring-with-kinesis

AWS Solution with a CloudFormation template for an ingestion mechanism for analytics about device connectivity and activity (i.e. sensor readings), as well as a dashboard for visualizing this data.
Other
65 stars 45 forks source link

Can not publish messages #10

Open mstfldmr opened 4 years ago

mstfldmr commented 4 years ago

The payloads are not being base64 encoded, thus they are not published. I get this error:

./send-messages.sh

Invalid base64: "{"id":"1","device":"P02","flow":60,"temp":22,"humidity":74,"sound":126}"
Publishing message 69/1000 to IoT topic iot_device_analytics:
device: P02
flow: 97
temp: 24
humidity: 61
sound: 131
hurami commented 3 years ago

Try this: aws iot-data publish --topic "$TOPIC" --payload "{\"id\":\"1\",\"device\":\"$DEVICE\",\"flow\":$FLOW,\"temp\":$TEMP,\"humidity\":$HUMIDITY,\"sound\":$SOUND}" --profile "$PROFILE" --region "$REGION" --cli-binary-format raw-in-base64-out > /dev/null 2>&1