-
-
Also looks good @MaBe. You guys are saving us a job.
-
-
Yes, that makes sense, after
load()
allows you to use the websocket as you need rather than one-time.I don't think you are that far away. At the moment your websocket code is sort of orphaned but if you've got logging statements that appear after
load()
has run and when you're connected on your network that's a great start.Either bring your socket code into that part too, or maybe wrap the socket code in a function and just call it to set it up?
Briefly looking at the README for the Espruino Wifi Manager the callback function is used on successful connection, so that's probably were you have your logging that works(?) and where you need to put your code (either pasted or the function call). I'm guessing a bit.
If that does not help, post up your code as you have it now.
-
Hey @Gian were you able to move forward with your project? If I can help, I'm happy to try. Kids need this stuff :)
-
-
Actually, that's not quite right, after looking at your code file, you've got the module in your code and it would appear the Espruino Wifi Manager (I'm assuming the code belongs to that) checks the validity of the network credentials supplied by first test connecting to the Wifi network before writing to flash & rebooting (nice!) so if you bring your websocket code into there, below this line in the
start_wifi
function:console.log("Connected to: " + wifi.getIP().ip);
and defer calling
load()
until the websocket sends the credentials (yourtest
object) that should work.Given this would seem to be a one way, one time exchange of data, you could probably simplify your code again by making a HTTP POST with the data, and have a backend which can handle forms (assuming that's possible).
-
-
I'm not familiar with Espruino Wifi Manager, but looking at it, it looks like the wifi configuration is saved by first operating as an access point (192.168.4.1), after reboot the ESP8266 connects as a station to your LAN using the saved credentials.
So first time round, before save/reboot, the ESP8266 has no connectivity to anything on your Wifi network, so you will not be able to communicate via websocket to anything other than the browser connection, through which you are adding the username and password.
You will need to wait for your network connection before sending the credentials to a websocket server on your network, but this should be possible.
-
-
Got it. You could have put a battery in it @Gordon ;)
Anyway, had it playing Asteroids, which takes a bit of doing with the buttons. Kids will enjoy this. -
-
I'm looking forward to getting mine - actually this one's for my kids. On that note, when you did the badges at that node event, you had some games and stuff bundled on them I recall from the video. Can we find those anywhere? I'd like to get them hacking on the Pixl and the games would be a great start.
-
Ok thanks @Gordon, I considered using a new characteristic yes, but I'll try with the subscription to TX again first. I had no idea that a straight read from TX was bad form - as you say, likely a problem with the library
-
Both the pucks I'm using are on v1.96.
The function in the library that gives me this error is a request to read the characteristic yes.
There's another function in the API to subscribe to the characteristic, and a handler should pick up TX output. I've also tried that, but that gives me nothing at back at all.Could I do anything to make UART TX characteristic ready for a single read?
-
Looking at espruino codebase this would appear to be the error I'm getting back partially:
(from Espruino/libs/bluetooth/jswrap_bluetooth.c line 87)
BLE task completed that wasn't scheduled (%d/%d)
The numbers I get are 8/0 rather than 0/8 - I transposed them in first post
What does this error mean?
-
I'm trying to read Puck UART TX characteristic in Go, I got nowhere on Mac, but am getting something back now I'm running Linux.
But I can't make sense of the output.
It should return "hello" and frustratingly I've seen this once, but every other time I get variants on the below:
d (0/8) >
A couple of times I've had a few more characters before the d (so my inference "scheduled").
Anyone know what this is? The
>
looks like the prompt?Writing to RX works fine.
-
-
I'd like to get my hands on a couple also @Gordon. Possible?
-
To best of my knowledge dropping the extension only applies where loading the module by name only (letting the IDE find it), for an absolute path to a module (on espruino.com or otherwise) you need the whole path to the file including extension.
You're probably using IDE so Frida's example best, but assigning toVec3
rather thanvec3
is compatible with your code. It's worth pointing that out or you'll get the same error but for a different reason. -
To do this you need your phone to be advertising a service. If you have iPhone you can use the NRF Connect app to set up a service - any will do - but name it something you can pick out. Once advertising you will see the phone (or more correctly the service) name and be able to pick up the RSSI (signal strength) as part of the advertised data. I don't know about Android, unless this is built in you will need a similar app.
-
-
For this you need custom build with SD and file system support. It's not there as standard for ESP8266. Some info which may help in this recent thread
http://forum.espruino.com/conversations/318384/
Nice. What's the light? Pixl doesn't have a backlight does it. If it does I'd missed that feature. Just an LED in there?