-
-
What operating system do you have? And is it an external BLE dongle?
When using the wired connection, did you power-cycle Puck.js with serial connected? To save power, Puck.js only initialises the serial port if it detects a voltage on the RX line at boot time.
Have you had any luck when connecting to Puck.js with a mobile phone, maybe with some of the examples here: https://www.espruino.com/Puck.js+Web+Bluetooth
-
I don't see any errors... Are you connecting on your laptop after connecting on the iPad - and are you absolutely sure the code you entered is the same on both devices?
The IDE won't show you errors if the code is wrong - while it's annoying I decided not to report errors for incorrect codes to stop people brute-forcing every possible code to try and take control of other people's Pucks.
-
It doesn't support it at the moment. You could probably compile your own binary with it in if you wanted.
It might be added in the future, but even Nordic's example is tagged as 'experimental' right now. I imagine that both the central and peripheral would have to support DLE to get the extra throughput, so this might only be useful for one Puck talking to another until support is more widespread?
-
when using in landscape mode, the screen use is far from optimal.
@PiAir does the Web IDE at https://www.espruino.com/ide/ work a bit better for you? That page really is just a demo to get you started.
Is there an industry over/under for betting wether or not Apple implements some web BLE / "physical web" type stuff ever ?
@user75010 as far as I can tell, so far there's been zero interest from Apple. I mean, their browsers still don't support standard web stuff like getUserMedia, so the chances of BLE are pretty slim right now.
However I imagine that there is some chance that Google will add it to Chrome for iOS at some point, so asking users to install Chrome isn't too bad.
I just can't tell my users to "go use this specific browser" on IOS.
I would have thought that David (the developer) would be willing to rebrand the WebBLE app into an app specifically for your company that went straight to your web page. I imagine it'd be by far the cheapest way to get a multiplatform Bluetooth solution.
-
Just to add: on the receive side, you can check
E.getErrorFlags()
to see if the receive buffer has overflowed (which happens if youron('data',..
hander can't process characters fast enough (at the 512 byte input buffer gets full) - but for what you're doing that's super unlikely - I'd only expect potential problems if you go far above 115200 baud or do some hugely long calculation in the data handler. -
Hi - sorry I'm a bit late to reply here. You really did have a good look in to it!
The output buffer is relatively small, yes - but it won't cause a crash or any kind of problem if that is overflowed - the function will just take a longer time to execute as it will wait for the buffer to become non-full.
For example:
Serial1.print("Hello"); // returns immediately Serial1.print("Really long string .... ..."/* and so on */); // returns as soon as string length-128 characters have been transmitted (as then the rest is in the buffer)
Do you have up to date firmware? Does pressing Ctrl-C break out of it?
Please could you try and post up a really simple bit of code that crashes the Pico? Something I could just stick in the RHS of the IDE and try myself?
The only thing that immediately sticks out with what you're doing is:
var strRepresentation = JSON.stringify(obj); Serial1.print(strRepresentation + '\u0004');
Adding a character on to the end of strRepresentation will cause a new variable to be created. If strRepresentation really is big then it could use up all your memory (but it still shouldn't crash - it should warn you of low memory).
To get around it you'd be better off doing 2 prints:
Serial1.print(strRepresentation); Serial1.print('\u0004');
-
Looks really nice! There's no 'padding' in
drawString
- I'm pretty sure it puts each character one after the other. I guess you have 2 options:- Change your font to add another column or 2 of pixels after each character
Override drawString - you should be able to do something like:
g._ds = g.drawString; g.drawString = function(s,x,y) { s=s.toString(); for (var i=0;i<s.length;i++) g._ds(s[i],x+i*10,y); }
- Change your font to add another column or 2 of pixels after each character
-
Did you upload using the right-hand side of the IDE? The
clock
module needs to be loaded off the net, so it has to be uploaded first via the right-hand side so the IDE can detect its use and upload it.However, you may find that the
Date
class does everything that you need all by itself? http://www.espruino.com/Reference#DateYou can turn on
Set Current Time
in the Web IDE so that it will automatically set the correct time whenever you upload code. -
-
Hi,
Version 1v91 of Espruino will be fine - so I'd just use the default binary offered by the flasher. Do you have the URL of the one you tried but that didn't work so I can check?
The normal IDE should work as well. This post was from 2015, so 'latest' code then should now be included by default
Try creating a function on the right-hand side:
function foo() { debugger; digitalWrite(LED1,1); digitalWrite(LED1,0); digitalWrite(LED2,1); digitalWrite(LED2,0); }
Click upload, then after upload, in the left-hand side of the IDE, type
foo()
.It should jump in to debugger mode where you can step through line by line.
The only thing you can't do is debug code that executes during the upload process (for instance if you also wrote
foo()
on the right-hand side - but it's easy enough to type it in after, run it on a button press, or use setTimeout to do it after a delay -
It's a good point - I guess ideally there would be a Travis documentation task that build the reference pages and then copied them and the changelog into the Travis folder.
For now, you'd have to look at a certain Git commit in http://www.espruino.com/binaries/travis, and then look on GitHub at the Changelog at that revision
-
No, I'm afraid it's not going to. When I looked at it, it seemed way too heavyweight - and I'm also not convinced that ARM Thumb is supported?
Also, I'm not sure what you mean by rewrite, because you can use totally standard C functions (as long as they don't have overly complicated arguments). If someone wrote a script for it then a totally standard C file could be parsed and added without modification - the only issue comes when you try and access arrays/pointers, but you'll have problems with that anyway because of the way Espruino works to make the most of available memory.
-
-
There are actually a bunch of 'small' (for various definitions of small) JS interpreters that are just the interpreter if you wanted to use them: Duktape, JerryScript, TinyJS (which isn't really 'proper' JS), v7, and probably others.
What makes Espruino more useful is that it isn't just the interpreter though - you get the whole API to access the hardware, and for that to really work it does have to have access to the whole device.
-
-
-
It could be you're using too old a version of Python? I'm appear to be on Python 2.7.12 as the default that runs nrfutil.
Not sure though - you could ask on the Nordic forums, nrfutil is their tool.
Generally I build on debian-based systems, so something about the Python package in OpenSUSE could be causing you issues?
-
-
Can you not just overwrite the files in the blockly folder that are served up by the server?
I'm happy to use the latest version, but I don't really understand your point about JSON. You don't have to have JSON to define blocks at the moment, you just do something like this: https://github.com/espruino/EspruinoWebIDE/blob/gh-pages/blockly/blockly_robot.js
In terms of
setWatch
and other blocks, obviously you can change them yourself, but I want to keep it the same in the main Web IDE as I know there are schools at the moment that have already made teaching materials that use the current layout, and I don't want them to have to redo everything.As far as adding blocks goes, perhaps you could look at the possibility of just referencing a JS URL that contains the extra blocks? That way people could use it on any IDE - not just the server-based one.
For instance, a teacher could set every computer to get the extra blocks off a GitHub URL - and before each lesson could change what was in that GitHub repo - automatically changing the blocks that appeared on every child's computer.
-
At the moment about the best you could do is write a library as @oesterle suggests and then add your code to run in the main loop on an
idle
handler - and you probably want to compile with GCC and a Makefile too since it needs a few Python scripts to precalculate tables.Espruino ends up being quite tightly integrated to the MCU - handling sleep, interrupts, and having its own IO queues - it's basically a mini OS. While with some work could compile it to run under something else, suddenly you'd miss out on all the power saving, bluetooth, GPIO, etc.
There have been questions about that in the past, and it could be done - however there's very little incentive for me to put effort into making it easy to do since it's not likely to sell any more Espruino boards. I imagine by far the biggest interest would be from people using it on their own hardware.
-
-
-
Yes, it does - although only in 1v92 which will be released in a few days hopefully (or the 'cutting edge' travis builds).
You use it like this:
NRF.setScanResponse([0x07, // Length of Data 0x09, // Param: Complete Local Name 'S', 'a', 'm', 'p', 'l', 'e']);
Sure, the code I ended up using was:
So basically I call
end
immediately, because the connection will still be held open while the data received <Content-Length