Add Your settings.toml File
As of CircuitPython 8.0.0, there is support for Environment Variables. Environment variables are stored in a settings.toml file. Similar to secrets.py, the settings.toml file separates your sensitive information from your main code.py file. Add your settings.toml file as described in the Create Your settings.toml File page earlier in this guide. You'll need to include values for your CIRCUITPY_WIFI_SSID and CIRCUITPY_WIFI_PASSWORD.
Configure
You must configure some basic settings in order to use the IRC application:
-
server- The IRC Server URL that you want to connect to e.g.irc.libera.chat -
port- The network port to use for the connection. Many IRC servers use6697for TLS encrypted connections, and6667for clear text connections. -
username- The nickname that you want to connect to the server with. This is what other chatters will see next to messages you write. -
channel- The channel that you want to join automatically. Join an existing channel like#adafruit-fruit-jamor#python, or create your own channel for you and your friends. Channels always start with a pound sign.
To configure these items set their values in the IRC_CONFIG dictionary near the top of the code.py file.
# Configuration - modify these values as needed
IRC_CONFIG = {
"server": "irc.libera.chat", # Example: irc.libera.chat, irc.freenode.net
# "port": 6667, # 6667 - clear text
"port": 6697, # 6697 - TLS encrypted
"username": "",
"channel": "#adafruit-fruit-jam",
}
All of the configurations except for username have defaults that you can leave if you wish to join the #adafruit-fruit-jam channel. You must fill in a username value or the code will raise an exception reminding you to do so.
When the IRC client first starts up and connects to the server it will show the welcome message and server header information. The bottom bar that is grey with black text is the status bar. Normally it will show your username, the server URL that you're connected to, and the channel name that you have joined. During some operations it will change to give you success/failure or other output about an operation. As you type, your message will appear on the user input line. If you type a message and press enter the message will get sent to the channel. If your message begins with a forward slash /, then it will be treated as a command by the application instead of being sent to the server as a chat message.
As new messages are received in the channel, they will be shown beneath the welcome message, they'll start scrolling automatically as necessary. The up and down arrow keys and page up/down keys will scroll the chat so you can see older messages that were received while you were connected, then scroll back to the current time at the bottom.
Commands
General commands available for all users:
-
/msg [to-user] [message]: Send a direct message to the specified user. Username and message should be separated by a space. -
/beep [to-user]: Send a beep direct message to the specified user. If they have a speaker plugged in it will play a beep sound. -
/whois [user]: Run a whois query on the specified username. -
/join [channel-name]: Join the specified channel.
Channel admin commands only available to channel operators:
-
/op [user]: Give the specified user operator privilege in the current channel. -
/deop [user]: Remove operator privilege from the specified user in the current channel. -
/kick [user]: Kick the specified user from the channel. -
/ban [user]: Ban the specified user from the channel. -
/unban [user]: Un-ban the specified user from the channel.
Page last edited July 31, 2025
Text editor powered by tinymce.