-
Hi All,
I know its a bit vague question but do you think its possible/requires much effort to port espruino to this chip from nxp?
https://www.nxp.com/products/wireless/bluetooth-le-audio/ultra-low-power-bluetooth-low-energy-audio-solution-with-integrated-flash:NXH3675
Its BT device dedicated for audio devices. It has two M0 cores plus a dsp.Thanks,
kri100s -
I soldered 5x5 LFCSP footprints using generic metal stencil and cheap reflow oven. I would look for a generic stencil for that footprint or design one and fabricate it. OSH makes stencils, I made some with them oshstencils. I never tried plastic, they are super cheap. Reflow oven you can even build by yourself. Maybe fast option would be to find some fabrication house nearby.
With ICs and passives setting profiles is easy. It might be different story with modules. The heating profile might be different. -
-
-
That is cool. I see you got inspired by @benjaminbenben micro chat post.
-
I really like the UI. Is that custom made or some library? I need to learn more about css. Checked the functionality and it is nice not needing to reconnect. It would be nice to store the connection somehow even after the browser is reloaded. I wonder if thats possible.
Whats the goal of this project? Is it easy communication with multiple devices? -
-
Scaling as in when you resize the browser it scales with it. I am using tinydash for a web bluetooth joystick. It can be used from phone as well and right now button sizes are fixed which makes everything clattered on a small screen. WebJoystick
I think it would be great project on its own to have set of engineering controls. I will look into getting getting data through input. I saw some examples already so it shouldnt be too hard. My js skills are very basic so not sure if the quality will be good enough to push it back to original project. -
Thanks @Gordon for quick answer. Tinydash is great for experiments but very limited at the moment. Would be great if this project evolved. I would say top feature to add would be scaling.
-
-
-
-
After just disconnecting and reconnecting the IDE error goes away. Its described in the help for setServices. Now I even remember reading it. I forgot about it by the time I got to that problem :) Initially I spend a lot of time on just writing which doesnt require reset.
Note: The services on Espruino can only be modified when there is no device connected to it as it requires a restart of the Bluetooth stack
-
setInterval is the last thing I do in the program. The error I get is
in function called from system
Uncaught Error: Can't update services until BLE restartLast lines of code:
function bolidRdUpdate(){ NRF.updateServices({ 0xBCDE : { 0xABCE : { value : [FuelLevel] } } }); } setInterval( bolidRdUpdate, 1000);
After I disconnect WebIDE and connect WebBluetooth app it works fine. The errors pop up while connected to IDE on every interval.
I suppose the error explains it. BLE needs to be restarted so maybe thats how it should behave. -
Ok, I am getting closer. I was missing NRF.updateServices. Now I see the value changing. The thing is I added it in a setInterval which fires before the connection is establish causing an error. I suppose I need to detect if there is a connection and update only then.
Is there any example/tutorial for this custom services communication? -
Need some help with reading characteristic. I have a custom service and characteristics for writing to my device and reading from it. Writing works perfect. Value from read I just load from a global (FuelLevel) that I update every second in a setInterval. I know its updating because I can log it in console. When I read it from WebBluetooth app I only get the initial value that the global was loaded from but no updates. I am pretty sure I am missing something in the setServices descriptor.
NRF.setServices({ 0xBCDE : { 0xABCD : { value : [0,0,0,0,0,0], writable : true, onWrite : function(evt) { bolidControl(evt); } }, 0xABCE: { // fuel readable : true, value : [FuelLevel,0xAA] } } },{ advertise: [ 'BCDE' ] });
-
Ok, I was just wondering if I should use that pin for the new board version. I have to redesign anyway. It seems its just bad luck. I dont need a replacement. Its just that one pin. It works fine with D6 and I have still plenty to spare. Thanks @Gordon!
-
I was playing for a while now trying to get a stepper motor working with the MDBT42Q module (breakout). It worked with default wave pattern (wave) but didnt with full step. Even the default seemed a bit weak so I finally hooked up oscilloscope to the board. It turned D5 pin was busted. I checked the bare module connection to the breakout and seemed a bit skewed but the continuity is there. I cut the track on my board and used D6 and it works fine now.
I guess I was unlucky.
Let me know if there is anything special about D5 I maybe missed. I just configured it to 'output'. -
-
Thanks @opichals that looks cool and I didnt come across it. Right now I am focusing on bluetooth connection. Yesterday I had some luck making it work from both sides using custom services. A lot to learn.
Once I have the whole system going I will have to refactor a lot of things so keep the inspirations coming :) Scalable js buttons and gauges would be something I will be looking for. -
There is few joystick apps around. I looked through them but usually they are rather simple button type, limited control. I am aiming at something with more accuracy. Here is my prototype (my web development skills are very limited and its a work in progress):
https://kristosb.github.io/WebJoystick/
Also I dont want to go HID way straight away. I will follow @AkosLukacs suggestion and handle onwrite event after setting up NRF.setServices with custom data frame.
Right now I am trying to figure out if on WebBluetooth side I can stil use puck.js/uart.js or I need to go to lower level. -
@AkosLukacs Thanks, using onWrite in NRF.setServices seems to be what I was looking for. I am thinking about around 100ms update rate when the knobs for acceleration and steering are operated from joystick. Thats what I set the interval to on the webjoystick side. Like you say there is no big data payload. From what you are saying I dont need buffering. I can deal with it later once I test the setServices.
I guess I cant use the uart.js with default settings or at all on the web bluetooth side? Would be nice to see some example if you came across anything similar.@allObjects the heart beat is a good idea. I dont want the car to drive into walls full speed once it loses communication. That can be implemented easily. I will look into the Acknowledge on a later stage once I have basics working. Should be good idea for reliability.
-
I am wondering what is the best approach for updating a motor PWM over web bluetooth from the joystick or other device. In the past pre-espruino implementations I would just send data frame and commands would be just fired periodically (or on event) on the control board. With espruino you can send a whole command over BLE like:
mot.dcMotorControl(mot.dir.FWD,0.05);
I have a feeling if I do that with too hight update rate by moving a knob in my web joystick that would cause problems. It would be fine for toggling lights but not for continuously updated value. Do I just have to setInterval on the controller side or I could listen for an event from BLE? I think listening for an event would be best. Maybe with some mechanism for discarding uncaught events so they dont queue. Is there a best practice here?
-
Thanks. I will try this out with the we app I am working on. I added update for a joystick in the BolidJs project. I am still reading on the HID documentation. I wonder if it can do two way communication. I would like to be able to send information about the speed back to the controller. I have a gauge indicator there for speed. Its not necessary but would be cool if this works.
Thanks for the answer. I think it deserves a spot in my hobby project pipeline. It would be super cool to have a TWS device programable with js.