guild icon
Toit
#data package ploblem
Thread channel in help
~~boss~~
~~boss~~ 06/08/2025 05:28 AM
Hi,im having ploblem with installing container datacake "package mqtt not found"
~~boss~~
~~boss~~ 06/08/2025 05:29 AM
PS C:\Users\bossc\PycharmProjects\python posn\newfolder\.packages\github.com\kasperl\toit-datacake\0.1.2\src> jag container install datacake service.toit Installing container 'datacake' from 'service.toit' on 'fierce-egg' ... C:\Users\bossc\PycharmProjects\python posn\newfolder\.packages\github.com\kasperl\toit-datacake\0.1.2\package.lock:7:10: error: Package 'github.com/toitware/mqtt-2.1.1' not found url: github.com/toitware/mqtt ^~~~~~~~~~~~~~~~~~~~~~~~ C:\Users\bossc\PycharmProjects\python posn\newfolder\.packages\github.com\kasperl\toit-datacake\0.1.2\package.lock:11:10: error: Package 'github.com/toitware/toit-cert-roots-1.4.0' not found url: github.com/toitware/toit-cert-roots ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
floitsch
floitsch 06/08/2025 09:20 AM
Try running jag pkg install first
~~boss~~
~~boss~~ 06/08/2025 12:00 PM
PS C:\Users\bossc\PycharmProjects\python posn\newfolder> jag pkg install mqtt Error: Project has already a package with name 'mqtt' PS C:\Users\bossc\PycharmProjects\python posn\newfolder> jag pkg install datacake Error: Project has already a package with name 'datacake'
~~boss~~
~~boss~~ 06/08/2025 12:02 PM
suspecting this
~~boss~~
~~boss~~ 06/08/2025 12:02 PM
sdk: ^2.0.0-alpha.35 prefixes: certificate_roots: toit-cert-roots mqtt: mqtt packages: mqtt: url: github.com/toitware/mqtt version: 2.1.1 hash: 49eab960bb1c27245bfc52e72f6f1ec840492abb toit-cert-roots: url: github.com/toitware/toit-cert-roots version: 1.4.0 hash: bf41ee60ebba65ba01bc9ba1aa6d697e4cc4a8c7
floitsch
floitsch 06/08/2025 12:03 PM
No. Just jag pkg install
floitsch
floitsch 06/08/2025 12:03 PM
That will install (download) the dependencies.
~~boss~~
~~boss~~ 06/08/2025 12:05 PM
ohh
~~boss~~
~~boss~~ 06/08/2025 12:05 PM
trying it out
floitsch
floitsch 06/08/2025 12:06 PM
Basically:
package.yaml: a list of dependencies.
package.lock: the current solution to these dependencies.
pkg install foo: changes these two files and downloads new dependencies.
pkg install: installs the dependencies given by the package.lock file.
👌1
floitsch
floitsch 06/08/2025 12:06 PM
pkg update: update package.lock to a newer solution.
floitsch
floitsch 06/08/2025 12:07 PM
If you ever get into troubles, it's safe to delete any .packages folder. You then just need to run pkg install again.
floitsch
floitsch 06/08/2025 12:08 PM
that said: you are currently trying to run a program from within the .packages folder. So might not completely apply to your use-case.
~~boss~~
~~boss~~ 06/08/2025 12:41 PM
btw when i tried to run it in main folder it showed up error
floitsch
floitsch 06/08/2025 12:42 PM
In the main folder of what?
~~boss~~
~~boss~~ 06/08/2025 12:42 PM
PS C:\Users\bossc\toit> jag container install datacake service.toit Error: no such file or directory: 'service.toit' Usage: jag container install <name> <file> [flags] Flags: --assets string attach assets to the container -D, --define stringArray define settings to control container on device -d, --device string use device with a given name, id, or address -h, --help help for install -O, --optimization-level int optimization level (default -1) PS C:\Users\bossc\toit> jag container install src/service.toit Error: accepts 2 arg(s), received 1 Usage: jag container install <name> <file> [flags] Flags: --assets string attach assets to the container -D, --define stringArray define settings to control container on device -d, --device string use device with a given name, id, or address -h, --help help for install -O, --optimization-level int optimization level (default -1)
floitsch
floitsch 06/08/2025 12:43 PM
Did you checkout the datacake repository?
floitsch
floitsch 06/08/2025 12:46 PM
I'm guessing you are trying to install the datacake's service without cloning the repository?
If yes, then that's something I would like to add to jaguar.
Something like jag container install some-name --git=git://github.com/... service/main.toit (assuming that the git-url has a service/main.toit file)
For datacake, the file is in src/service.toit, but could/should have a bin or service directory. That's more standard. See, for example, the dhtxx package: https://github.com/toitware/toit-dhtxx
Contribute to toitware/toit-dhtxx development by creating an account on GitHub.
floitschfloitsch
In the main folder of what?
~~boss~~
~~boss~~ 06/08/2025 12:53 PM
so,i need to clone src file in gitgub into my project folder?
floitsch
floitsch 06/08/2025 12:58 PM
If you want to install a third-party program yes. At the moment.
An alternative is to use Artemis. The pod-specification allows git-entries and does all the work for you.
(edited)
👌1
floitsch
floitsch 06/08/2025 12:59 PM
I would love to extract the non-Artemis parts of the pod-specification and add it to Toit/Jaguar, but I haven't gotten around it yet.
~~boss~~
~~boss~~ 06/11/2025 01:24 PM
i tried cloning it to my project folder and this time different error occured
~~boss~~
~~boss~~ 06/11/2025 01:24 PM
PS C:\Users\bossc\toit> jag container install datacake src/service.toit Installing container 'datacake' from 'src/service.toit' on 'fierce-egg' ... src\service.toit:69:7: error: Missing implementations for interface methods class DatacakeServiceProvider extends ServiceProvider implements ServiceHandler: ^~~~~~~~~~~~~~~~~~~~~~~ <sdk>\system\services.toit:315:3: note: Missing implementation for 'handle' handle index/int arguments/any --gid/int --client/int -> any ^~~~~~ Compilation failed
floitsch
floitsch 06/11/2025 01:27 PM
@bitphlipphar any idea?
The package is covered by our health-checks, so I would have assumed that we see this issue there.
floitsch
floitsch 06/11/2025 01:29 PM
independently: from your log it looks like you have src/service.toit without any surrounding directory (like toit-datacake). Was that on purpose?
~~boss~~
~~boss~~ 06/11/2025 01:30 PM
yeah i clone only 'src' file into folder
floitsch
floitsch 06/11/2025 01:31 PM
ok. Probably works for this package, but you usually need the package.{lock|yaml} of the package to get its dependencies. This one, for example, needs toit-cert-roots and mqtt.
floitsch
floitsch 06/11/2025 01:32 PM
But that shouldn't be the reason for the error you are seeing.
floitsch
floitsch 06/11/2025 01:32 PM
Let's see what Kasper has to say.
floitsch
floitsch 06/11/2025 01:32 PM
(and I will try to find some time to reproduce. currently busy...)
👌1
bitphlipphar
bitphlipphar 06/11/2025 05:52 PM
I think we just fixed the main branch without publishing a new release.
bitphlipphar
bitphlipphar 06/11/2025 05:52 PM
The health checks look at main, but the version you can fetch through the package manager is too old to work.
~~boss~~
~~boss~~ 06/12/2025 10:54 AM
i just updated it now and it works!!!
~~boss~~
~~boss~~ 06/12/2025 10:55 AM
and how can i use multiple -D in 1 line
~~boss~~
~~boss~~ 06/12/2025 10:55 AM
?
floitsch
floitsch 06/12/2025 10:56 AM
I think you can just write jag ... -Dfoo=bar -Dtoto=tata ...
~~boss~~
~~boss~~ 06/12/2025 10:56 AM
ohh thankss
~~boss~~
~~boss~~ 06/12/2025 11:01 AM
is device-id serial number?
floitsch
floitsch 06/12/2025 11:02 AM
context?
~~boss~~
~~boss~~ 06/12/2025 11:02 AM
jag container install datacake src/service.toit \ -D datacake.api.token=... \ -D datacake.device.id=... \ -D datacake.product.slug=...
~~boss~~
~~boss~~ 06/12/2025 11:02 AM
(from github)
floitsch
floitsch 06/12/2025 11:04 AM
Given that it is prefixed with datacake I would expect this to be a value (uuid?) that you have given (or that has been given by) datacake. @bitphlipphar ?
~~boss~~
~~boss~~ 06/13/2025 02:49 PM
when i use serial number and run example in github it showed up this
~~boss~~
~~boss~~ 06/13/2025 02:49 PM
[jaguar] INFO: program bdb72de8-0169-9fcd-ded6-20dc9662b135 started [reconnect] DEBUG: connected to broker [reconnect] DEBUG: connection established [datacake.mqtt] INFO: connected {host: mqtt.datacake.co, port: 8883, client: 1294b972-4728aac} [datacake.mqtt] INFO: packet published {field: TEMPERATURE, value: 18.0} DEBUG: closing connection {reason: CANCELED} [datacake.mqtt] INFO: disconnected {host: mqtt.datacake.co, port: 8883, client: 1294b972-4728aac}
~~boss~~
~~boss~~ 06/13/2025 02:50 PM
and nothing change in datacake dashboard
floitsch
floitsch 06/13/2025 02:52 PM
To me this sounds like one of the options to datacake wasn't correct and the server rejected the connection.
floitsch
floitsch 06/13/2025 02:53 PM
Did you get the serial number from the datacake server? Or did you register it there?
~~boss~~
~~boss~~ 06/13/2025 02:57 PM
its from datacake device information
floitsch
floitsch 06/13/2025 02:58 PM
ok. good.
floitsch
floitsch 06/13/2025 03:00 PM
and you have the correct product-slug?
floitsch
floitsch 06/13/2025 03:01 PM
Here is the doc on how to find all the information:
https://docs.datacake.de/api/internal-mqtt/mqtt
Datacake provides an TLS-enabled MQTT broker that can be used to both subscribe to Device measurements as well as record them.
~~boss~~
~~boss~~ 06/13/2025 03:13 PM
thanks i figured it out
~~boss~~
~~boss~~ 06/13/2025 03:13 PM
datacake device id of mine isnt the same as on datacake url
~~boss~~
~~boss~~ 06/13/2025 03:14 PM
so i use the url one instead
~~boss~~
~~boss~~ 06/13/2025 03:14 PM
https://app.datacake.de/chatbordin-anancharoenkit/devices/d/73e7ae25-ae22-40e7-9291-a807c7c6aa07/t/dashboard-0
👍1
~~boss~~
~~boss~~ 06/16/2025 11:27 AM
how to make datacake service run before my container?
floitsch
floitsch 06/16/2025 11:28 AM
I think the datacake service client automatically waits a bit when it tries to connect to the client. As long as they are started at the same time things should work out.
But @bitphlipphar knows more about services.
~~boss~~
~~boss~~ 06/16/2025 11:29 AM
EXCEPTION error. Cannot find Datacake service 0: connect <pkg:toit-datacake>\datacake.toit:15:18 1: main new.toit:10:21 ****************************************************************************** [jaguar] ERROR: container 'main' stopped - exit code 1 [datacake] INFO: service starting [datacake] INFO: service running [wifi] DEBUG: connecting [wifi] DEBUG: connected
floitsch
floitsch 06/16/2025 11:30 AM
Let's hope Kasper has an idea.
❤️1
~~boss~~
~~boss~~ 06/16/2025 11:44 AM
i just reinstall container and it shows up exception error
~~boss~~
~~boss~~ 06/16/2025 11:44 AM
EXCEPTION error. DEADLINE_EXCEEDED 0: Sleeper_.sleep-until_.<block> <sdk>\core\timer.toit:47:44 1: Sleeper_.sleep-until_ <sdk>\core\timer.toit:33:3 2: sleep <sdk>\core\timer.toit:9:12 3: Driver.wait-for-ready_ <pkg:toit-dhtxx>\driver_.toit:150:46 4: Driver.read-data-no-catch_ <pkg:toit-dhtxx>\driver_.toit:108:21 5: Driver.read-data_.<block>.<block>.<block>.<block> <pkg:toit-dhtxx>\driver_.toit:93:20 6: Driver.read-data_.<block>.<block>.<block> <pkg:toit-dhtxx>\driver_.toit:91:32 7: Task_.with-deadline_.<block> <sdk>\core\task.toit:223:16 8: Task_.with-deadline_ <sdk>\core\task.toit:217:3 9: with-timeout <sdk>\core\utils.toit:189:24 10: with-timeout <sdk>\core\utils.toit:181:10 11: Driver.read-data_.<block>.<block> <pkg:toit-dhtxx>\driver_.toit:91:9 12: catch.<block> <sdk>\core\exceptions.toit:124:10 13: catch <sdk>\core\exceptions.toit:122:1 14: catch <sdk>\core\exceptions.toit:73:10 15: Driver.read-data_.<block> <pkg:toit-dhtxx>\driver_.toit:90:7 16: SmallInteger_.repeat <sdk>\core\numbers.toit:1288:3 17: Driver.read-data_ <pkg:toit-dhtxx>\driver_.toit:89:14 18: Driver.read-temperature <pkg:toit-dhtxx>\driver_.toit:67:31 19: main.<block> new.toit:15:20 20: Duration.of <sdk>\core\time.toit:221:10 21: Duration.periodic <sdk>\core\time.toit:276:19 22: main new.toit:13:20 ******************************************************************************
floitsch
floitsch 06/16/2025 11:48 AM
I just released a new DHT version.
floitsch
floitsch 06/16/2025 11:48 AM
Could you try with that one?
floitsch
floitsch 06/16/2025 11:48 AM
I don't remember why I didn't release it immediately. Maybe it also needs a new SDK release to work properly.
floitschfloitsch
I think the datacake service client automatically waits a bit when it tries to connect to the client. As long as they are started at the same time things should work out. But <@918...
bitphlipphar
bitphlipphar 06/17/2025 09:42 AM
I think the client assumes that the service is available when you try to use it. There is an if-absent block and no timeout. We could cut it some slack by giving it the usual ServiceClient.DEFAULT-OPEN-TIMEOUT timeout.
bitphlipphar
bitphlipphar 06/17/2025 09:43 AM
Something like changing the code that starts here https://github.com/kasperl/toit-datacake/blob/main/src/datacake.toit#L7 with this:

import system.services show ServiceResourceProxy ServiceClient import .internal.api show DatacakeService DatacakeServiceClient _client_/DatacakeServiceClient? ::= (DatacakeServiceClient).open --timeout=ServiceClient.DEFAULT-OPEN-TIMEOUT --if_absent=: null
67 messages in total