What follows is a quick list of potential problems and solutions for Bluetooth connection issues. For more general problems, please look at the main Troubleshooting page
Have you got a Bangle.js? There's also a specific Bangle.js Troubleshooting page
If your problem isn't covered, please post in the Forum.
COMx
in Windows and it's connecting but I get no responseHelp
-> About Google Chrome
) - it should be at least version 51Low Energy
supported in About this Mac
-> System Report
/Bluetooth
COMx
in Windows and it's connecting but I get no responseBluetooth LE Serial devices (Nordic UART Service) like Espruino are not treated as serial port devices by Windows. If the IDE's connection menu shows devices beginning with the word COM
(eg. COM5
), they are not your device and connecting to them won't work.
Check out the Quick Start Guide for more information.
Espruino BLE devices can only accept one incoming connection at a time. When a device is connected to it, it stops advertising and so cannot be connected to until the first device disconnects.
As a result, if you can't see your device advertising then it is probably because some other device that is connected. It may even be an application on the same device.
Some BLE apps on phones automatically reconnect, as do most devices if you've configured Espruino as a BLE HID device).
Have you been running one of the Nordic
/nRF
applications? If so, make sure
it is closed (Click the square icon to get to the application chooser, and swipe
the application to the left or right)
Mac OS's Security & Privacy
settings may be blocking Chrome.
Try: System Preferences
—> Security & Privacy
—> Bluetooth
-> Add Google Chrome
This often happens if you've turned your Espriuno into a HID device and paired it with your Mac.
option
key down while clicking on the Bluetooth icon in the top right menu bar.Puck.js abcd
in bold on the drop-down listDisconnect
and Remove
Remove
First, make sure you have an up to date version of Bluez installed - see the Web Bluetooth on Linux page
Web Bluetooth on Chrome for Linux isn't officially supported by Google, so it can be a bit unstable.
sudo /etc/init.d/bluetooth restart
and try and reconnect.Update your device's firmware to the most recent version - the very first firmware versions for Puck.js especially could have issues with some computers.
Note: Non-Puck.js devices ship with much later firmware (1v90 and later) so are less likely to have these problems. It's always an idea to use the latest firmware though.
Also see below:
Check out the specific instuctions on your device's page:
If using a device like Puck.js or Pixl.js with a CR2032 battery, poke it with something nonconductive from behind, like a matchstick.
If you just want to reset your Puck.js you can also lift the battery away from the PCB slightly with a fingernail (although this doesn't work on Pixl.js).
Usually this happens if you're holding a button at startup, and the device enters bootloader mode.
However in rare cases, your firmware may have got corrupted and so the bootloader is unable to boot into Espruino. In this case, please follow your board's instructions (above) to update the firmware, which should fix the problem.
Puck.js is assembled with a clear plastic tab between the battery and PCB to keep it turned off.
See here for instructions on removing it.
This is because you're pressing the button down while putting it in. Try inserting the battery without the button pressed.
You're in bootloader mode. You get to this when you press the button while inserting the battery and then release it.
To get out, just take the battery out and re-insert it without pressing the button.
Take it apart again, and place the area on the back with the text Puck.js
against the ledge on the plastic case (the dimples in the case should
align with the holes in the PCB).
Please check your battery percentage with E.getBattery()
to ensure
that it has over 30% charge remaining. Due to the discharge of CR2032 batteries
by the time you get to this point, 90% of the power in the battery has been
used.
The microcontroller is able to function on lower voltages than the magnetometer so you will still be able to run JS even when the battery is too flat to use the magnetometer.
Anything from print
or console.log
is printed to the current console
device (set with TheDevice.setConsole()
. By default, this will be the LCD
(eg. Terminal.setConsole()
).
However:
To force the console back to the LCD you can use Terminal.setConsole()
(eg. in the onInit
function) which will keep the console on the LCD
until something (like a Bluetooth connection) changes it. Otherwise you
can use Terminal.setConsole(true)
which will keep the console on the LCD
regardless of what happens. This second method will mean that you are
unable to reprogram the device until it is reset or the console is set
to the device you're programming it from.
If you just want to write to the Terminal regardless of where the console is,
use Terminal.println(...)
It's as easy as typing save()
in the left-hand side of the IDE. When power is re-applied Espruino will resume where it left off, remembering timers, watches, and even pin state. For certain things (like initialising connected hardware like displays) you'll want to run some code when Espruino starts up, in which case you can just add a function called onInit()
or a listener for E.on('init', ...)
- it will then be executed each time Espruino starts.
For more information, see the page on Saving.
The easiest solution for this is to perform a Hard Reset, as firmware updates may not clear out saved code:
On most boards booting with BTN1 held down will usually boot without loading the saved code. However it won't have deleted your saved code. To do that, you'll need to log in and:
reset(true)
to clear out any saved codesave()
after a fresh boot to save a 'fresh' staterequire("Storage").eraseAll()
, as this will
clear any saved code, but will also remove any data that your code
may have saved using the Storage LibraryMost Espruino devices advertise themselves with names like Puck.js abcd
. The
4 character ID at the end is just the last 4 digits of the device's MAC Address.
You can get this with the command NRF.getAddress().substr(-5).replace(":","")
-
which takes the address in the form aa:bb:cc:dd:ee:ff
, strips off the last
5 characters, and removes the colon.
Check out the reference pages for NRF.setAdvertising...
You can simply call NRF.setAdvertising({},{name:"My Name"});
to change your Puck's advertised name!
Are you using Serial1
? Perhaps to connect to a GSM/LTE, WiFi, or GPS? When disconnected from Bluetooth, Espruino's REPL/'console' (what's on the left-hand side of the Web IDE) gets moved over to Serial1
if it has been initialised. If you've got a Serial device on those pins then it will then stop working.
To fix this, right at the top of your code that runs on initialisation (eg. the onInit
function or E.on('init', ...)
event), add the line Bluetooth.setConsole()
, which will force the console onto Bluetooth. After Bluetooth.setConsole()
, the console can still automatically move back to Serial1
if there is some event that forces it (Bluetooth connect and disconnect), so you can force the console to stay on Bluetooth regardless with Bluetooth.setConsole(true)
instead.
Check out the main Troubleshooting page and also the Espruino Forums
This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.