From dc68ffde757eb4d7d9f3cded7953a3adc4fe9f93 Mon Sep 17 00:00:00 2001 From: Florian Loitsch Date: Thu, 6 Jun 2024 15:17:30 +0200 Subject: [PATCH] Use new version of the mqtt package. --- docs/tutorials/mqtt/adafruit.mdx | 2 +- docs/tutorials/mqtt/aws.mdx | 2 +- docs/tutorials/mqtt/index.mdx | 4 ++-- tools/package.lock | 22 +++++++++++----------- tools/package.yaml | 8 ++++---- tutorial_code/mqtt_adafruit/adafruit.toit | 2 +- tutorial_code/mqtt_adafruit/package.lock | 4 ++-- tutorial_code/mqtt_adafruit/package.yaml | 2 +- tutorial_code/mqtt_aws/aws.toit | 2 +- tutorial_code/mqtt_aws/package.lock | 4 ++-- tutorial_code/mqtt_aws/package.yaml | 2 +- 11 files changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/tutorials/mqtt/adafruit.mdx b/docs/tutorials/mqtt/adafruit.mdx index 2c5379c9..2cac66dd 100644 --- a/docs/tutorials/mqtt/adafruit.mdx +++ b/docs/tutorials/mqtt/adafruit.mdx @@ -119,7 +119,7 @@ main: temperature := 25.0 10.repeat: temperature += ((random 100) - 50) / 100.0 - client.publish topic "$temperature".to-byte-array + client.publish topic "$temperature" // Don't publish too often to avoid rate limiting. sleep --ms=2_500 diff --git a/docs/tutorials/mqtt/aws.mdx b/docs/tutorials/mqtt/aws.mdx index 1fd868f8..9ad9fc8f 100644 --- a/docs/tutorials/mqtt/aws.mdx +++ b/docs/tutorials/mqtt/aws.mdx @@ -157,7 +157,7 @@ main: --certificate=create-aws-certificate options := mqtt.SessionOptions --client-id=CLIENT-ID client.start --options=options - client.publish TOPIC "hello".to-byte-array + client.publish TOPIC "hello" client.close ``` diff --git a/docs/tutorials/mqtt/index.mdx b/docs/tutorials/mqtt/index.mdx index 7ba1dbd0..58ef54d6 100644 --- a/docs/tutorials/mqtt/index.mdx +++ b/docs/tutorials/mqtt/index.mdx @@ -172,8 +172,8 @@ main: client.close ``` -Note that the payload must be a byte array. If your data is a string, simply -call `.to-byte-array` on it. +Note that the payload must be an `io.Data`, which is typically a string or a +byte array. If your data is neither, you need to convert it first. This program publishes a JSON object with the value `42` to the topic and then disconnects. Let's verify that the message was published by subscribing to the diff --git a/tools/package.lock b/tools/package.lock index 1b257e1d..0950c896 100644 --- a/tools/package.lock +++ b/tools/package.lock @@ -1,4 +1,4 @@ -sdk: ^2.0.0-alpha.144 +sdk: ^2.0.0-alpha.145 prefixes: bme280: bme280-driver cellular: cellular @@ -31,13 +31,13 @@ packages: cellular: url: github.com/toitware/cellular name: cellular - version: 2.2.0 - hash: 2f50148ed01e28ab2c3de09182b09f67ffcde776 + version: 2.2.3 + hash: ea31024e16ebf62c4a376c83d510bc27c5d00762 mqtt: url: github.com/toitware/mqtt name: mqtt - version: 2.8.1 - hash: 79c44885b4544257e1e2c94c9d1fb4c53e69fbbd + version: 2.9.0 + hash: ab5cda567a9b35e09ec0773ec08f4cb0ee90873d pkg-cli: url: github.com/toitlang/pkg-cli name: cli @@ -54,8 +54,8 @@ packages: pkg-fs: url: github.com/toitlang/pkg-fs name: fs - version: 2.2.0 - hash: 863280c5c62ac259d16d0d3b24df21209b461b14 + version: 2.3.1 + hash: 60836d4500317af2093d59d50c117d612c33f1fa prefixes: host: pkg-host pkg-host: @@ -66,8 +66,8 @@ packages: pkg-http: url: github.com/toitlang/pkg-http name: http - version: 2.7.1 - hash: 54a5bb458d9fc9305e839b878e6de3b456f5c4a6 + version: 2.7.2 + hash: 614dd0f374e70aab09f12e9466a35b779b9a8d63 pkg-ntp: url: github.com/toitlang/pkg-ntp name: ntp @@ -135,8 +135,8 @@ packages: toit-qubitro: url: github.com/kasperl/toit-qubitro name: qubitro - version: 0.4.0 - hash: 51dce189860a3d8224ed8ea233c5382b35358845 + version: 0.4.1 + hash: fb720f5ac40d91e0ae8714f07e8a81c4bf00a3fb prefixes: artemis: toit-artemis certificate_roots: toit-cert-roots diff --git a/tools/package.yaml b/tools/package.yaml index 517872d5..649f826e 100644 --- a/tools/package.yaml +++ b/tools/package.yaml @@ -4,7 +4,7 @@ dependencies: version: ^1.0.0 cellular: url: github.com/toitware/cellular - version: ^2.2.0 + version: ^2.2.3 certificate_roots: url: github.com/toitware/toit-cert-roots version: ^1.6.1 @@ -28,13 +28,13 @@ dependencies: version: ^1.15.1 http: url: github.com/toitlang/pkg-http - version: ^2.7.1 + version: ^2.7.2 morse: url: github.com/toitware/toit-morse version: ^1.0.6 mqtt: url: github.com/toitware/mqtt - version: ^2.8.1 + version: ^2.9.0 ntp: url: github.com/toitlang/pkg-ntp version: ^1.1.0 @@ -52,7 +52,7 @@ dependencies: version: ^0.3.0 qubitro: url: github.com/kasperl/toit-qubitro - version: ^0.4.0 + version: ^0.4.1 ssd1306: url: github.com/toitware/toit-ssd1306 version: ^2.0.1 diff --git a/tutorial_code/mqtt_adafruit/adafruit.toit b/tutorial_code/mqtt_adafruit/adafruit.toit index 51edd86f..9ca70083 100644 --- a/tutorial_code/mqtt_adafruit/adafruit.toit +++ b/tutorial_code/mqtt_adafruit/adafruit.toit @@ -37,7 +37,7 @@ main: temperature := 25.0 10.repeat: temperature += ((random 100) - 50) / 100.0 - client.publish topic "$temperature".to-byte-array + client.publish topic "$temperature" // Don't publish too often to avoid rate limiting. sleep --ms=2_500 diff --git a/tutorial_code/mqtt_adafruit/package.lock b/tutorial_code/mqtt_adafruit/package.lock index 4359630d..c31901f4 100644 --- a/tutorial_code/mqtt_adafruit/package.lock +++ b/tutorial_code/mqtt_adafruit/package.lock @@ -6,8 +6,8 @@ packages: mqtt: url: github.com/toitware/mqtt name: mqtt - version: 2.8.1 - hash: 79c44885b4544257e1e2c94c9d1fb4c53e69fbbd + version: 2.9.0 + hash: ab5cda567a9b35e09ec0773ec08f4cb0ee90873d toit-cert-roots: url: github.com/toitware/toit-cert-roots name: certificate_roots diff --git a/tutorial_code/mqtt_adafruit/package.yaml b/tutorial_code/mqtt_adafruit/package.yaml index 9bae97cd..23f50a82 100644 --- a/tutorial_code/mqtt_adafruit/package.yaml +++ b/tutorial_code/mqtt_adafruit/package.yaml @@ -4,4 +4,4 @@ dependencies: version: ^1.6.1 mqtt: url: github.com/toitware/mqtt - version: ^2.8.1 + version: ^2.9.0 diff --git a/tutorial_code/mqtt_aws/aws.toit b/tutorial_code/mqtt_aws/aws.toit index 2aaac47e..037333a3 100644 --- a/tutorial_code/mqtt_aws/aws.toit +++ b/tutorial_code/mqtt_aws/aws.toit @@ -35,5 +35,5 @@ main: --certificate=create-aws-certificate options := mqtt.SessionOptions --client-id=CLIENT-ID client.start --options=options - client.publish TOPIC "hello".to-byte-array + client.publish TOPIC "hello" client.close diff --git a/tutorial_code/mqtt_aws/package.lock b/tutorial_code/mqtt_aws/package.lock index 4359630d..c31901f4 100644 --- a/tutorial_code/mqtt_aws/package.lock +++ b/tutorial_code/mqtt_aws/package.lock @@ -6,8 +6,8 @@ packages: mqtt: url: github.com/toitware/mqtt name: mqtt - version: 2.8.1 - hash: 79c44885b4544257e1e2c94c9d1fb4c53e69fbbd + version: 2.9.0 + hash: ab5cda567a9b35e09ec0773ec08f4cb0ee90873d toit-cert-roots: url: github.com/toitware/toit-cert-roots name: certificate_roots diff --git a/tutorial_code/mqtt_aws/package.yaml b/tutorial_code/mqtt_aws/package.yaml index 9bae97cd..23f50a82 100644 --- a/tutorial_code/mqtt_aws/package.yaml +++ b/tutorial_code/mqtt_aws/package.yaml @@ -4,4 +4,4 @@ dependencies: version: ^1.6.1 mqtt: url: github.com/toitware/mqtt - version: ^2.8.1 + version: ^2.9.0