-->
Page 4 of 6

Re: general examples

PostPosted: Sun Nov 08, 2015 5:15 pm
by xtal
Looks ok ,, I was giving up because I didn't see any espruino message like your video shows

Thx I've got something new to play with....

Is ther a link to some valid cmds ie mem size etc

Re: general examples

PostPosted: Sun Nov 08, 2015 7:20 pm
by kolban
Espruino is a JavaScript implementation so any commands or statements that are available in JavaScript can be manually entered for immediate execution or placed in a script for execution as a program. The Espruino web site contains a large number of samples and a quick start - http://www.espruino.com/Quick+Start
and a reference guide to the API - http://www.espruino.com/Reference

Once you have Espruino installed into the flash memory of your ESP8266, you now have a JavaScript run-time. Your next challenge is to figure out what kind of application you wish to write and then write it in JavaScript. If you don't yet know JavaScript, you can use your new environment as a sand-box in which to practice.

Re: general examples

PostPosted: Mon Nov 09, 2015 9:09 am
by xtal
extracted this snip from jankop's post , but can't get it to work , anybody see what the prob is...
I assume it is something to do with the require?
Code: Select allvar ssid = "12345-NETGEAR81";
var pass = "mikeis12345";
 
var http = require("http");
var wifi=require("wifi");
var ESP8266 = require("ESP8266");

print('Connecting to wifi');
         wifi.connect(ssid, pass,null, function(err) {
    print("Wifi error  ", err);
    var ipInfo = wifi.getIP();
    print("Current IP address is: " +
        ESP8266.getAddressAsString(ipInfo.ip) + ':' +
        ESP8266.getAddressAsString(ipInfo.netmask));
});

I'm seeing
Connecting to wifi
=undefined
wifi error {"errorcode":3,
"errorMessage":"No Access Point Found"}
Current IP Address is: 0.0.0.:0.0.0.0

How would I display my access points using JS?

Re: general examples

PostPosted: Mon Nov 09, 2015 10:04 am
by kolban
Here are the latest docs on ESP8266 specific functions for Espruino ...

https://github.com/espruino/Espruino/bl ... r_Guide.md

Near the start of the docs is the recipe for listing access points.