[BBC micro:bit] Serial Web APIs questions #7383
Replies: 1 comment
-
Posted at 2020-07-22 by @gfwilliams serial break? I'm not quite sure I understand... I guess it's possible that the micro:bit has the nRF51's reset wire connected to a COM port RTS/CTS wire (or similar), a bit like Arduinos?
You could send On micro:bit it's basically the nRF51 running Espruino connected to a TTL-USB converter - so Espruino sends out its 'hello' message when it boots, but that's way before a USB connection to the PC is established so it probably gets lost.
Argh, yeah. That's because micro:bit actually changed their design a while back - new micro:bits have a totally different magnetometer, and the firmware is expecting the old one. It's something that needs to be fixed in the Espruino firmware, but sadly I don't really get any positive feedback about the micro:bit's use with Espruino, so fixing it has been super low priority. I could be wrong but I think that everything still works ok, just not the magnetometer? Posted at 2020-07-22 by François
In JavaScript, I call
I've tried this without luck sadly.
Indeed One more and last thing Posted at 2020-07-22 by @gfwilliams Ok, wow - that's news to me. I think there's a very high likelihood it's to do with the micro:bit's USB-TTL conversion. Does it happen on other boards.
No... I haven't come across it. I guess it could be losing the serial data somewhere along the line? Posted at 2020-07-23 by @fanoush
what 'until I turn off serial break' means? how one can 'turn off' serial break?
just sending enter does not work? why you want the prompt? you mean just the Posted at 2020-07-23 by François
I don't know.
Is there a tool I could use to monitor raw serial data? Posted at 2020-07-28 by @gfwilliams If you could get at the actual pins in the micro:bit that go from the nRF51 to the USB interface then you might be able to use a USB-TTL converter... I've got one of the new micro:bits coming (ordered yesterday) so I'll try and look into this in a bit more detail Posted at 2020-07-30 by @gfwilliams Ok, just checked on this - turns out it's the USB interface chip takes a while to initialise when first powered on and raise the RX pin. Espruino boots up before it, checks the RX pin and decides nothing is there so it doesn't bother initialising the UART. I think sending Break causes the USB UART to reboot Espruino - it then resets and sees the RX pin is high so then initialises the UART. If you grab the latest cutting edge build now then it should work for you. I also added support for the new accelerometer & magnetometer |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2020-07-22 by François
I'm currently using the Serial Web API to communicate with the BBC micro:bit and I'm loving it so far!
There are some nits I'd love to understand though and I thought you folks may know the answer.
I'm able to connect to the BBC micro:bit device and open the serial port at 9600bps. /me happy
Then my readLoop doesn't show anything until I turn off serial break for instance. Is this expected?
Is there another way to "force" the device to send the usual prompt when port is opened?
Then, the prompt I get contains the "Uncaught InternalError: I2C Write Error 33281" message as shown below. Is there something going on I should fix?
Beta Was this translation helpful? Give feedback.
All reactions