Either locally with Docker
https://nodered.org/docs/getting-started/docker
Or, in the cloud
https://nodered.org/docs/getting-started/ibmcloud
pybytes_config.json
.Disable Pybytes on boot!
import pycom
import machine
pycom.pybytes_on_boot(True)
machine.reset()
boot.py
and main.py
https://hackmd.io/@lnu-iot/cloud-platforms
https://www.frugalprototype.com/technologie-lora-reseau-lorawan/
LoRaWAN-protocol specifications, LPWAN-Technologies for IoT (2020)
LoRaWAN-protocol specifications, LPWAN-Technologies for IoT (2020)
Info regarding Pycom devices:
device_class
sets the LoRaWAN device class. Can be either LoRa.CLASS_A
or LoRa.CLASS_C
https://www.newieventures.com.au/blogtext/2018/2/26/lorawan-otaa-or-abp
Show MQTT Explorer
c.publish(topic_pub,'{"office_sensor": {"co2":' + str(co2) +
',"voc":'+ str(voc) +
',"bmp P":' + str(bmp_P) +
',"bmp temp":' + str(bmp_T) +
',"dht temp":' + str(dht_T) +
',"dht RH":' + str(dht_RH) +
'}}')
{"office_sensor": {"co2": 412,
"voc": 30,
"bmp P": 1012,
"bmp temp": 23,
"dht temp": 24,
"dht RH": 42}}
MQTT stands for MQ Telemetry Transport. It is a publish/subscribe, extremely simple and lightweight messaging protocol, designed for constrained devices and low-bandwidth, high-latency or unreliable networks. The design principles are to minimise network bandwidth and device resource requirements whilst also attempting to ensure reliability and some degree of assurance of delivery. These principles also turn out to make the protocol ideal of the emerging “machine-to-machine” (M2M) or “Internet of Things” world of connected devices, and for mobile applications where bandwidth and battery power are at a premium.
You can pass a user name and password with an MQTT packet in V3.1 of the protocol. Encryption across the network can be handled with SSL, independently of the MQTT protocol itself. Additional security can be added by an application encrypting data that it sends and receives, but this is not something built-in to the protocol, in order to keep it simple and lightweight.
sensors/+/temperature/+
As another example, for a topic of "a/b/c/d", the following example subscriptions will match:
a/b/c/d
+/b/c/d
a/+/c/d
a/+/+/d
+/+/+/+
'#' can be used as a wildcard for all remaining levels of hierarchy. This means that it must be the final character in a subscription. With a topic of "a/b/c/d", the following example subscriptions will match:
a/b/c/d
#
a/#
a/b/#
a/b/c/#
+/b/c/#
MQTT defines three levels of Quality of Service (QoS). The QoS defines how hard the broker/client will try to ensure that a message is received. Messages may be sent at any QoS level, and clients may attempt to subscribe to topics at any QoS level. This means that the client chooses the maximum QoS it will receive. For example, if a message is published at QoS 2 and a client is subscribed with QoS 0, the message will be delivered to that client with QoS 0. If a second client is also subscribed to the same topic, but with QoS 2, then it will receive the same message but with QoS 2. For a second example, if a client is subscribed with QoS 2 and a message is published on QoS 0, the client will receive it on QoS 0.
Higher levels of QoS are more reliable, but involve higher latency and have higher bandwidth requirements.
0: The broker/client will deliver the message once, with no confirmation.
1: The broker/client will deliver the message at least once, with confirmation required.
2: The broker/client will deliver the message exactly once by using a four step handshake.
https://mosquitto.org/man/mqtt-7.html