https://toitlang.org/ logo
Esp-now during development
# help
a
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
Correct. At the moment you have to turn off WiFi while running code that uses espnow. In the latest Jaguar, the flag is called
-D jag.wifi=false
, and it is exactly for these kind of use cases. It allows to run espnow code, as well as wifi hotspots.
a
makes me want to try out https://github.com/toitlang/jaguar/pull/553 again 😄
f
The UART endpoint is already committed. You just need to connect a free pin to the RX pin and configure it accordingly
a
Yeah, let me try and remember about that one too
I got the proxying working well on a devkit board, however dont appear to be able to get it to work on our hardware. Tried a bunhc of GPIO pins and I never see the
[jaguar.uart] INFO: running Jaguar device
log line 😦
f
Given that the uart-proxy uses the normal TX, you should still see that line, even if the pins aren't set up correctly.
Let's start with some easy tests: if the device has the UART endpoint running, it will send a message over the normal console. That message is prefixed with "Jag15261520" (a magic value), to identify it as an out-of-band message. If you run
jag monitor
without the
--proxy
flag, you should see this message pass by. If you never see something like this, then the uart-endpoint isn't enabled on the device.
I think the UART endpoint needs
--uart-endpoint-rx
, and`--uart-endpoint-baud` flags. If they are set, it should start the uart-endpoint. Even if the RX isn't correct, it should still print the
Jag15...
from above (or the monitor should log the "INFO..." line if started with
--proxy
).
a
Right, figured it all out I was actually using the D+ D- USB lines, which the proxy wont work with! After some more hacking, and re rememebring of things from earlier in the development cycle I think I have managed to get the proxy working!
f
If you really use this approach often you could create a custom envelope with a higher baudrate for the console. Would make sending the data faster.