Function |
Description |
Parameters |
Returns |
Example |
Version |
printCenterText |
Prints centered text. |
String: text, Int: y |
|
display.printCenterText("Hello World!", 10) |
Not specified expect => V1.0.0 |
printText |
Displays text. |
String: text, Int: x, Int: y, Int: size |
|
display.printText("Hello World!", 10, 10, 1) |
Not specified expect => V1.0.0 |
displayScrolableText |
Displays scrollable text. Changes the passed in table. Pass the table in a loop of displaying it it will take care of timings. |
a table { y:int *the y pos of text* , text: String *text*, scrolled = 0 *do not change*, scrollspeed: int *reccomended is 200 ms* , scrolledon = 0 *do not change*, scrolldirection = false *do not change*, texttoprint = "" *do not change*, maxchars : int *maxchars 20 is all lenght*, x : int *if -1 its going to center*} |
|
local scrolabletext = { y = 28, text = "Hello World!", scrolled = 0, scrollspeed = 200, scrolledon = 0, scrolldirection = false, texttoprint = "", maxchars = 20, x = -1} while do display.displayScrolableText("Hello World!") system.delay(100) end |
Not specified expect => V1.0.0 |
showLargeText |
Displays a menu for showing text that wouldnt normally fit on screen. |
String: text |
|
display.showLargeText("Hello World!") |
Not specified expect => V1.0.0 |
Function |
Description |
Parameters |
Returns |
Example |
Version |
drawRectangle |
Draws a rectangle. |
Int: fromx, Int: tox, Int: fromy, Int: toy, Int: color, Int: filled |
|
display.drawRectangle(10, 20, 10, 20, 1, true) |
Not specified expect => V1.0.0 |
drawRoundRectangle |
Draws a rounded rectangle. |
Int: fromx, Int: tox, Int: fromy, Int: toy, Int: color, Int: filled, Int: round |
|
display.drawRoundRectangle(10, 20, 10, 20, 1, true, 5) |
Not specified expect => V1.0.0 |
drawCircle |
Draws a circle. |
Int: onx, Int: ony, Int: color, Int: filled, Int: radius |
|
display.drawCircle(20, 20, 1, true, 10) |
Not specified expect => V1.0.0 |
setPixel |
Sets a pixel. |
Int: x, Int: y, Int: color |
|
display.setPixel(10, 10, 1) |
Not specified expect => V1.0.0 |
drawLine |
Draws a line. |
Int: fromx, Int: fromy, Int: tox, Int: toy, Int: color |
|
display.drawLine(10, 10, 20, 20, 1) |
Not specified expect => V1.0.0 |
drawBitmap |
Draws an icon. |
Table: icon, Int: x, Int: y, Int: sizex, Int: sizey |
|
display.drawBitmap({0xFF,0xFA,0xFA,0xFA,0xFA,0xFF}, 10, 10, 8, 6) |
Not specified expect => V1.0.0 |
Function |
Description |
Parameters |
Returns |
Example |
Version |
connect |
Connects to a wifi network. |
String: ssid, String: password |
int: did it succed |
wifi.connect("ssid","password") |
Not specified expect => V1.0.0 |
connectForgot |
Connects to a wifi network and doesnt save password and name. |
String: ssid, String: password |
int: did it succed |
wifi.connectForgot("ssid","password") |
Not specified expect => V1.0.0 |
displaySavedNetworks |
Displays all saved wifi networks. And prompts to connect to one |
|
int: did it succed |
wifi.displaySavedNetworks() |
Not specified expect => V1.0.0 |
ssid |
Gets the SSID of the currently connected network. (if the ssid is "" not connected) |
|
String: SSID |
wifi.ssid() |
Not specified expect => V1.0.0 |
rssi |
Gets the RSSI (signal strenght) of the currently connected network. |
|
Int: RSSI |
wifi.rssi() |
Not specified expect => V1.0.0 |
autoconnect |
Connects to the saved network with the highest signal strength. |
|
int: did it succed |
wifi.autoconnect() |
Not specified expect => V1.0.0 |
Function |
Description |
Parameters |
Returns |
Example |
Version |
tcpCreateClient |
Creates a new TCP client. |
|
Bool: success |
wifi.tcpCreateClient() |
Not specified expect => V1.0.0 |
tcpConnect |
Establishes a secure TCP connection to a server. |
Int: client ID, String: host, Int: port |
Bool: success |
wifi.tcpConnect(client,"example.com", 80) |
Not specified expect => V1.0.0 |
tcpSend |
Sends data over a secure TCP connection. |
Int: client ID, String: data |
Bool: success |
wifi.tcpSend(client,"Hello, world!") |
Not specified expect => V1.0.0 |
tcpReceive |
Receives data over a secure TCP connection. |
Int: client ID |
String: data |
local data = wifi.tcpReceive(client) |
Not specified expect => V1.0.0 |
tcpReceiveChar |
Receives a single character over a secure TCP connection. |
Int: client ID |
String: character |
local character = wifi.tcpReceiveChar(client) |
Not specified expect => V1.0.0 |
tcpClose |
Closes a secure TCP connection. |
Int: client ID |
Bool: success |
wifi.tcpClose(client) |
Not specified expect => V1.0.0 |
Function |
Description |
Parameters |
Returns |
Example |
Version |
tcpCreateClientUnsafe |
Creates a new TCP client. |
|
Bool: success |
local client = wifi.tcpCreateClientUnsafe() |
Not specified expect => V1.0.0 |
tcpConnectUnsafe |
Establishes a TCP connection to a server. |
Int: client ID, String: host, Int: port |
Bool: success |
wifi.tcpConnectUnsafe(client,"example.com", 80) |
Not specified expect => V1.0.0 |
tcpSendUnsafe |
Sends data over a TCP connection. |
Int: client ID, String: data |
Bool: success |
wifi.tcpSendUnsafe(client,"Hello, world!") |
Not specified expect => V1.0.0 |
tcpReceiveUnsafe |
Receives data over a secure TCP connection. |
Int: client ID |
String: data |
local data = wifi.tcpReceiveUnsafe(client) |
Not specified expect => V1.0.0 |
tcpReceiveCharUnsafe |
Receives a single character over a secure TCP connection. |
Int: client ID |
String: character |
local character = wifi.tcpReceiveCharUnsafe(client) |
Not specified expect => V1.0.0 |
tcpCloseUnsafe |
Closes a secure TCP connection. |
Int: client ID |
Bool: success |
wifi.tcpCloseUnsafe(client) |
Not specified expect => V1.0.0 |
Function |
Description |
Parameters |
Returns |
Example |
Version |
tcpCreateServer |
Creates a new TCP server. |
|
Int: server ID |
local serverID = wifi.tcpCreateServer() |
>= V1.3.0 Stable |
tcpStartServer |
Starts a TCP server. |
Int: server ID, Int: port |
Bool: success |
local success = wifi.tcpStartServer(serverID, 8080) |
>= V1.3.0 Stable |
tcpAcceptClient |
Accepts a client connection on a TCP server. |
Int: server ID |
Int: client ID |
local clientID = wifi.tcpAcceptClient(serverID) |
>= V1.3.0 Stable |
tcpSendToClient |
Sends data to a client connected to a TCP server. |
Int: client ID, String: data |
Bool: success |
local success = wifi.tcpSendToClient(clientID, "Hello, Client!") |
>= V1.3.0 Stable |
tcpReceiveFromClient |
Receives data from a client connected to a TCP server. |
Int: client ID, Int: timeout (optional) |
String: data |
local data = wifi.tcpReceiveFromClient(clientID, 5000) |
>= V1.3.0 Stable |
tcpReceiveCharFromClient |
Receives a single character from a client connected to a TCP server. |
Int: client ID, Int: timeout (optional) |
String: character |
local char = wifi.tcpReceiveCharFromClient(clientID, 5000) |
>= V1.3.0 Stable |
tcpReceiveBufferFromClient |
Receives a buffer of data from a client connected to a TCP server. |
Int: client ID, Int: timeout (optional), Int: buffer size (optional) |
String: data |
local buffer = wifi.tcpReceiveBufferFromClient(clientID, 5000, 1024) |
>= V1.3.0 Stable |
tcpCloseClient |
Closes a client connection on a TCP server. |
Int: client ID |
Bool: success |
local success = wifi.tcpCloseClient(clientID) |
>= V1.3.0 Stable |
tcpClientConnected |
Checks if a client is connected to a TCP server. |
Int: client ID |
Bool: connected |
local isConnected = wifi.tcpClientConnected(clientID) |
>= V1.3.0 Stable |
tcpClientPort |
Gets the port number of a client connected to a TCP server. |
Int: client ID |
Int: port |
local port = wifi.tcpClientPort(clientID) |
>= V1.3.0 Stable |
tcpStopServer |
Stops a TCP server. |
Int: server ID |
Bool: success |
local success = wifi.tcpStopServer(serverID) |
>= V1.3.0 Stable |
tcpGetClientIP |
Gets the IP address of a client connected to a TCP server. |
Int: client ID |
String: IP address |
local clientIP = wifi.tcpGetClientIP(clientID) |
>= V1.3.0 Stable |
Function |
Description |
Parameters |
Returns |
Example |
Version |
apStart |
Starts the access point mode. |
String: ssid, String: password |
Bool: success |
wifi.apStart("MyAP", "password") |
>= V1.1.0 Stable |
apStop |
Stops the access point mode. |
|
Bool: success |
wifi.apStop() |
>= V1.1.0 Stable |
apNumConnected |
Returns the number of connected clients. |
|
Int: number of connected clients |
local num = wifi.apNumConnected() |
>= V1.1.0 Stable |
apSSID |
Returns the current SSID of the access point. |
|
String: SSID |
local ssid = wifi.apSSID() |
>= V1.1.0 Stable |
Function |
Description |
Parameters |
Returns |
Example |
Version |
require |
Asks user to enable espnow proceeds if enabled |
|
int: canProceed |
espnow.require() |
Not specified expect => V1.0.0 |
addPeer |
Add a peer to the list of peers |
String: peers mac |
int: did it succed |
espnow.addPeer("peer") |
Not specified expect => V1.0.0 |
myMac |
Returns the Devices MAC address |
|
String: mac |
espnow.myMac() |
Not specified expect => V1.0.0 |
getMac |
Prompts the user to enter a mac adress. |
SString: prompt |
String: mac |
espnow.getMac("Enter mac:") |
Not specified expect => V1.0.0 |
Function |
Description |
Parameters |
Returns |
Example |
Version |
CallbackForATT |
Enables the callback (adding to queue) |
|
int: did it succed |
espnow.CallbackForATT() |
Not specified expect => V1.0.0 |
getQueuedATT |
Gets the newest message in the queue |
|
String: macaddress , String: attachment (name of it), String: message, String: type (like you can use it like: on off change) |
espnow.getQueuedATT() |
Not specified expect => V1.0.0 |
sendATT |
Sends an attachment to a peer |
String: peers mac, String: message , String: atachment (name of it), String: type (on off change etc.) |
|
espnow.sendATT("mac","message","attachment *Car Remote etc.*","type *on off change etc.*") |
Not specified expect => V1.0.0 |
Function |
Description |
Parameters |
Returns |
Example |
Version |
CallbackForDTD |
Enables the callback (adding to queue) |
|
int: did it succed |
espnow.CallbackForDTD() |
Not specified expect => V1.0.0 |
sendDTD |
Sends a message to a peer |
String: peers mac, String: message, String type |
|
espnow.sendDTD("mac","message","type") |
Not specified expect => V1.0.0 |
getQueuedDTD |
Gets the newest message in the queue |
|
String: macaddress ,String:deviceName (senders device name), String: message, String: type |
espnow.getQueuedDTD() |
Not specified expect => V1.0.0 |
Function |
Description |
Parameters |
Returns |
Example |
Version |
socketCreate |
Creates a new ESP-NOW socket connection. |
String: macStr |
Bool: success |
espnow.socketCreate("xx:xx:xx:xx:xx:xx") |
>= V1.3.0 Stable |
socketDestroy |
Destroys an existing ESP-NOW socket connection. |
String: macStr |
Bool: success |
espnow.socketDestroy("xx:xx:xx:xx:xx:xx") |
>= V1.3.0 Stable |
socketWrite |
Writes data to an ESP-NOW socket connection. |
String: macStr, String: message |
Bool: success |
espnow.socketWrite("xx:xx:xx:xx:xx:xx", "Hello, world!") |
>= V1.3.0 Stable |
socketReadLine |
Reads a line of data from an ESP-NOW socket connection. |
String: macStr |
String: line |
espnow.socketReadLine("xx:xx:xx:xx:xx:xx") |
>= V1.3.0 Stable |
socketReadUntil |
Reads data from an ESP-NOW socket connection until a specified character is encountered. |
String: macStr, Char: chartoend |
String: data |
espnow.socketReadUntil("xx:xx:xx:xx:xx:xx", "\n") |
>= V1.3.0 Stable |
socketRead |
Reads data from an ESP-NOW socket connection. |
String: macStr |
String: data |
espnow.socketRead("xx:xx:xx:xx:xx:xx") |
>= V1.3.0 Stable |
socketAvailable |
Checks if there is available data to read from an ESP-NOW socket connection. |
String: macStr |
Int: available |
espnow.socketAvailable("xx:xx:xx:xx:xx:xx") |
>= V1.3.0 Stable |
socketCount |
Gets the number of active ESP-NOW socket connections. |
|
Int: count |
espnow.socketCount() |
>= V1.3.0 Stable |
socketList |
Gets a list of active ESP-NOW socket connections. |
|
Table: connections |
espnow.socketList() |
>= V1.3.0 Stable |
Function |
Description |
Parameters |
Returns |
Example |
Version |
get |
Sends a GET request. |
String: url, Int: expectedCode |
String: the response ("Error" if failed) |
http.get("url", 200) |
Not specified expect => V1.0.0 |
post |
Sends a POST request. |
String: url, Int: expectedCode, String: data |
String: tzhe response ("Error" if failed) |
http.post("url", 200, "data") |
Not specified expect => V1.0.0 |
unsafeGet |
Sends an insecure GET request. |
String: url, Int: expectedCode |
String: the response ("Error" if failed) |
http.unsafeGet("url", 200) |
Not specified expect => V1.0.0 |
unsafePost |
Sends an insecure POST request. |
String: url, Int: expectedCode, String: data |
String: the response ("Error" if failed) |
http.unsafePost("url", 200, "data") |
Not specified expect => V1.0.0 |
Function |
Description |
Parameters |
Returns |
Example |
Version |
time |
Gets the system time. |
|
bool: succeded, int: year, int: month, int: dayoftheweek 0-7 , int: month day, int: year day, int: hour, int: minute, int: second |
local succeded, year, month, dayoftheweek, dayofthemonth, dayoftheyear, hour, minute, second = system.time() |
Not specified expect => V1.0.0 |
delay |
Delays the system. |
Int: delayTime |
|
system.delay(1000) |
Not specified expect => V1.0.0 |
Function |
Description |
Parameters |
Returns |
Example |
Version |
info |
Sends [INFO]:appname:<text> to the console. |
String: text |
|
log.info("Text") |
Not specified expect => V1.0.0 |
debug |
Sends [DEBUG]:appname:<text> to the console if debug enabled. |
String: text |
|
log.debug("Text") |
Not specified expect => V1.0.0 |
error |
Sends [ERROR]:appname:<text> to the console. |
String: text |
|
log.error("Text") |
Not specified expect => V1.0.0 |
warning |
Sends [WARNING]:appname:<text> to the console. |
String: text |
|
log.warning("Text") |
Not specified expect => V1.0.0 |
warn |
Sends [WARNING]:appname:<text> to the console. |
String: text |
|
log.warn("Text") |
Not specified expect => V1.0.0 |
critical |
Sends [CRITICAL]:appname:<text> to the console. |
String: text |
|
log.critical("Text") |
Not specified expect => V1.0.0 |
Function |
Description |
Parameters |
Returns |
Example |
Version |
aes |
Encrypts/decrypts data using AES in ECB or CBC mode |
Int: mode (0=ECB, 1=CBC), String: key, String: data |
String: encrypted/decrypted data |
local encrypted = algo.aes(0, key, 'Secret message') |
>= V1.2.0 Stable |
aesKeygen |
Generates a random AES key of specified length |
Int: keySize (128, 192, or 256 bits) |
String: generated key |
local key = algo.aesKeygen(256) |
>= V1.2.0 Stable |
Function |
Description |
Parameters |
Returns |
Example |
Version |
sha256 |
Computes SHA-256 hash of input data |
String: data |
String: 64-character hex hash |
local hash = algo.sha256('data') |
>= V1.2.0 Stable |
sha512 |
Computes SHA-512 hash of input data |
String: data |
String: 128-character hex hash |
local hash = algo.sha512('data') |
>= V1.2.0 Stable |
sha1 |
Computes SHA-1 hash of input data |
String: data |
String: 40-character hex hash |
local hash = algo.sha1('data') |
>= V1.2.0 Stable |
Function |
Description |
Parameters |
Returns |
Example |
Version |
rsaKeygen |
Generates RSA public/private key pair |
Int: keySize (2048 or higher) |
String: publicKeyPEM, String: privateKeyPEM |
local pub, priv = algo.rsaKeygen(2048) |
>= V1.2.0 Stable |
rsaEncrypt |
Encrypts data using RSA public key |
String: publicKeyPEM, String: message |
String: encrypted data |
local encrypted = algo.rsaEncrypt(pubKey, 'secret') |
>= V1.2.0 Stable |
rsaDecrypt |
Decrypts data using RSA private key |
String: privateKeyPEM, String: encryptedData |
String: decrypted message |
local decrypted = algo.rsaDecrypt(privKey, encrypted) |
>= V1.2.0 Stable |
rsaSign |
Signs SHA256 hash using RSA private key |
String: privateKeyPEM, String: hash |
String: signature |
local signature = algo.rsaSign(privKey, hash) |
>= V1.3.0 Stable |
rsaVerify |
Verifies SHA256 hash signature using RSA public key |
String: publicKeyPEM, String: hash (SHA256), String: signature |
Bool: success |
local success = algo.rsaVerify(pubKey, hash, signature) |
>= V1.3.0 Stable |