This example sends a message from the Pico LTE to a Slack channel through an incoming webhook, over the cellular connection. No extra hardware is needed.
Before you begin
Hardware
- Sixfab Pico LTE or Pico LTE 2Registered and active in Sixfab Connect, connected to the computer with the micro USB cable.
Software
- Thonny with MicroPython and the Pico LTE SDKSet up as in the quickstart.
- config.jsonIn the root of the board: Prepare the configuration file.
- Slack accountWith a workspace you can add an app to; the next section creates one if needed.
Create workspace
If you have a workspace to use, skip this section. Sign in to Slack and click Create a New Workspace, then:
-
Enter company or team name.

-
Add your name and profile photo.

-
Add coworkers by email, or skip.

-
Enter project your team works on.
The workspace is created.

Create app
-
Create new app.
Open api.slack.com, click Your apps, then Create an app.

-
Choose From scratch.

-
Name app and choose workspace.
For example PicoLTE, in the workspace that will receive the messages.

Add incoming webhook
-
Activate incoming webhooks.
In the app’s settings, open Incoming Webhooks under Features and turn the feature on.

-
Add webhook to channel.
Click Add New Webhook to Workspace and select the channel that will receive the messages.

-
Copy webhook URL.
The app appears in the channel, and Slack shows the webhook URL, specific to one user and one channel:

https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
Run example
-
Set webhook URL in config.json.
{ "slack": { "webhook_url": "INCOMING_WEBHOOK_URL" } } -
Run script.
Open
examples/slack/send_message.pyfrom the SDK repository in Thonny and click Run.
INFO: Sending message to slack channel... INFO: Result: {'status': 0, 'response': ['ok'], 'interval': 0} -
Check channel.
The message appears in the channel.
