For questions regarding programming in Toit and using Toitware's end-to-end platform for network-connected, embedded devices and the internet of things.
Questions tagged [toit]
52 questions
2
votes
1 answer
Deep sleep for a specific time
I need to activate a peripheral for a specific time, then sleep for some time, and then deactivate the peripheral again.
I could do this with a simple sleep but that would keep my ESP32 awake and burn battery. Is there a way to go into deep sleep…

Florian Loitsch
- 7,698
- 25
- 30
1
vote
1 answer
AWS IoT MQTT with Toit
How do you connect to AWS IoT and pub/sub MQTT messages using Toit?
I was able to follow the MQTT tutorial on the Toit Docs site (https://docs.toit.io/tutorials/mqtt/#tls), which worked great for non-TLS between my ESP32 running Toit and a Raspberry…

A. Saunders
- 815
- 1
- 6
- 19
1
vote
1 answer
How to interpret Toit out of memory error
I am using Toit with an ESP32 eval board (ESP32_DevKitc_V4). The board is connected to another device through a UART and it is publishing to an MQTT service.
Every once in a while I get a memory leak error like the following:
Screenshot
Heap report…

tplux
- 13
- 3
1
vote
2 answers
Serializing/deserializing objects to/from JSON on Toit language
I've a few questions about using json. I can see that there are corresponding modules in the attached library lib_v1.0.2, but the examples do not use them. Is it possible to give two simple examples: serializing an object into a json string and…

Michael Kanzieper
- 709
- 1
- 10
- 20
1
vote
1 answer
ESP32 toit provisioning fails
Setup: Macbook Pro 2020 with a Satechi USB dongle, which serves the usb connections to the microcontroller. The USB cable suited for file transferring. I am using an ESP32-wroom-32E, but when that failed I also tried with an ESP32-wroom-32D and an…

Jacob Qvist
- 13
- 3
1
vote
1 answer
What does the identifier next to the dots mean?
I just signed up for an account at toit.io, and in the console I have the term "dull-hour" written on the top right.
What does this stand for? Can I change it?

Florian Loitsch
- 7,698
- 25
- 30
1
vote
2 answers
Asynchronous data exchange between tasks
The documentation in the "Tasks in Toit" section indicates that the language has facilities for asynchronous data exchange between tasks. If I understand correctly, then two classes from the monitor package: Channel and Mailbox provide this…

Michael Kanzieper
- 709
- 1
- 10
- 20
1
vote
1 answer
How can I easily get metrics emitted and shown on the toit console
I have some custom metrics I would like to emit (e.g. the current battery voltage)
Is there an easy way to get these shown on the toit console?

ptx
- 83
- 2
- 5
0
votes
1 answer
Is it possible to import system.storage running Jag v1.7.1
I am wanting to persist values on my ESP32 devices running Jaguar.
$ jag version
Version: v1.7.1
SDK version: v2.0.0-alpha.33
Build date: 2022-10-15T18:12:13Z
The best I could find was this in the documentation:…

A. Saunders
- 815
- 1
- 6
- 19
0
votes
1 answer
Is it possible to use a Camera with an ESP32 running Toit?
I recently purchased two "Aideepen ESP32-CAM W BT Board ESP32-CAM-MB Micro USB to Serial Port CH-340G with OV2640 2MP Camera Module Dual Mode". I tried flashing them with jag flash, but it failed.
The bigger question I have is, is there any way to…

A. Saunders
- 815
- 1
- 6
- 19
0
votes
1 answer
Error when trying to run the application on ESP32
I'm back to toit for the first time since February and I'm having a strange problem when I try to run the app:
micrcx@micrcx-desktop:~/toit_apps$ toit -d=dell run bubble_sort.toit
2022-06-22T20:21:52.332+0300 WARN Compiler.toitc …

Michael Kanzieper
- 709
- 1
- 10
- 20
0
votes
1 answer
Toit: Cannot import `hc_sr04`
I cannot import hc_sr04 in my Toit code. I get the error: Package for prefix 'rmt' not found. How can I fix the rmt import issue?
I have installed the hc_sr04 package.
$ toit pkg install github.com/lask/toit-hc-sr04@2.0.0
I try importing it in my…

A. Saunders
- 815
- 1
- 6
- 19
0
votes
1 answer
Toit - How can I connect to `localhost` using `http.Client`?
I am trying to test Toit on an ESP32 on my local network. I have a fastapi app running on my laptop and I'm trying to run a GET request.
I am using the http package:
$ toit pkg install github.com/toitlang/pkg-http
My Code main.py:
import…

A. Saunders
- 815
- 1
- 6
- 19
0
votes
1 answer
What's the difference between device and device-memory in pubsub?
as written in the toit standard library documentation for pub-sub (see https://libs.toit.io/pubsub/library-summary) there are two device topics. One of them is device:* and the other one device-memory:*.
I couldn't find any explanation what the…

R_B_
- 55
- 6
0
votes
1 answer
Toit Getting "Out of memory" error while posting to HTTP API
I am tryng to scan BLE devices and once I find some particular vendor, post some data to HTTP server.
For this purpose I'm using two different ESP32 devkits and Toit platform.
My code is very simple:
import ble
import http
import net
import…

Sakvojage
- 21
- 6