The Seeed Wio LTE board is an open source gateway which enable faster IoT GPS solutions.
NOTE: Espruino for Wio LTE is no longer officially supported. The last available build is 2v08
It contains:
NOTE: THE Wio LTE Cat M1 / NB-IoT tracker IS NOT CURRENTLY DIRECTLY SUPPORTED BY ESPRUINO. The firmware for the Cat 1 board on this page may run on it, but you'll have to interface to the CAT M1/NB-IoT modem directly with AT commands. Please contact Seeedstudio directly with any queries.
Full details on flashing can be found on Seeed's website
Binaries can be found in:
Hover the mouse over a pin function for more information. Clicking in a function will tell you how to use it in Espruino.
Seeed has a complete Getting Started Guide here which is the best source of information
Seeed Wio LTE can be used much like any other Espruino USB device, with
the exception of the on-board LED which needs to be accessed with the
WioLTE.LED(r,g,b)
function.
The built-in object WioLTE
provides useful functionality:
WioLTE.setLEDPower(true);
WioLTE.LED(r,g,b); // Output a color on the LED (values range 0..255)
There are also built-in variables for each of the Grove connectors marked on the board. These are two-element arrays of Pins:
WioLTE.D38
WioLTE.D20
WioLTE.A6
WioLTE.A4
WioLTE.I2C
WioLTE.UART
They can be used with Espruino's Grove modules,
however remember to turn power on with WioLTE.setGrovePower(true);
first!
You can also access them directly:
WioLTE.D38[0].write(1);
digitalWrite(WioLTE.D38[0]);
var pin = WioLTE.D38[0];
digitalWrite(pin, 0);
The SD card can be accessed with Espruino's normal File IO.
However you must be careful not to use it less than 4 seconds before power-on, as the SD card will not have initialised by that point.
var fs = require('fs');
// Init SDCard
WioLTE.init;
var test = function() {
// List files
console.log('List files on root path:\r\n', fs.readdirSync());
// Write file
fs.writeFileSync("hello.txt", "Hello World");
// read file
console.log(fs.readFileSync("hello.txt"));
// append file
fs.appendFileSync("hello.txt", "!!!");
// read again
console.log(fs.readFileSync("hello.txt"));
};
setTimeout(test, 4000);
To use this functionality, you need to require
the wiolte
module
with require('wiolte')
.
An example showing how to connect, use the Internet connection, GPS, and SMS is below:
var board;
var APN = "UNINET";
var USERNAME = "";
var PASSWORD = "";
function wiolteStart(debug_quectel, debug_at) {
debug_quectel = debug_quectel || false;
debug_at = debug_at || false;
board = require('wiolte').connect(function(err) {
console.log("connectCB entered...");
if (err) throw err;
setTimeout(doConnect,3000);
});
board.debug(debug_quectel, debug_at);
}
function doConnect() {
board.connect(APN, USERNAME, PASSWORD, function(err) {
console.log("connectCB entered...");
if (err) throw err;
board.getIP(print);
// work after connected
setTimeout(onConnected, 5000);
});
}
function onConnected(){
// Handle call coming
board.on('RING', function(){
});
// Handle SMS coming
board.on('message', function(id){
board.SMS.read(id, function(d, sms){
if(d !== "OK") throw new Error(d);
console.log('SMS from:', sms.oaddr);
console.log(':', sms.text);
});
});
// fetch longitude, latitude every 10 s
board.geoLocStart(10000);
GetHtmlPage("http://www.pur3.co.uk/hello.txt");
}
function GetHtmlPage(html_page){
require("http").get(html_page, function(res) {
var contents = "";
console.log("Response: ",res);
res.on('data', function(d) {
contents += d;
});
res.on('close', function(d) {
console.log("Connection closed");
console.log("full page content ---> \r\n"+contents);
});
});
}
function GeoLoc() {
var coord="";
board.geoLocGet(function(err, coord) {
if(err) throw err;
console.log("longitude latitude = " + coord.lat,coord.lng);
});
}
wiolteStart();
Once initialised with:
board = require('wiolte').connect(function(err) {
if (err) throw err;
console.log("Successfully connected!);
});
Functionality provided is:
debug(boolean, boolean)
- choose debug levelreset(callback)
- Reset LTEinit(callback)
- Initialise LTEgetVersion(callback)
- returns LTE firmware versionconnect(apn, username, password, callback)
- Connect to mobile networkgetVersion(callback)
- returns current versiongetIP(callback)
- Get current IP addressgeoLocStart(period_in_milliseconds)
- Start getting geolocation datageoLocStop()
- Stop getting geolocation datageoLocGet(callback)
- Get last locationgeoLocConvert(callback(err,latlong))
- Get last location as latitude/longitudeboard.SMS
- SMS functionality with init/read/send/list/delete
functions based on the ATSMS moduleboard.Call
, with:call(number, callback)
answer(callback)
hangup(callback)
handleRing(boolean)
- if trie, will call any function added with board.on('RING', ...)
sleep(callback)
- LTE modem get into sleep mode, it can save about 100mAwake(callback)
- LTE modem wake up from sleep modeYou can buy the Wio LTE Tracker direct from Seeed
This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.