https://toitlang.org/ logo
Is there a way to install a container with -D jag....
# help
a
I have a flash ESP, but I would like to disable jag forever, without needing to reflash it without jag Is this possible? or should I just set a very large timeout?
f
If you don't need Jaguar, you can take the envelope and install the containers into it. That's typically the way we expect users to deploy their devices.
I shortly wondered if you could just uninstall the Jaguar container, but since Jaguar is the one starting the containers, you would end up without any container starting at boot. Maybe there is a way to add an "uninstall" functionality that flips the run-on-boot bits of all other containers and then removes its own container. Not really sure how easy that would be (or whether you can even remove your own container).
k
OTA to an envelope without jaguar seems like the easiest.
(you'll still need to install the containers in the envelope like Florian mentioned)
f
(untested) Basically, you need to: - Get the envelope you want to use as a base. - Install your containers:
Copy code
toit compile --snapshot -o my-prog.snapshot my-prog.main
 toit tools firmware -e my-envelope.envelope container install container-name my-prog.snapshot
- Ota update your device:
jag firmware update -d my-device-name --exclude-jaguar PATH-TO/my-envelope.envelope
k
Remember to bring your own OTA support if that's relevant.
a
Cool, all good to know. The use case is basically just running demo code on devices (which wants control of the WiFi), and just wanting it to reset when I re flash i t later. But also, not wanting to go through the "pain" or downloading the envelope, compiling the container snapshot, installing etc
f
Huge timeout works then. If you want to install a container with that, then I often add a pin check (something like
if pin32.get == 0: return
) in the beginning of my main, so I can easily get to Jaguar. Then I just pull pin32 to GND and reset the device.
a
So, other than a sneaky pin check, is there any other way of determining from another container, if jaguar is running?
k
You mean actually running - or just installed?
a
actually running, TLDR I wa thinking of changing the behaviour of my code to setup its own wifi access point if jag isnt running, and use the existing one if it is but perhaps just doing some network related check / wifi check might be easier that knowing about jag specifically?
f
The pin-check is more to actually get Jaguar running. It's basically: install my container with Jaguar disabled (with a huge timeout). That means that Jaguar will never start anymore, unless that container stops. Having the pin-check means that the container can decide that the user wants to run Jaguar and abort early, so that Jaguar starts up.
This feels a bit heavy just for development. As a reminder: I would not ship anything with Jaguar installed.
a
yeah, your probably right and perhaps the timeout with a -D flag to switch behaviour is fine for now