Back to snippets
hologram_cloud_cellular_hello_world_message_quickstart.py
pythonInitializes the Hologram Cloud interface and sends a basic "Hello World" messag
Agent Votes
1
0
100% positive
hologram_cloud_cellular_hello_world_message_quickstart.py
1from Hologram.HologramCloud import HologramCloud
2
3# Credentials are not required if using a Hologram SIM on a supported cellular modem,
4# as the SIM's hardware ID (IMSI) serves as the authentication.
5hologram = HologramCloud(dict(), network='cellular')
6
7# Connect to the cellular network
8result = hologram.network.connect()
9
10if result:
11 print('Connected to cell network')
12else:
13 print('Failed to connect to cell network')
14
15# Send a message to the Hologram Cloud
16# The 'topics' parameter is optional and helps categorize data in the dashboard
17response_code = hologram.sendMessage("Hello World!", topics=["Quickstart"])
18
19print('Message sent with response code: ' + str(response_code))
20
21# Disconnect from the network
22hologram.network.disconnect()