-
Thanks but in the end I just created a Ping Module, I've created a pull request here which does include documentation but its really simple to use, all you gotta do is:
var p = require("Ping"); p.ping({ address: 'google.com' }, function(err, data) { console.log(data); });
to get :
{ "address": "google.com", "port": 80, "attempts": 5, "avg": 36.86366081237, "max": 54.41212654113, "min": 29.13498878479, "raw": [ 29.13498878479, 54.41212654113, 34.74617004394, 32.61685371398, 33.40816497802 ] }
-
Perhaps they are pushing "Progressive Web Apps" instead of "Chrome Apps", while this is totally uncool now, in the future it could be.
"Progressive Web Apps" wouldn't be chrome dependent and would work on all OS's, as-long as they have a browser like Chrome or Opera. They would be fully usable without installing anything first, then if you return to use the service again it will ask if you'd like it in your app draw/home-screen.
In that scenario using the Espruino IDE could be as simple as clicking a link (Provided WebUSB fix whatever it is they are doing) to use it the first time. Then if you use the IDE again it will prompt you to "Install" it (Sort of bookmark it to your home screen, but cache it to work off-line, and look more native)So in the short term, this sucks and its a pain in the ass for anyone who developed for Chrome. I first thought, "WTF? Won't this just make nobody make apps for ChromeOS? Why would they do that?" but after reading about these PWAs I think it will make developing "Native" apps far easier, only a little more work than the website itself. I was looking into the "Ionic Framework" to build some apps to communicate with the PuckJS when that drops, but if these "Service Workers" can do what they say, It could be far easier to make a website and make it a PWA, they can even do notifications, even when the app is closed.
PWAs could be useful for PuckJS, if WebBluetooth is available it could let us share our partner apps with the community without having to pay the fee to get an app onto the market, then they could also work from PCs and Phones.
I'd suggest checking this out, read it, then just go mad following links learning about everything it has to offer. My favorites are the PWA Service Workers, Push API and the Background Sync API.
TL;DR: This sucks, its a pain. But PWAs are cool.
-
-
While creating a subscriber display for my girlfriends YouTube channel with my original Espruino I ran into an issue where the Google YouTube Data API only accepts connections over Https. The original Espruino, and ESP8266 builds, don't support https like the Pico so I created httptohttps.xyz to bridge the Espruino to the Https only service.
Check out http://httptohttps.xyz/ for how to use it, I tried to make the homepage look nice. You can use the service however you'd like but I can't promise any up-time or reliability guarantees and I ask that you don't use it for commercial purposes.
Example (This is on an ESP as an Espruino)::
var http = require("http"); http.get("http://httptohttps.xyz/https://api.github.com/users/MrTimcakes", function(res) { var contents = ""; res.on('data', function(data) { contents += data; }); res.on('close', function() { console.log("MrTimcakes is from: " + JSON.parse(contents)["location"]); }); });
prints "MrTimcakes is from: Great Britain"
I will gladly take, and even ask for, suggestions to improve the service like Headers n' stuff.
I will shortly make this open-source too. -
@DrAzzy Maybe think of it as a way of giving a little for using ESP8266's for which Gordon earns nothing.
Also, you'd help hit the IPv6 over BLE goal ;) -
Gordon has mentioned this in another post but annyang has worked out well for me for my voice projects, it mostly works, if i had to guess I'd say about 95% in my experience.
-
Bonus question: In the KickStarter you mentioned "Nordic Semiconductor started porting Espruino to their chips", was this the guys over at Nordic contributing, or was this you on their behalf, maybe paid? It doesn't really matter, just curious. It'd be cool if they were invested in Espruino and wanted to list it as a capability of their product.
-
Can the Pucks talk to each other? On the nRF52832 page they mention "2.4GHz proprietary" is this the nRF24l01+ protocol? Can they talk to the nRF24l01+?
If so this would be great for things where you wanna throw some sensors about the house but you don't like the idea of clogging up all the WiFi spots some routers impose. Then if WiFi is abosulely needed you could have them all communicate to the net via a Master Puck with an ESP8266 attached. That would be a system with BLE, NFC, WiFi and nRF24 without needing a smartphone nearby.
If not, will the Puck support the Host capabilities of the nRF52? Then you could maybe pair to a puck to send it data.
EDIT: Oh, maybe the ANT capabilities are useful here.
-
-
-
-
For a temporary interface for the strip of WS2812b LEDs I use to light my bed area, I built a very simple web interface making use of the jscolor library for easy colour selection. Feel free to try it out and suggest improvements, I'm sure there are plenty to be made. Anyway here's what the interface looks like and this is the code:
var ESP8266 = require("ESP8266"), Wifi = require("Wifi"), curCol = '00FF00', index = '<title>Brightness</title><script src="//cdnjs.cloudflare.com/ajax/libs/jscolor/2.0.4/jscolor.js"></script><form><label>Color: <input class="jscolor" value="" name="color"><br><input type="submit">', arr = new Uint8ClampedArray(111*3); function onPageRequest(req, res) { var a = url.parse(req.url, true); if(a.search !== null){ if(a.search.indexOf("color")){ curCol = a.search.split('=')[1]; updateLEDs(hexToRgb(curCol)); } } if(a.pathname=="/"){ res.writeHead(200, {'Content-Type': 'text/HTML'}); res.end(index.replace('value=""', 'value="' + curCol + '"')); }else { res.writeHead(404, {'Content-Type': 'text/plain'}); res.end("404: Page "+a.pathname+" not found"); } } function hexToRgb(hex) { var bigint = parseInt(hex, 16); var r = (bigint >> 16) & 255; var g = (bigint >> 8) & 255; var b = bigint & 255; return {"r":r, "g":g, "b":b}; } function updateLEDs(color){ for (var i=0;i<arr.length;i+=3) { arr[i ] = color.g; arr[i+1] = color.r; arr[i+2] = color.b; } ESP8266.neopixelWrite(NodeMCU.D1, arr); } function onInit(){ console.log(Wifi.getIP().ip); require("http").createServer(onPageRequest).listen(80); updateLEDs(hexToRgb(curCol)); } onInit();
-
Thanks, but if Wifi.connect is used on WifiUsage, why isn't that linked as an exaple on the reference for Wifi.connect?
-
I'd like to make some snippet style examples, for things like Wifi.scan and Wifi.connect etc..., but I don't think they really fit in with the examples on the Tutorials page, the ones there are more like full projects rather than just how to use a single function. However I don't just want to post them on the forum as I'd like them to appear on the Reference as a link to an example. I believe these links are auto-generated from the other pages on espruino.com, am I correct?
-
-
-
Hey, I'm getting this error on one on my ESPs too, I was playing around with some WS2812b LEDs and I saved the code on the ESP, it became non responsive so I disconnected and couldn't reconnect. I tried to flash Espruino back on but when connecting from the WebIDE I just get this printed every few seconds. I don't mind one of my NodeMCU's being out of commission, I just hope the saving thing will allow someone to recreate this issue for debugging.
ets Jan 8 2013,rst cause:4, boot mode:(3,7) wdt reset load 0x40100000, len 1396, room 16 tail 4 chksum 0x89 load 0x3ffe8000, len 776, room 4 tail 4 chksum 0xe8 load 0x3ffe8308, len 540, room 4 tail 8 chksum 0xc0 csum 0xc0 2nd boot version : 1.4(b1) SPI Speed : 80MHz SPI Mode : QIO SPI Flash Size & Map: 32Mbit(512KB+512KB) jump to run user1 @ 1000 ;Loading -491521 bytes from flash...
-
-
Hey, I'm also playing about with an ESP and lots of WS2812b LEDs, I've made a WebSocket brightness dial, It's pretty cool to play with, but it isn't very stable :( sometimes it just stops serving any webpage. Anyway here's a Gist of the code as to not spam this thread: https://gist.github.com/MrTimcakes/6dc1c78f27d3841e47d3125e8b515407
-
@bigplik You need the latest binaries with Graphics support in them. Download the latest release and use wiflash to flash them to the ESP8266.
Just to add, if you're on Windows I believe if you install Git, and select "Use Git and optional Unix tools from the windows command prompt", you can run wiflash (Inside the download zip in the ESP8266 Folder) on windows with "sh wiflash" instead of "./wiflash" just remember to change the IP but keep the port number (":88"). Would be awesome if that was added to the docs page.
-
Does the AP list as the correct name? For me if I didn't specify authMode:"wpa2" in the options in addition to the password the AP would start incorrectly under a different SSID to the one I specified with no password. However take this with a grain of salt as I can't currently test if this is still the case, this is just from what I remember.
-
@bigplik Perhaps this thread may be of use to you http://forum.espruino.com/conversations/285779/#12949434
-
-
Perhaps this post about SerialIP on the Arduino forum will interest you.