Project

General

Profile

Changelog 3 1 15 » History » Version 2

Torbjorn Carlqvist Admin, 09/14/2023 01:15 PM

1 1 Torbjorn Carlqvist Admin
h1. Changelog 3.1.15
2
3
New features:
4
5
h3. Direct GPIO support
6
7
Introduced control of generic GPIO on various (pi)-platforms to control pins on the 40-pin header directly from javascript. 
8
This is a first effort of direct IO and only 5 input and 3 output pins are accessible and enumerated as A to E for input and A to C for output.
9
The mapping for Raspberry Pi platforms is:
10
11
Inputs:
12
A -> pin 29
13
B -> pin 31
14
C -> pin 33
15
D -> pin 35
16
E -> pin 37
17
18
Output
19
A -> pin 19
20
B -> pin 21
21
C -> pin 23
22
23
!gpio_rpi_pinout.PNG!
24
25
To access the pins via javascript use:
26
<pre><code class="javascript">
27
    //To set output level ("high" and "low" is valid)
28
    Controller.GPIOSetOutputChannel("B","high");
29
    //To read the output or input channels (will return "high" or "low")
30
    print(Controller.GPIOGetInputChannel("B"));
31
    print(Controller.GPIOGetOutputChannel("A"));
32
</code></pre>
33
34
35
To listen on events:
36
<pre><code class="javascript">
37
/**
38
 * Invoked when any of the GPIO input channels are changing state
39
 * 
40
 * @param {String} channel - The input channel. Eg. "A"
41
 * @param {String} toState - Can be "high" or "low"
42
 */
43
function onGPIOInputChange(channel,toState){
44
    
45
    print("onGPIOInputChange - Input channel " + channel + " changed to " + toState);
46
    
47
}
48
</code></pre>
49
50
51
52
h3. KIOSK mode
53
54 2 Torbjorn Carlqvist Admin
Introduced a way of getting an http session as anonymous when explicit using the name kiosk.html on the first page.
55 1 Torbjorn Carlqvist Admin
This means that when you create a html page as *kiosk.html* and give that URL to a user it allows the user to access the page without the need for login with user/password.
56
This is typicaly practical in kiosk applications for public use.
57
Note that only 1-page applications is supported in this way so if a link to a secondary page is put in kiosk.html the user will be forwarded to the login page!
58
59
Clean up:
60
61
* Removing the MIRA and BLE5 implementations completely from the platform.
62
63
Bug fix:
64
* Added "Path=/" to cookie response. This is a hack due to lack of support in NanoHTTPD library.