https://toitlang.org/ logo
thank you! I'll be here 🙂
# general
i
thank you! I'll be here 🙂
f
looking at it now
i
Thanks, I really appreciate your help. I haven't been able to figure out why it crashes like that.
f
could you add a the following debug code in line 75 of rpc.toit?
Copy code
print response-bytes
characteristic_.set-value response-bytes
For some reason it can't set the value, and I would like to know if the value is special in any way.
i
ok, just a minute
The part that says INFO is where I send the custom data.
f
why are there two?
Ok. The
ble-run-with-quota-backoff
attempts multiple times to connect if it gets a
QUOTA-EXCEEDED
error.
The quota-exceeded error is set when it can't allocate any internal mbuf buffers anymore.
Let me have a look if the number of mbufs is configurable.
i
There are two because I added one in the handle-request function and another in my own callback function, just to test if the same data was coming through in both
f
yes. I'm pretty sure it's the mbufs that are the problem.
i
And why do the internal buffers run out? Is it because the data I’m sending is too large?
f
The
set-value
sets the value of a characteristic.
It uses an mbuf for that.
These values stay "active".
Once set, you can ask for the value of the characteristic any time in the future.
-> every time you (or the RPC library) calls
set-value
an mbuf is used up.
Maybe, it would be possible to just unset the value of the other characteristics before setting a new one.
Alternatively, rewriting the characteristics to have a
handle-read-request
function could also work.
I think in this case no mbuf is stored in the characteristic.
I think the easiest is to clear all the values of all rpc characteristics before setting the new value.
Clearing can be done by setting
null
as value.
It's just a bit awkward, as you somehow need to give the
run_
a way to do that.
I would probably pass in a lambda that does it.
i
And should that be done by the provisioning package, or by the code in my program that uses it?
f
provisioning package.
I can try to write that, but I'm currently travelling, and don't have access to any esp32. So it would need to wait a few days.
i
No problem, thanks for helping me with this. Do you think it would be possible to add that custom characteristic to the package?
f
Yes. I would be willing to add that. Maybe make it a bit more configurable from the outside (ID, ...), but otherwise no objection.
i
thank you!
Hi! Is there a way to reset an ESP using Jaguar without unplugging and plugging it back in? I need this for when Jaguar starts as disabled.
f
There is no way to communicate with Jaguar when no endpoint is active (typically wifi).
This is even worse when you install a container with Jaguar disabled. If that timeout is too high you might even need to reflash
If I install a container with Jaguar disabled I usually start the main with
if pin32.get == 0: return
(with the pin set up first as input with pull up). This way I can reset the esp and still boot into Jaguar by connecting the pin to ground.
i
thank you!
Hi @floitsch , I hope you're doing well. Have you had a chance to look at this? Thanks.
f
I completely forgot... Maybe I can have a look tomorrow (Sunday).
I started working on it, and a patch has been uploaded to the provision-package. I modified the SDK, so it will require a new SDK release, but I hope it will work after that.
i
thanks @floitsch !
Hi @floitsch , I hope you’re doing well. Is there any update on this? I don’t see a new version of the provision package — maybe you kept it at 2.2.0. Thanks!
f
Still need to release a new version, but forgot that we have this feature pending. I will try to release one this week. If you don't see anything happening keep pinging. That will increase the priority.
i
Thanks floitsch
f
SDK and package have been released. However, the C6 envelope is now too big for Jaguar, which blocks a Jaguar release. We might need to find a way to reduce the size and do a new SDK release before creating a new version of Jaguar.
@ipotex Jaguar has been released.
i
Thanks a lot! I’ll be testing it out in the next few days.
Hi @floitsch I’ve been running some tests, and everything’s working great. I was able to complete the provisioning and send data to a custom service too, without anything breaking. The only thing I’d mention is that if you use a BLE Explorer and write to a service that uses Security 2, the program crashes. It’s related to the decryption routine not checking the type and length of the incoming data. Other than that, I haven’t found any issues and everything runs smoothly. Thank you so much!
f
Great to hear. Maybe file a bug for the security 2? Thanks
i