https://toitlang.org/ logo
Join Discord
Powered by
# help
  • Jag monitor over Ethernet
    a

    Arubinu

    04/28/2025, 7:23 PM
    Is it possible to access the monitor from the network via the IP address or name given to the ESP32?
    f
    • 2
    • 7
  • How to present function comments?
    a

    Arubinu

    05/01/2025, 1:35 PM
    I'd like to clarify how the functions/methods work, but I don't see anything official. Did I miss it? Example:
    Copy code
    cpp
    /**
     * @fn float ** merci(int*, double**,char*,int)
     * @param   \b param1 
     * @param   \b param2
     * @param   \b param3
     * @param   \b param4
     * @brief   votre briefing concernant la fonction
     * @details  les détails de la fonction
     * @return  ce qu'elle retourne
     */
    k
    f
    • 3
    • 8
  • Captive Portal + Artemis
    b

    bpmct

    05/03/2025, 10:48 PM
    I am hoping to run a fleet of devices that I can hand to friends and they can initialize on their own wifi after plugging in via a captive portal. From there, I'd love to push updates. Architectually, I'm still getting my footing here so I was wondering if anybody had any pointers on whether this is possible today/things to look our for or any recommendations on how to do this... I am assuming I could register it on my WiFi, and then have some "fallback" captive portal if the connection fails... seems the safest because it'd also allow people to move their devices but unsure what this means in practice or whether artemis supports this
    f
    • 2
    • 9
  • Device unregisters with `jag` (esp32s3)
    b

    bpmct

    05/04/2025, 3:29 PM
    I'm noticing that sometimes, I have to manually specify
    jag flash --port /dev/cu.usbmodem2101
    but it otherwise does not show up on
    jag port
    ,
    jag flash
    , or
    jag monitor
    . I am also finding cases where it lets me manually specify the port with
    jag flash
    , but
    jag monitor
    isn't able to pick it up... Any ideas? I'm using an esp32s3 and this version:
    Copy code
    ➜  toit-zygote git:(fixes) ✗ jag version
    Version:         v1.50.3
    SDK version:     v2.0.0-alpha.179
    Build date:      2025-04-01T08:09:19Z
    f
    • 2
    • 58
  • Artemis - REST API & Offline Devices
    b

    bpmct

    05/05/2025, 9:34 PM
    I am interested in allowing devices to be offline for a large amount of time (e.g. hours, days, months) but when plugged in, they re-join the fleet and may even fetch OTA updates. I also want to be able to programmatically query an API to understand which devices are offline or offline? For the offline length, it seems like I just need to set
    max-offline
    to a very long number. However, I'm not sure if artemis has the built-in capability to query whether something is on or off, besides looking at
    events
    . Is there a REST API I should be programmatically querying, or should I be sending health to artemis via events, or using an external backend to keep track of devices and health? Thanks!
    f
    • 2
    • 18
  • jag run -D jag.wifi=false (not working)
    c

    crockedile

    05/09/2025, 4:05 PM
    I'm running v2.0.0-alpha.179 and trying to run my code with the wifi connection disabled so I can put the esp32 into AP mode. When attempting to run my code with these arguments - I get the error: Error: unsupported Jaguar define: jag.wifi I was simply following the documentation here: https://github.com/toitlang/jaguar
    k
    • 2
    • 3
  • "device not configured", perhaps related to I2C
    a

    addshore

    05/12/2025, 11:25 AM
    Hi hi, We are seeing some log lines similar to this on occasion
    Copy code
    [lb-device] ERROR: Error reading from device: ESP_ERR_INVALID_STATE, got 0 bytes, sleeping for 75ms before retrying
    
    E (306797) i2c.master: I2C transaction unexpected nack detected
    
    E (306797) i2c.master: s_i2c_synchronous_transaction(876): I2C transaction failed
    
    E (306797) i2c.master: i2c_master_transmit_receive(1101): I2C transaction failed
    
    Error: device not configured
    The first I2c lines we kind of expect and can recover from (or used to be able to) however this
    Error: device not configured
    is not something we have seen before and are trying to track down. Any ideas where it might be coming from?
    f
    • 2
    • 36
  • Figuring out where some toit code is locking up
    a

    addshore

    05/14/2025, 1:31 PM
    Someone has written some code, and I suspect that it is locking up somewhere blocking on some task / channel etc, and then a watchdog is triggering. I have a core dump, stack memory, and also the code that is being run. Is there any way to go from this to try and figure out rougly where it might have been blocked?
    k
    • 2
    • 16
  • Code generation options
    a

    addshore

    05/15/2025, 9:58 AM
    I have a few hundred lines of custom yaml that defines a comms protocol Currently for go I use https://github.com/dave/jennifer to generate structs for all parts of this protocol What sort of options might there be for toit / do any exist yet / should I try and handroll something for now?
    f
    • 2
    • 22
  • GPIO interrupts?
    a

    AbedN

    05/15/2025, 12:48 PM
    Hi, I'm trying to configure one of the ESP32C6 GPIOs as an interrupt pin recieving signal from an external sensor and acting accordingly as per some routine which should run simultaneously with the rest of the program. any ideas/workarounds?
    f
    • 2
    • 2
  • Jag Disabled - Attempting to connect to network then do MQTT connection
    c

    crockedile

    05/15/2025, 5:30 PM
    Can someone please try running this code and looking into what's going on? Not sure if there are dfeault network settings I need to bypass or what...The network handling is really throwing me for a loop - I believe the code breaks because of the mqtt handling but thats as far as I got: https://cdn.discordapp.com/attachments/1372627307570921482/1372627307822448721/message.txt?ex=6827764c&is=682624cc&hm=962370bc918c11fd5c5cfc8fff58a6c1c217b28571ae326affcbb11b2f51ac14&
    f
    k
    n
    • 4
    • 10
  • User canceled the installation process
    a

    Arubinu

    05/15/2025, 6:33 PM
    I don’t have access to the toit command when installing as described in the documentation (using winget in PowerShell). It seems like I had to run the installation in Administrator mode, otherwise it would fail (at least that’s what I had to do for the update via jag). This time, even as Administrator, I’m getting these logs.
    Copy code
    shell
    > toit toitdoc serve
        toit : Le terme «toit» n'est pas reconnu comme nom d'applet de commande, fonction, fichier de script ou programme exécutable. Vérifiez l'orthographe du nom, ou si un chemin d'accès existe, vérifiez que le chemin d'accès est correct et 
        réessayez.
        Au caractère Ligne:1 : 1
        + toit toitdoc serve
        + ~~~~
            + CategoryInfo          : ObjectNotFound: (toit:String) [], CommandNotFoundException
            + FullyQualifiedErrorId : CommandNotFoundException
    Did I forget something? https://cdn.discordapp.com/attachments/1372642971060797482/1372642971312197814/WinGet-Toit.Jaguar.1.51.0-2025-05-15-20-22-46.680.log?ex=682784e2&is=68263362&hm=fb70231096ea85fe435661fe08ae336c143b1c546accf95ef2d4d7c656ff01fa&
    f
    • 2
    • 7
  • What is Primitive: 18:1 in 2.0.0-alpha.180?
    a

    addshore

    05/19/2025, 9:11 AM
    Got a stack and would love to know what primitive this is in this version? Perhaps I should write down how to find this out as it seems to come up a fair bit.
    Copy code
    Potential deadlock detected:
      Process: 3
      Program: a4ae897d-01f6-7c9d-fc35-fbe22fd3660d
      BCI: 0x3365
      Primitive: 18:1
    fatal: Potential dead-lock
    https://cdn.discordapp.com/attachments/1373951179188342874/1373951179419156550/message.txt?ex=682c473f&is=682af5bf&hm=4126efd35a96988791223e69d72badd507af655b8f6c0c2d239e846e9080b41e& https://cdn.discordapp.com/attachments/1373951179188342874/1373951179910025277/message.txt?ex=682c4740&is=682af5c0&hm=09bb0f07bde59b39883515487541aedabc68906b4aeaa6471797de2f1f7f790d& https://cdn.discordapp.com/attachments/1373951179188342874/1373951180253954089/message.txt?ex=682c4740&is=682af5c0&hm=1178145f4cf401366e9fa615398747cc779d4d855d8a4bc10e57bfa0593a7377& https://cdn.discordapp.com/attachments/1373951179188342874/1373951180560007199/message.txt?ex=682c4740&is=682af5c0&hm=35edc188db635e1f2d38a666ac320c100688bf88244e9befb5b685a3db6ae0bf& https://cdn.discordapp.com/attachments/1373951179188342874/1373951180954406952/message.txt?ex=682c4740&is=682af5c0&hm=53ea06e83ed6dc060e7be6192113df69d2eb35caa734f0c4275b73a4bfcd8e19& https://cdn.discordapp.com/attachments/1373951179188342874/1373951181285752862/message.txt?ex=682c4740&is=682af5c0&hm=3447a006d593da568379f1aeef2dd7e35f9c3ea64d64b17d395f4e3108d54c2b& https://cdn.discordapp.com/attachments/1373951179188342874/1373951181625360394/message.txt?ex=682c4740&is=682af5c0&hm=5a7b9bda582d22db663200febb313d467b398ad8f2f40242d8668fb69ce734b8& https://cdn.discordapp.com/attachments/1373951179188342874/1373951181935607899/message.txt?ex=682c4740&is=682af5c0&hm=d3f2ba2a779693172ea7aeacaf8d286da9610b7c5c2794cc197754d903c52d88&
    f
    k
    • 3
    • 29
  • Serial device does not appear in Linux when connecting a board with ESP32-S2 via USB
    j

    Jesse Sivonen

    05/21/2025, 11:22 AM
    I cannot monitor serial messages with
    jag monitor
    of my Groundstudio Carbon S2 development board because it does not appear as serial device when connected to my Linux system via USB cable. The serial device does appear at path
    /dev/ttyACM0
    when manually setting the chip into download mode using hardware buttons. The device stopped appearing after flashing Jaguar to the board using
    jag flash
    . To me, according to what I've read, that could hint that the firmware does not enable the serial USB device class of the board. Shouldn't Jaguar do that automatically? Any help would be appriciated, because debugging program is quite hard without any logging.
    f
    • 2
    • 47
  • 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?
    • 1
    • 2