树莓派3 Cumulocity IoT Agent无法连接平台及配置问题咨询
Hey there! Let's walk through your Cumulocity IoT Agent setup questions step by step – you've already knocked out the foundational stuff (NOOBS installed, SSH enabled, static IP, JAVA_HOME configured), so we're halfway there.
正确填写cumulocity.properties文件
The cumulocity.properties file holds the critical connection details needed for your Raspberry Pi agent to talk to your Cumulocity platform. Here's exactly how to fill in each required field based on your arpita.cumulocity.com account:
host: This is your platform's base domain – simply enterarpita.cumulocity.combootstrap.tenant: Use your Cumulocity tenant ID. For most accounts using a custom domain like yours, this matches the domain prefix (arpita). If you're unsure, log into your Cumulocity platform, click your account icon in the top-right, and check the tenant ID listed there.bootstrap.user: This is the bootstrap user account you used to register your device. The default bootstrap user for Cumulocity isbootstrap, but if you created a dedicated bootstrap user during setup, use that username instead.bootstrap.password: Enter the password associated with your bootstrap user account. If you used the defaultbootstrapuser, this is the initial bootstrap password provided by the platform (or the one you set later).
Here's a complete example of what your config should look like:
# Cumulocity IoT Raspberry Pi Agent Configuration host=arpita.cumulocity.com bootstrap.tenant=arpita bootstrap.user=bootstrap bootstrap.password=your-secure-bootstrap-password
建立有效连接的后续操作
Once your config file is set up, follow these steps to get the agent connected:
- Save the config file and restart the Cumulocity Agent service to apply changes:
sudo systemctl restart cumulocity-rpi-agent - Verify the agent is running with this command – you should see
active (running)in the output:sudo systemctl status cumulocity-rpi-agent - Check the Cumulocity platform: Log into
arpita.cumulocity.com, navigate to Device Management > Devices, and refresh the page. Your Raspberry Pi should appear as an online device once the agent successfully connects and registers. - Troubleshoot with logs (if needed): If the agent isn't connecting, use this command to stream real-time logs and spot errors (like invalid credentials or network issues):
sudo journalctl -u cumulocity-rpi-agent -f
处理缺失的device.properties文件
The device.properties file is automatically generated after the agent successfully connects to the platform and completes registration – it stores your device's unique ID and authentication tokens. If it's missing, that means the agent hasn't been able to finish the bootstrap process yet. Try these fixes:
- Double-check your
cumulocity.propertiesfor typos (common culprits are misspelled tenant IDs, passwords, or hostnames). - Confirm your Raspberry Pi can reach the Cumulocity platform:
If this fails, troubleshoot your static IP, gateway, or DNS settings to ensure your Pi has internet access.ping arpita.cumulocity.com - Clear any stale agent state and restart the bootstrap process:
This will reset the agent's stored state and force it to re-authenticate with your platform. Once successful,sudo systemctl stop cumulocity-rpi-agent sudo rm -rf /var/lib/cumulocity-rpi-agent/* sudo systemctl start cumulocity-rpi-agentdevice.propertieswill appear in the/usr/share/cumulocity-rpi-agent/cfgdirectory.
内容的提问来源于stack exchange,提问作者ArpitaAnjali Gayen

