generated from pimoroni/pico-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_iot.h
88 lines (73 loc) · 4.15 KB
/
config_iot.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef CONFIG_IOT_H
#define CONFIG_IOT_H
#include "pico/cyw43_arch.h"
// Set this if you want to connect to MQTT securely
//#define MQTT_TLS
// MQTT server host name or ip address
#define MQTT_SERVER_HOST "test.mosquitto.org"
// MQTT ports
#ifdef MQTT_TLS
#define MQTT_SERVER_PORT 8883
#else
#define MQTT_SERVER_PORT 1883
#endif
// Enable this if you don't want certificate verification but still want to connect with TLS
//#define MQTT_TLS_INSECURE
//#define MQTT_SERVER_HOST "91.121.93.94"
// add contents of https://test.mosquitto.org/ssl/mosquitto.org.crt (or your own cert) here, if you want to connect securely
#define MQTT_TLS_CERT "-----BEGIN CERTIFICATE-----\n" \
"MIIEAzCCAuugAwIBAgIUBY1hlCGvdj4NhBXkZ/uLUZNILAwwDQYJKoZIhvcNAQEL\n" \
"BQAwgZAxCzAJBgNVBAYTAkdCMRcwFQYDVQQIDA5Vbml0ZWQgS2luZ2RvbTEOMAwG\n" \
"A1UEBwwFRGVyYnkxEjAQBgNVBAoMCU1vc3F1aXR0bzELMAkGA1UECwwCQ0ExFjAU\n" \
"BgNVBAMMDW1vc3F1aXR0by5vcmcxHzAdBgkqhkiG9w0BCQEWEHJvZ2VyQGF0Y2hv\n" \
"by5vcmcwHhcNMjAwNjA5MTEwNjM5WhcNMzAwNjA3MTEwNjM5WjCBkDELMAkGA1UE\n" \
"BhMCR0IxFzAVBgNVBAgMDlVuaXRlZCBLaW5nZG9tMQ4wDAYDVQQHDAVEZXJieTES\n" \
"MBAGA1UEC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
"-----END CERTIFICATE-----\n";
// Enable and configure these (similar format to MQTT_TLS_CERT) if you want client side certificates
/*
#define MQTT_TLS_KEY \
"-----BEGIN RSA PRIVATE KEY-----\n" \
"-----END RSA PRIVATE KEY-----";
#define MQTT_TLS_CA \
"-----BEGIN CERTIFICATE-----\n" \
"-----END CERTIFICATE-----";
*/
// MQTT client id. Board id is appended to this string. Due to the 23 byte soft limit, recommended to keep it at (or under) 7 chars
// This value is also used as part of the unique_id in MQTT discovery
#define MQTT_CLIENT_ID "PicoW_"
// MQTT username and password. If empty, don't #define and leave commented out
//#define MQTT_CLIENT_USER ""
//#define MQTT_CLIENT_PASS ""
#ifndef CYW43_HOST_NAME
#define CYW43_HOST_NAME "picow-ledcontrol"
#endif
// Topic prefix, without the trailing slash
#define MQTT_TOPIC_PREFIX "picow/ledcontrol" // if enabled, leave MQTT_HOME_ASSISTANT_DISCOVERY_PREFIX as set below
//#define MQTT_TOPIC_PREFIX "homeassistant/light/picow/ledcontrol" // if enabled, set MQTT_HOME_ASSISTANT_DISCOVERY_PREFIX to empty string below
// Disable this to remove board id from the topic prefix. Leave as-is if unsure so that every PicoW automatically gets its own unique id and topic.
#define MQTT_ADD_BOARD_ID_TO_TOPIC
// This prefix is required for Home Assistant autodiscovery to work. MQTT_TOPIC_PREFIX (and if enabled, board id) is
// added to this before the string "/config". If you want your light to publish and read state under
// "homeassistant/light/picow/ledcontrol" as well (and not just use the homeassistant prefix for autodiscovery) you
// should set MQTT_TOPIC_PREFIX above to "homeassistant/light/picow/ledcontrol" and set this one to empty string.
#define MQTT_HOME_ASSISTANT_DISCOVERY_PREFIX "homeassistant/light/"
//#define MQTT_HOME_ASSISTANT_DISCOVERY_PREFIX ""
// Country code. Optionally, enable and change according to your country. Full list in https://raspberrypi.github.io/pico-sdk-doxygen/cyw43__country_8h.html
//#define WIFI_COUNTRY_CODE CYW43_COUNTRY_UK
#endif