https://toitlang.org/ logo
Join Discord
Powered by
# help
  • Passing arguments to a program (`jag watch` with defines)
    b

    bpmct

    05/25/2025, 12:26 AM
    I am hoping to pass arguments (key/value pairs) to my application for it to respect at runtime. I'm a bit confused. - Testing (jaguar):
    defines
    can be passed on `jag run`: https://github.com/toitlang/jaguar?tab=readme-ov-file#defines - Development (jaguar):`assets` (file) is passed on
    jag watch
    for development (I guess I need to encode this as tison (https://libs.toit.io/encoding/tison/library-summary) - Production (Artemis)`arguments` are passed in the spec: https://toit.io/schemas/artemis/pod-specification/v1.json Am I understanding this right? It feels a bit fragmented so I was wondering if you had tips, in particular, on how this can easily be done with local development (
    jag watch
    ) without hardcoding stuff.
    k
    • 2
    • 2
  • helppp illegal base64 data at input byte 440 error
    u

    ~~boss~~

    05/26/2025, 11:41 AM
    i was runing gpio example when this error show up
    f
    • 2
    • 107
  • Including generate files, adding to extension
    a

    addshore

    05/28/2025, 1:06 PM
    So, i am generating files, and I was planning on calling them all
    foo.gen.toit
    However seemingly can not be imported, due to the
    .
    Next I tried calling them all
    goo_gen.toit
    However this is also annoying as It leads to needing to
    import foo_gen
    which also would be nice to avoid. Would it be possible to make everything after a
    .
    in a file actually be determined to be part of the file extension? And then also make toit allow / look for
    .*.toit
    and
    .toit
    ?
    k
    • 2
    • 15
  • Esp-now during development
    a

    addshore

    05/30/2025, 10:11 AM
    I was skimming the docs sites, pkg and previous discord chats around usage of esp-now, and as far as I can see it won't be able to be used while a device is simultaneously connected to WiFi? Does this ultimately lead to a bit of an annoying dev cycle again? / Is there a recognized pattern to make this easier (and or any examples). Or is it just the case of turning of Jag while running such dev code trying to make use of esp now?
    f
    • 2
    • 11
  • adjust clock time (no ntp server)
    c

    crockedile

    05/30/2025, 12:55 PM
    My device is on a locked down network with no access to ntp servers or worldtime API's. I receive a MQTT message on device boot-up which contains the current timestamp in ISO 8601 format. I would like to set the ESP32's internal clock to this new timestamp, however I can only figure out how to use "adjust-real-time-clock" when using ntp.synchronize and getting the "adjustment" amount I think I just need to figure out the difference between the actual time I receive and the epoch that the device defaults too and use that difference (in seconds?) to adjust the clock. Any insight or help on this task is greatly appreciated.
    f
    k
    • 3
    • 9
  • Reducing application size
    b

    bpmct

    05/31/2025, 6:01 PM
    Hey. I discovered that, while my containers with artemis can be flashed to esp32s3, the application size is too large for esp32c3. Somehow the pod is larger when building for that target. Anyways, I removed the
    logging
    library from my application and that did the trick for now. This may be a bit of a noob question, but do you have any tips for understanding which packages/libraries/etc are larger and consuming space? I read https://medium.com/the-toit-take/get-insight-into-memory-use-on-your-esp32-running-toit-65c62e5b65fd but I'm not sure if/how this applies to packages/libraries my application. Would really appreciate some general advice here
    k
    f
    • 3
    • 14
  • Problem dhtxx and new version v2.0.0-alpha.182
    f

    Fernan

    06/01/2025, 7:09 PM
    Hi, I,ve just updated to the new version and I,m having the "EXCEPTION error. insufficient signals from DHT" since the update, and don,t find a way to downgrade to the functional version i had before that was the .175
    f
    k
    • 3
    • 117
  • data package ploblem
    u

    ~~boss~~

    06/08/2025, 5:28 AM
    Hi,im having ploblem with installing container datacake "package mqtt not found"
    f
    k
    • 3
    • 66
  • Hanging up jag monitor, UART converter vs dev board USB
    a

    addshore

    06/10/2025, 11:31 AM
    When hitting Ctrl + C on
    jag monitor
    using dev boards (USB pins on ESPs) I have ot hit it multiple times, it seems to hang, I see
    ^C^C^C^C
    in the termainl baecause of this and eventaully it exits. While using uart converters external to deav boards hitting ctrl + c normally instantly exits (desried behaviour) This is on WSL, and basically i have the issue with
    /dev/ttyACM*
    devices, but all
    /dev/ttyUSB
    devices are fine. Any thoughts on what might be up? (Otherwise i might try debugging this myself with a build of jag etc)
    f
    • 2
    • 10
  • A bunch of errors building jaguar
    a

    addshore

    06/10/2025, 1:50 PM
    I have build jaguar before, however appear to be getting a whole bunch of error from the make this time... https://pastebin.com/XCPubtYs on master of toit and main of jaguar 😦
    f
    • 2
    • 14
  • Is there a way to have a container to tell jag to turn off / diable wifi?
    a

    addshore

    06/11/2025, 3:45 PM
    I have mainly used
    -D jag.wifi=false
    while using the
    run
    command. And just gave it a go while installing a container, however on container restart jag and wifi came back up. Is there a way to either 1) get a container to tell jag to turn off the wifi? or 2) have something like
    -D jag.wifi=false
    be more persistent accross container restarts? while keeping jaguar running?
    k
    f
    • 3
    • 2
  • Remove jaguar from FW envelope
    a

    addshore

    06/12/2025, 10:49 AM
    Looking at the list of containers in a default toit built fw envelope, I see one called system
    Copy code
    system: 
      Kind: snapshot
      Id: 2ee8a16f-3df6-a81f-7174-7347ab9a8108
      Size: 165638
      Flags: 
        - trigger=boot
        - critical
    Is removing this essentially the same as building my own fw image without jaguar? (I'm guessing not, as I removed this, and also added my own container, flashed a device and seemingly it doesnt start up)
    f
    • 2
    • 9
  • ESPnow pairing
    k

    kaxori

    06/12/2025, 7:27 PM
    Before sending to a specific MAC address, pairing must be performed. Repeated pairing will result in an error message. I haven't found a function yet to check whether pairing has already occurred. For this reason, I first delete a possible previous pairing and then create it again. Don't find the solution optimal and look for a better one. Does anyone already have a good implementation?
    f
    • 2
    • 2
  • How to call a function of the base class?
    k

    kaxori

    06/13/2025, 4:46 PM
    If a derived class and its base class have both the same function implemented. But if the base calls its function the function of the derived class is executed. How can I force to call the base class function ?
    f
    k
    • 3
    • 20
  • Jaguar routing problem, followed by container stopping / not restarting
    a

    addshore

    06/16/2025, 2:12 PM
    I have added a watchdog to the container now so I expect it wont cause me an issue again, however I'm confused about what has happeend here The script was running, as shown by the INFO log line Then jaguar seems to have a panic,
    Routing problem
    and tries to reconnect? fails? and backs off? Then I see my container print
    udptocsv
    after which it tries to emit this over UDP Then there are logs to do with wifi reconnecting? After which jaguar seems to be back up? However the container is then stuck? I guess it is stuck here
    Copy code
    socket.send
        udp.Datagram row.to-byte-array address
    f
    • 2
    • 65
  • [uart] warning: event queue is full
    a

    addshore

    06/30/2025, 9:32 AM
    Trying to start some Uart comms on a bit of new hardware, and running into this warning in a loop forever https://github.com/toitlang/toit/blob/cc2adf3fa0022dd7392d793c07fcb3fc45cba946/src/resources/uart_esp32.cc#L627
    Copy code
    [uart] warning: event queue is full
    [uart] warning: event queue is full
    [uart] warning: event queue is full
    [uart] warning: event queue is full
    [uart] warning: event queue is full
    [uart] warning: event queue is full
    [uart] warning: event queue is full
    [uart] warning: event queue is full
    [uart] warning: event queue is full
    [uart] warning: event queue is full
    [uart] warning: event queue is full
    Seems to do that until reaching
    Copy code
    Potential deadlock detected:
      Process: 0
      Program: 84bd67cd-f6e7-5359-850b-5709092d5c01
    fatal: Potential dead-lock
    
    abort() was called at PC 0x4202f841 on core 0
    Or sometimes it breaks out of the loop and works? Any pointers for debugging / whats going on?
    k
    • 2
    • 3
  • How do I wake up ESP32S3 from 10MHz CPU clock?
    r

    RaspPi Parts

    07/15/2025, 4:04 PM
    Hello ESP32S3 Experts, I use Arduino IDE v2.3.6 to programme my ESP32S3 board. I set its system clock to 10MHz with the official ESP32 board manager. Codes are good and programming was successful. However, my board fell into Super Deep Sleep and cut the power of the USB serial port. Then, I cannot programme it any more. Please help me to wake it up! 😴 👎 My ESP32S3 board have hardware PWK button, Boot button, Reset Button, Flash Button, etc. I think they can cure it. 😒 I know here are many ES32S3 experts. 🙏
    f
    • 2
    • 5
  • unexpected eof error
    u

    ~~boss~~

    07/20/2025, 10:53 AM
    this showed up when i run jag monitor
    f
    • 2
    • 14
  • Pause instead of sleep?
    a

    addshore

    07/30/2025, 3:53 PM
    Is there a way to sleep, but not allowed other tasks to run during that period?
    k
    • 2
    • 11
  • w5500
    w

    wahyudi124

    07/31/2025, 5:48 AM
    #1025033592688087120 How to use ethernet using w5500 custom spi GPIO ?
    f
    • 2
    • 1
  • Embed a 15KB file with a container
    a

    addshore

    07/31/2025, 9:00 AM
    I have a 15KB PCM audio file that I want to embed with a container. My plan is to have the container send this data to a C service to play to a bluetooth speaker.
    f
    • 2
    • 1
  • simple BLE HID device example.
    k

    kaxori

    08/01/2025, 7:54 PM
    Has anyone already implemented something like this and can provide code snippets? The goal is to trigger the smartphone camera with volume-up event.
    f
    • 2
    • 3
  • How to configure static IP using WIFI or ETH
    w

    wahyudi124

    08/03/2025, 4:21 AM
    How to configure wifi and ethernet using static ip
    f
    • 2
    • 5
  • USB Audio Class Device
    z

    z3ugma

    08/03/2025, 4:34 AM
    I am aiming to make an ESP32-S3: Appear as a USB Audio Class Device when plugged into a host PC Receive digital audio (PCM) from the host. Decode the audio and play it into a DAC/amp An alternative plan I have looked at would be: 1. USB Audio Class Support use the TinyUSB stack, which is supported in ESP-IDF and Arduino-ESP32 Implement a UAC1 or UAC2 sink device (only needs to receive audio). 2. Audio Streaming Interface The host sends PCM frames (typically 16-bit, stereo, 44.1kHz or 48kHz) over isochronous USB endpoints. define a USB descriptor that tells the host that the device supports audio streaming at certain formats. 3. Audio Output Path Streamed audio is written to a DMA-capable I2S buffer, which outputs to a DAC to the headphone amp Has anyone implemented the UAC2 or UAC1? Something like [UAC 2.0 ](https://docs.espressif.com/projects/esp-iot-solution/en/latest/usb/usb_overview/usb_device_solutions.html#usb-audio-device-solution)
    f
    m
    • 3
    • 7
  • Problems with seeed esp32-C3
    k

    kaxori

    08/03/2025, 10:17 AM
    I flashed 4 seeed esp32-C3 with identical flash parameters, but only one connects successfully to wifi. 3 devices report
    running Jaguar failed due to 'DEADLINE_EXCEEDED'
    Did anyone have similar experiences and a solution ?
    f
    k
    • 3
    • 34
  • TOIT USB
    m

    MichaelK

    08/04/2025, 2:31 PM
    https://cdn.discordapp.com/attachments/1401935458786873394/1401935458992132217/toit_usb_q.txt?ex=6892be64&is=68916ce4&hm=7306fc216183d12fc18a180384e4f4584d6f11ea994dff29cb8fe8cb6ba3ed56&
    f
    • 2
    • 1
  • Can a Cat-M modem connect to an existing 4G/LTE mobile network?
    r

    RaspPi Parts

    08/04/2025, 3:23 PM
    Hello Friends, I am very confused when I choose mobile network and global SIM card service providers. They said LTE Cat-1 (the slower version of LTE) modem can connect to 4G mobile network. So, how about Cat-M modem? Can it connect to an existing 4G mobile network? Please help me to clarify. 🧐
    f
    • 2
    • 2
  • Stop a blocking sleep
    p

    pkarsy

    08/04/2025, 6:15 PM
    Hi, lets say we have this task task:: pin := gpio.Pin 2 --output while true: pin.set 1 sleep --ms=2000 pin.set 0 sleep --ms=2000 After a button press(another task or the same task) we need to respond immediatelly, so the sleep here is inapropriate. I have tried with "monitor" Mutex await try-await but I cannot do it. Ok there is the possibility of a tight loop with "sleep --ms=50" but I have hoped for something more elegant
    f
    • 2
    • 7
  • MALLOC Failed Re-Creating SPI Device
    z

    z3ugma

    08/06/2025, 6:26 PM
    Copy code
    Heap report @ out of memory in primitive 8:2:
      ┌───────────┬──────────┬─────────────────────────────────────────────────────┐
      │   Bytes   │  Count   │  Type                                               │
      ├───────────┼──────────┼─────────────────────────────────────────────────────┤
      │    5648   │    513   │  heap overhead                                      │
      │  173528   │    467   │  untagged                                           │
      └───────────┴──────────┴─────────────────────────────────────────────────────┘
      Total: 179176 bytes in 467 allocations (53%), largest free 116k, total free 152k
    
    ******************************************************************************
    MALLOC_FAILED error.
      0: S6d05a1.draw-test-pattern s6d05a1.toit:560:20
      1: main.<block>              display_new.toit:43:12
      2: SmallInteger_.repeat      <sdk>/core/numbers.toit:1288:3
      3: main                      display_new.toit:42:5
    ******************************************************************************
    I can reliably make this memory allocation fail by commenting and uncommenting a line in this code:
    Copy code
    main:
      print "initializing display..."
      driver := S6d05a1 bus cs 320 320 --reset=reset 
      5.repeat:
        driver.draw-test-pattern
        sleep --ms=600
    f
    • 2
    • 35
  • Use jag to determine which version of a package is installed
    a

    addshore

    08/14/2025, 2:32 PM
    I have some docs that want to do copy paste instructions, and I dont want to update them every time a new version of a package is updated. It is somehting like
    Copy code
    sh
    mkdir my-x-project
    cd my-x-project
    jag pkg init
    jag pkg install github.com/x-io/toit-x
    then
    Copy code
    sh
    cp ./.packages/github.com/x-io/toit-x/v0.1.1/examples/eink.toit ./main.toit
    But I dont want to hardcode v0.1.1 Is there already a command I am missing that might say what is installed and being used by the project?
    f
    • 2
    • 10