MDBT42Q Serial1 use? #8004
|
Hi, |
Replies: 2 comments 2 replies
|
Ahh, yes - this is a classic Espruino gotcha. Once UART1 is set up, when you disconnect from Bluetooth Espruinos move the console over to UART1, but having the console on UART1 then stops the All you need to do is force the console to stay on Bluetooth, so add the line |
|
Thanks Gordon! It is working now as long as I haven't re-powered the board. When in the IDE and detach from the module, code is working properly and data is received in home assistant. But when power down and up, it is not working, no data received via UART. This is my code: Serial1.setup(9600, { tx:D6, rx:D8}); function show(data){ Serial1.on("data", function(data) { show(data); }); var sens_str = ""; function updateAdvertising() { NRF.setTxPower(4); what I don't understand, that in the dump() output on the left IDE side, there is nothing to see like NRF.setTxPower(4); Is this correct, or somewhere hidden, which I cannot see? Thanks! |
Ahh - are you writing the code to RAM and then typing
save()? I don't think Espruino doesn't stores console state that way. You can either write it toFlashor you can do: