-
• #2
It needs to be connected at boot time. There is check that RX is pulled high otherwise serial is not enabled. Keeping serial enabled draws about 1mA constantly.
You can try from bluetooth connection to call Serial1.setup and then try Serial1.setConsole to see if it starts working.
-
• #3
As @fanoush says really... Also you could try without
'default_console_baudrate' : "38400",
and just use 9600 as a start because that's what Espruino usually defaults to (including the IDE).... so it could be that it's all working and the IDE's baud rate is wrong?
Once connected by Bluetooth you could do
Serial1.println("Hello")
andSerial1.on("data",print)
to check out if RX/TX is working separately -
• #4
I made sure it was all wired at power up and sure enough, it lit up just fine (@ 38400 too). This will be interesting as my true target for this is battery powered. Maybe I'll add a watch on button hold to enable Serial1 and setConsole...
Either way, thank you both! One step forward.
(BTW: the target board is a C20 smartwatch [https://www.aliexpress.com/item/33025338264.html] which were on sale last year for $10US. One became an experiment and I somehow fried the BT system, so looking for an alternate console. )
-
• #5
you can monitor RX pin with setWatch (with input pulldown) and when it goes up you reconfigure it as serial, I had it like this on DS-D6
https://gist.github.com/fanoush/ce461c73c299834bcb53a615721b5a2e#file-dsd6-js-L234You could also have pull up and monitor when it goes low if the serial is permanently attached and the pin is high but first character may be lost, which is still ok for console if you first press Enter and wait a bit.
For ds-d6 I went with first option so console was enabled when I plugged it into usb female attached to usb serial adapter.
I'd like to use Web Serial (not Web Bluetooth) for IDE on an NRF52 breakout board.. Here are lines from the board file:
The build works (I still have Bluetooth in the libraries and my test board can connect to the IDE that way). I'm using a CP2102 to connect with TXD going to D7, RXD to D5 (and I've tried it reversed as well). Wiring to D7/D5 is solid. I've set the IDE to use the same baudrate for Serial. When I try to use Web Serial, I get:
Unable to retrieve board information. Connection error?
What am I missing?