-
These are the results I have obtained with the new firmware (checked several times):
With the TELO 580 paired, I remove the battery from the Puck-js until the bluetooth icon of the TELO 580 indicates that no device is connected. I wait about 10 seconds with the Puck-js battery removed. Then I put the battery back (Red LED lights once) but the program does not start.
In some test, after a few seconds, the program has returned to work without doing anything. However, if I turn off the bluetooth of the TELO 580 and turn it on again, it automatically connects to the Puck.js and the program works again without having to execute the
load ()
in the WebIDE. -
I have uploaded the firmware version in the Puck.js and it has worked!
Effective, now when the TELO 580 is linked, when removing the battery to the Puck.js and put it back, it no longer gives the internal error (all the LEDs off) although the saved program does not load anymore I do not have to do a hard reset.
For the Puck.js to work again, I just have to connect to the Web IDE and execute:
load ();
Is this firmware compatible with the MDBT42Q module? I have made the prototype with Puck.js but the final version is with the module.
Thank you!
-
Hi @Gordon!
This morning (sorry for the delay!), I have loaded the firmware espruino_2v03.20_puckjs.zip into my Puck.js.
>reset(true); Erasing saved code. Done! =undefined ____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |____|___| _|_| |___|_|_|_|___| |_| espruino.com 2v03.20 (c) 2019 G.Williams >
This is the output with the new version:
NRF ERROR 0x3202 at targets/nrf5x/bluetooth.c:1957 REBOOTING. NRF ERROR 0x3202 at targets/nrf5x/bluetooth.c:1957 REBOOTING. NRF ERROR 0x3202 at targets/nrf5x/bluetooth.c:1957 REBOOTING
I hope it works.
Thanks for your support and the inconvenience
-
Hi at all!
The following program has a button connected to pin D25 (MDBT42Q firmware 2v03). When the button is pressed, the "volumeUp" command is sent to the device connected by BLE. Only when button is pressed.
I have tried the program in both Puck.js and MDBT42Q.
var controls = require("ble_hid_controls"); // Clean all previous watches clearWatch(); // Configure PIN D25 with internal pulldown resistence // Wiring to VCC. pinMode(D25, "input_pulldown"); NRF.setServices(undefined, {hid: controls.report}); setWatch(function (ptt) { if (ptt.state) { LED.set(); NRF.sendHIDReport(32, () => {}); } else { LED.reset(); NRF.sendHIDReport(0, () => {}); } }, D25, {edge: "both", debounce: 50, repeat: true});
However, when loading the code with WebIDE with the option of "Minification" Esprima (offline) an error occurs when the button is pressed for the first time. The program keeps sending the "volumeUp" command continuously.
This is the minimized code that returns
dump ()
:// Code saved with E.setBootCode Modules.addCached('ble_hid_controls','function b(a,b){NRF.sendHIDReport(a,function(){NRF.sendHIDReport(0,b)})}exports.report=new Uint8Array([5,12,9,1,161,1,21,0,37,1,117,1,149,5,9,181,9,182,9,183,9,205,9,226,129,6,149,2,9,233,9,234,129,2,149,1,129,1,192]);exports.next=function(a){b(1,a)};exports.prev=function(a){b(2,a)};exports.stop=function(a){b(4,a)};exports.playpause=function(a){b(8,a)};exports.mute=function(a){b(16,a)};exports.volumeUp=function(a){b(32,a)};exports.volumeDown=function(a){b(64,a)}');var controls=require('ble_hid_controls');clearWatch(),pinMode(D25,'input_pulldown'),NRF.setServices(undefined,{hid:controls.report}),setWatch(function(a){a.state?(LED.set(),NRF.sendHIDReport(32,()=>;)):(LED.reset(),NRF.sendHIDReport(0,()=>;));},D25,{edge:'both',debounce:50,repeat:!0});
For now, the size of the code is not a problem but I would like to apply the best possible optimization.
Any ideas?
Thanks in advance
-
Hi @Gordon!
For my part, there's no problem. If you give me a binary to load that gives us more information, I could load it and pass on the data you need.
Thank you!
-
Hi @Gordon,
The TELO580 is not a device purchased directly from the factory and I'm not sure the manufacturer will personalize a firmware ...
A question. Why does the first time connect correctly and the error only occurs when the Puck.js is restarted? Does not the MAC check the first time?
Thanks,
-
Hi @Gordon,
Yes, you're right. The rush is not good... (Spanish expression: "Las prisas no son buenas"). Sorry...
The result of the code above is as follows:
>console.log(devices); [ "e4:b3:18:0b:a6:de public", <-- PC "28:43:68:5e:7a:8a", <-- TELO580 "e4:b3:18:0b:a6:de public", <-- PC "28:43:68:5e:7a:8a", <-- TELO580 "e4:b3:18:0b:a6:de public", <-- PC "36:35:66:a1:6d:c9", <--TELO580 (Bluetooth off and then on) "e4:b3:18:0b:a6:de public", <-- PC "12:ca:65:a3:45:24", <--TELO580 (Bluetooth off and then on) ] =undefined
When the TELO bluetooth is turned off and on again, the MAC changes, although none of them is the real one (real MAC of TELO: 7e:eb:46:03:35:1c).
Thanks!
-
Hi @Gordon,
Are you sure the code posted right at the beginning is the only code running on your device?
Yes, I'm sure. I have to do a hard-reset every time the code is loaded, I connect the TELO and the Puck.js is restarted.
When a hard-reset has been performed, the code that shows me
dump()
is as follows:> dump() digitalWrite(D18,0); =undefined >
On the other hand, I have loaded the following code to see the MAC address of the TELO:
devices = []; NRF.on('connect',function(addr) { devices.push(addr); });
After connecting twice, this is the result ("e4:b3:18:0b:a6:de public" is the MAC of my PC). The other MACs correspond to TELO. It seems that they are random values...
Thanks!
-
Hello @Gordon,
I have received the USB-TTL converter and I have connected it to the Puck.js
This is error:
REBOOTING. NRF ERROR 0x3202 at ?:0 REBOOTING. NRF ERROR 0x3202 at ?:0 REBOOTING. NRF ERROR 0x3202 at ?:0 REBOOTING. NRF ERROR 0x3202 at ?:0 REBOOTING. NRF ERROR 0x3202 at ?:0 REBOOTING. NRF ERROR 0x3202 at ?:0 REBOOTING. NRF ERROR 0x3202 at ?:0 REBOOTING. NRF ERROR 0x3202 at ?:0 REBOOTING. NRF ERROR 0x3202 at ?:0 REBOOTING. NRF ERROR 0x3202 at ?:0 REBOOTING. NRF ERROR 0x3202 at ?:0 REBOOTING. ....
I hope you can help me,
-
Hello @Gordon,
I am testing with two devices. The first, is a Samsung Galaxy A5 (model 2015, Android 6.0) and with it, the Puck.js works perfectly.
The second device is a particular device (Walkie-talkie) called TELO 580 built in Android 5.1. This is my production device and with itconnected, when the battery is removed, the error occurs.
Yesterday I bought an USB-TTL converter and today, when it arrives, I will test the Puck.js and I write the result.
Thanks for you dedication.
-
@Gordon thanks for the clarification.
This project is for an installation embarked on trains and only the button will be visible, all the electronics will be hidden under a panel of difficult access. Therefore, replacing the battery can only be done once or twice a year.
My idea is to attach a battery that feeds the main power when the train is off.
Could you recommend some battery and intelligent power board that allows to use an external power (power supply) and when it is missing, switch to a battery?
Thanks!
-
@Gordon Yes, I do the Hard-reset following the instructions.
In fact, when the Puck.js is left with the 3 LEDs blinking the only way to reconnect it to the PC (or to any device) is by doing a Hard-Reset.
Thanks!
-
@Gordon thanks for answering so quickly.
I am developing a project that will be connected by BLE continuously. That's why I need additional power to the CR2032. I will opt for MDBT42Q breakout board.
-
-
Yes @Gordon, my Puck.js is currently running with version 2v03. It also happened with version 2v02.
@AkosLukacs, the fault occurs even when the phone has been unbonded. With the unbonded phone, I remove the battery and when I put it back on, the 3 LEDS turn on at the same time ...
The phone running Android 5.1
Thanks!
-
Thanks @Gordon for answering so quickly.
Yesterday I updated my Puck.js to the latest firmware version: 2v03.
It seems to have to do with the process of bonding to the phone. I have tried with another phone and it works correctly.
Is there any way to remove the previous bondings before executing the code?
Thanks!
-
Hi at all!
I am working on a project that uses the HID features on BLE. In particular, I want to send a character (volume up) each time a button is pressed. This is my code:
var controls = require("ble_hid_controls"); // Clean all previous watches clearWatch(); NRF.setServices(undefined, {hid: controls.report}); setWatch(function (ptt) { if (ptt.state) { LED2.set(); NRF.sendHIDReport(32, () => {}); } else { LED2.reset(); NRF.sendHIDReport(0, () => {}); } }, BTN, {edge: "both", debounce: 50, repeat: true});
To save the program I follow this step:
- In Espruino Web IDE, configure the option Save on send - Direct to flash (execute code at boot).
- Upload the code.
- Disconnect from the PC
- Connect to device and work.
But when I remove the battery and put it back on (without pressing BTN), the three LEDs start flashing at the same time and the program does not work and any device recognize it (PC or mobile) until I do a Hard reset.
Can anyone tell me what it means to have the three LEDs blink at the same time?
What can I do to save my program and not be deleted when I change the battery?Thank you very much in advance
- In Espruino Web IDE, configure the option Save on send - Direct to flash (execute code at boot).
Yes! everything works correctly in the Puck.js and the MDBT42Q module (updated to firmware version 2v03.32)
When the Puck-js runs out of battery, I just have to turn off the bluetooth on the TELO 580 and turn it on again so that the whole system will work again. Although this is because of the TELO not of the Puck.js
Thanks for the effort and support!