2020-07-05 17:23:01 +02:00
|
|
|
APPLICATION = paho-mqtt-example
|
|
|
|
|
|
|
|
# If no BOARD is found in the environment, use this default:
|
|
|
|
BOARD ?= native
|
|
|
|
|
|
|
|
# This has to be the absolute path to the RIOT base directory:
|
|
|
|
RIOTBASE ?= $(CURDIR)/../..
|
|
|
|
|
|
|
|
# Comment this out to disable code in RIOT that does safety checking
|
|
|
|
# which is not needed in a production environment but helps in the
|
|
|
|
# development process:
|
|
|
|
DEVELHELP ?= 1
|
|
|
|
|
|
|
|
# Change this to 0 show compiler invocation lines by default:
|
|
|
|
QUIET ?= 1
|
|
|
|
|
|
|
|
WIFI_SSID ?= "Your_WiFi_name"
|
|
|
|
WIFI_PASS ?= "Your_secure_password"
|
|
|
|
|
2022-12-07 22:25:53 +01:00
|
|
|
# Optionally include remoteDNS support. This includes resolution of names at an
|
|
|
|
# upstream DNS server and the handling of RDNSS options in Router Advertisements
|
|
|
|
# to auto-configure that upstream DNS server.
|
|
|
|
# USEMODULE += sock_dns # include DNS client
|
|
|
|
# USEMODULE += gnrc_ipv6_nib_dns # include RDNSS option handling
|
|
|
|
|
2020-08-19 20:09:36 +02:00
|
|
|
ifneq (,$(DEFAULT_MQTT_CLIENT_ID))
|
|
|
|
CFLAGS += -DDEFAULT_MQTT_CLIENT_ID=\"$(DEFAULT_MQTT_CLIENT_ID)\"
|
|
|
|
endif
|
|
|
|
ifneq (,$(DEFAULT_MQTT_USER))
|
|
|
|
CFLAGS += -DDEFAULT_MQTT_USER=\"$(DEFAULT_MQTT_USER)\"
|
|
|
|
endif
|
|
|
|
ifneq (,$(DEFAULT_MQTT_PWD))
|
|
|
|
CFLAGS += -DDEFAULT_MQTT_PWD=\"$(DEFAULT_MQTT_PWD)\"
|
|
|
|
endif
|
|
|
|
|
2022-08-16 16:35:20 +02:00
|
|
|
USEMODULE += shell_cmds_default
|
2020-07-05 17:23:01 +02:00
|
|
|
USEMODULE += ps
|
|
|
|
USEMODULE += netdev_default
|
|
|
|
USEPKG += paho-mqtt
|
|
|
|
|
2021-11-06 18:02:31 +01:00
|
|
|
# paho-mqtt depends on TCP support, choose which stacks you want
|
2022-11-27 01:22:06 +01:00
|
|
|
GNRC_IPV6 ?= 1
|
2020-07-05 17:23:01 +02:00
|
|
|
LWIP_IPV4 ?= 0
|
2022-11-27 01:22:06 +01:00
|
|
|
LWIP_IPV6 ?= 0
|
2020-07-05 17:23:01 +02:00
|
|
|
|
2022-11-27 01:22:06 +01:00
|
|
|
include Makefile.lwip
|
|
|
|
include Makefile.gnrc
|
2020-07-05 17:23:01 +02:00
|
|
|
|
|
|
|
USEMODULE += sock_async_event
|
2020-08-31 15:20:08 +02:00
|
|
|
USEMODULE += sock_ip
|
|
|
|
USEMODULE += sock_udp
|
|
|
|
USEMODULE += sock_tcp
|
|
|
|
|
2021-11-05 16:50:53 +01:00
|
|
|
USEMODULE += ztimer
|
|
|
|
USEMODULE += ztimer_msec
|
|
|
|
|
2020-07-05 17:23:01 +02:00
|
|
|
####
|
|
|
|
|
|
|
|
include $(RIOTBASE)/Makefile.include
|
|
|
|
|
|
|
|
ifneq (,$(filter arch_esp,$(FEATURES_USED)))
|
2023-02-17 15:18:48 +01:00
|
|
|
CFLAGS += -DWIFI_SSID=\"$(WIFI_SSID)\"
|
|
|
|
CFLAGS += -DWIFI_PASS=\"$(WIFI_PASS)\"
|
2020-07-05 17:23:01 +02:00
|
|
|
endif
|