Skip to content

Commit c3548f3

Browse files
committed
update website with esp32 info and updated arduino script
1 parent df0bc65 commit c3548f3

10 files changed

+249
-86
lines changed

app.css

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
html {
2+
overflow-y: scroll;
3+
}
4+
5+
6+
7+
/* width */
8+
::-webkit-scrollbar {
9+
width: 5px;
10+
height: 5px;
11+
}
12+
13+
/* Track */
14+
::-webkit-scrollbar-track {
15+
background: #f1f1f1;
16+
}
17+
18+
/* Handle */
19+
::-webkit-scrollbar-thumb {
20+
background: #888;
21+
}
22+
23+
/* Handle on hover */
24+
::-webkit-scrollbar-thumb:hover {
25+
background: #555;
26+
}
27+
28+

bluetooth.html

+77-13
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,91 @@
1414
</p>
1515

1616

17-
<p>For this guide we will use an Arduino Uno with a Bluetooth HC-05 serial module. The infrared LED with a Resistor on it's
17+
<p>Variant 1: For this guide we will use an Arduino Uno with a Bluetooth HC-05 serial module. The infrared LED with a Resistor on it's
1818
voltage pin will be attached to a PWM pin (3 as default) and GND. For the connection of the HC05 please check the following
1919
diagram. Note: It could be that you have to use a voltage regulator for the Pin-out! This depends on wether your HC05
2020
has a voltage regulator integrated on it's breakboard or not! Using the Pin-out (5V) without any voltage regulator will
2121
most likely fry your HC05! Also Note: rxPin -> TXD, txPin -> RXD!
2222
</p>
23+
<p>Variant 2: For this guide we will use an ESP32 Module which comes with WiFi and Bluetooth out of the box.
24+
</p>
25+
26+
<div class="row">
27+
<div class="col-6 col-md-6" style="font-size: 20px;font-weight: bold;">Arduino</div>
28+
<div class="col-6 col-md-6" style="font-size: 20px;font-weight: bold;">ESP32</div>
29+
<div class="col-6 col-md-6">
30+
<img src="images/hc05.png" class="img-fluid rounded" alt="Responsive image">
31+
</div>
32+
<div class="col-6 col-md-6">
33+
<img src="images/esp32.jpg" class="img-fluid rounded" alt="Responsive image">
34+
</div>
35+
36+
</div>
37+
38+
39+
<br>
2340

41+
42+
<p class="lead">
43+
Instructions for flashing
44+
</p>
45+
46+
2447
<p>
25-
<img src="images/hc05.png" class="img-fluid rounded" alt="Responsive image">
26-
</p>
2748

28-
<p class="lead">
29-
Software on Arduino
49+
<ol>
50+
<li>Make sure the components are wired up correctly. <i>Common mistake:</i> You do NOT need to connect VCC of IR Transmitter Boards, only DATA and GND!</li>
51+
<li>Download the script for your hardware using the table below</li>
52+
<li><a href="https://www.arduino.cc/en/software" target="_blank">Download</a> and Install Arduino IDE </li>
53+
<li>Install IRremote 3.3.0 using Manage Libraries (Ctrl+Shift+I)</li>
54+
<li>For ESP32 you need to add https://dl.espressif.com/dl/package_esp32_index.json in Preferences and in Board Manager you'llneed to install esp32 and select "Board: ESP32 Dev Module". Make sure you're using the correct COM Port. On Windows to flash you need to keep BOOT pressed.</li>
55+
<li>Open the Script with Arduino IDE and make sure it compiles (Ctrl+R) and after verifying do upload (Ctrl+U). After rebooting the device should be pairable in Android.</li>
56+
<li>Pair your Android with the Bluetooth module (Password: 1234). The name could vary. For ESP32 it is "irplusESP32"</li>
57+
<li>Now start/restart irplusLAN and select the <b>already paired</b> Bluetooth module in the App's settings.</li>
58+
<li>If you press a button on irplusLAN the app will transmit the signal to Arduino via Bluetooth and Arduino will send
59+
the IR signal.</li>
60+
<li>To verify you can as usual use a different phone's camera to see the IR light. Some IR Emitter Breadboards come with an LED light to show activity</li>
61+
</ol>
62+
63+
3064
</p>
65+
66+
3167

3268

33-
<p>
34-
<a href="scripts/irplusarduino.ino" target="_blank">Download the C (*.ino) sketch for Arduino</a>
35-
<br> 1. Upload the script to your Arduino
36-
<br> 2. Pair your Android with the HC-05 Bluetooth module (Password: 1234). Note the HC-05 should be in 9600 baud default
37-
mode.
38-
<br> 3. Now start/restart irplusLAN and select the HC-05 Bluetooth module in the App's settings.
39-
<br> 4. If you press a button on irplusLAN the app will transmit the signal to Arduino via Bluetooth and Arduino will send
40-
the IR signal.</p>
69+
<p class="lead">
70+
Script Downloads
71+
</p>
72+
73+
74+
<table class="table">
75+
<thead>
76+
<tr>
77+
<th scope="col">#</th>
78+
<th scope="col">Hardware</th>
79+
<th scope="col">Last updated</th>
80+
<th scope="col">Download-Link</th>
81+
</tr>
82+
</thead>
83+
<tbody>
84+
<tr>
85+
<th scope="row">1</th>
86+
<td>Arduino</td>
87+
<td>05.06.2021</td>
88+
<td>
89+
<a href="scripts/irplusarduino.ino" target="_blank">irplusarduino.ino</a>
90+
</td>
91+
92+
</tr>
93+
<tr>
94+
<th scope="row">2</th>
95+
<td>ESP32</td>
96+
<td>05.06.2021</td>
97+
<td>
98+
<a href="scripts/irplusesp32.ino" target="_blank">irplusesp32.ino</a>
99+
</td>
100+
101+
</tr>
102+
103+
</tbody>
104+
</table>

images/esp32.jpg

84.4 KB
Loading

index.html

+13-11
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,29 @@
77

88
<link rel="shortcut icon" href="favicon.ico">
99

10+
<link href="app.css" rel="stylesheet" crossorigin="anonymous">
11+
1012
<!-- Bootstrap CSS -->
11-
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
13+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
1214

1315
<title>irplus - Infrared remote</title>
1416
</head>
1517
<body style="padding-top: 56px;">
1618

1719
<!-- Optional JavaScript -->
18-
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
19-
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
20-
<!-- https://github.com/FezVrasta/popper.js -->
21-
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha256-98vAGjEDGN79TjHkYWVD4s87rvWkdWLHPs5MC3FvFX4=" crossorigin="anonymous"></script>
22-
<!-- https://github.com/twbs/bootstrap -->
23-
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
24-
20+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
21+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4" crossorigin="anonymous"></script>
22+
2523
<script src="app.js" crossorigin="anonymous"></script>
2624

27-
<div data-include="navbar.html"></div>
25+
<div class="container">
26+
27+
<div data-include="navbar.html"></div>
28+
29+
<div class="contentDiv" style="margin: 30px;">
30+
<div data-include="home.html"></div>
31+
</div>
2832

29-
<div class="contentDiv" style="margin: 30px;">
30-
<div data-include="home.html"></div>
3133
</div>
3234

3335

layouting.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="card">
88
<div class="card-header" id="headingOne">
99
<h5 class="mb-0">
10-
<button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapseOne" aria-expanded="false" aria-controls="collapseOne">
10+
<button class="btn btn-link" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="false" aria-controls="collapseOne">
1111
1. via app user interface
1212
</button>
1313
</h5>
@@ -25,7 +25,7 @@ <h5 class="mb-0">
2525
<div class="card">
2626
<div class="card-header" id="headingTwo">
2727
<h5 class="mb-0">
28-
<button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false"
28+
<button class="btn btn-link collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseTwo" aria-expanded="false"
2929
aria-controls="collapseTwo">
3030
2. via XML editor
3131
</button>

learning.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
<div class="card">
6060
<div class="card-header" id="headingTwo">
6161
<h5 class="mb-0">
62-
<button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false"
62+
<button class="btn btn-link collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseTwo" aria-expanded="false"
6363
aria-controls="collapseTwo">
6464
Raspberry Pi and IR receiver connected to GPIO
6565
</button>
@@ -154,7 +154,7 @@ <h5 class="mb-0">
154154
<div class="card">
155155
<div class="card-header" id="headingOne">
156156
<h5 class="mb-0">
157-
<button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapseOne" aria-expanded="false" aria-controls="collapseOne">
157+
<button class="btn btn-link" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="false" aria-controls="collapseOne">
158158
COM/RS232 IR receiver for PC
159159
</button>
160160
</h5>
@@ -274,7 +274,7 @@ <h5 class="mb-0">
274274
<div class="card">
275275
<div class="card-header" id="headingThree">
276276
<h5 class="mb-0">
277-
<button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapseThree" aria-expanded="false"
277+
<button class="btn btn-link collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseThree" aria-expanded="false"
278278
aria-controls="collapseThree">
279279
Smartphone (Only LG and HTC)
280280
</button>

navbar.html

+29-26
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
<nav class="navbar fixed-top navbar-expand-lg navbar-light bg-light">
2+
<div class="container">
23
<a class="navbar-brand" href="#" onclick="switchPage('home.html');">
34
<img src="images/logo.png" width="30" height="30" class="d-inline-block align-top" alt="">
4-
irplus - Infrared remote
5-
</a>
6-
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
5+
irplus - Infrared remote</a>
6+
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
7+
data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
78
<span class="navbar-toggler-icon"></span>
89
</button>
9-
1010
<div class="collapse navbar-collapse" id="navbarSupportedContent">
11-
<ul class="navbar-nav mr-auto">
12-
11+
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
12+
1313
<li class="nav-item">
14-
<a class="nav-link" href="#learning">New codes</a>
15-
</li>
14+
<a class="nav-link" href="#learning">New codes</a>
15+
</li>
16+
<li class="nav-item">
17+
<a class="nav-link" href="#technical">Technical</a>
18+
</li>
1619
<li class="nav-item">
17-
<a class="nav-link" href="#technical">Technical</a>
18-
</li>
19-
<li class="nav-item">
20-
<a class="nav-link" href="#layouting">Layout</a>
21-
</li>
22-
20+
<a class="nav-link" href="#layouting">Layout</a>
21+
</li>
22+
2323
<li class="nav-item dropdown">
24-
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
24+
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
2525
No infrared port?
2626
</a>
2727
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
@@ -33,20 +33,23 @@
3333
</div>
3434
</li>
3535
<li class="nav-item">
36-
<a class="nav-link" href="#trouble">Troubleshooting</a>
37-
</li>
36+
<a class="nav-link" href="#trouble">Troubleshooting</a>
37+
</li>
3838
<li class="nav-item">
3939
<a class="nav-link" href="#beta">Beta</a>
4040
</li>
4141
<li class="nav-item">
42-
<a class="nav-link" href="#contact">Contact</a>
43-
</li>
42+
<a class="nav-link" href="#contact">Contact</a>
43+
</li>
4444
</ul>
45-
<button class="btn btn-outline-success my-2 my-sm-0" type="submit" onclick="window.open('https://play.google.com/store/apps/details?id=net.binarymode.android.irplus', '_blank');">Install</button>
46-
<!--
47-
<form class="form-inline my-2 my-lg-0">
48-
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
49-
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
50-
</form>-->
45+
<form class="d-flex">
46+
<!--
47+
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
48+
-->
49+
50+
<button class="btn btn-outline-success my-2 my-sm-0" type="submit" onclick="window.open('https://play.google.com/store/apps/details?id=net.binarymode.android.irplus', '_blank');">Install</button>
51+
52+
</form>
5153
</div>
52-
</nav>
54+
</div>
55+
</nav>

scripts/irplusarduino.ino

+34-31
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
2-
* MIT-Licence
3-
* You will need to install this library on your PC before compiling this sketch:
4-
* https://github.com/z3t0/Arduino-IRremote
5-
*/
2+
MIT-Licence
3+
You will need to install this library on your PC before compiling this sketch:
4+
https://github.com/Arduino-IRremote/Arduino-IRremote
5+
Tested with 3.3.0 Installed with Tools -> Manage Library
6+
*/
67
#include <SoftwareSerial.h>
78
#include <IRremote.h>
89
#include <stdio.h>
910
#include <stdlib.h>
1011
#define rxPin 10
1112
#define txPin 11
12-
IRsend irsend;
13+
1314
SoftwareSerial btSerial(rxPin, txPin);
1415
//----------------------------------------------------------------
1516
int dataPosition = 0;
@@ -19,39 +20,41 @@ byte dataBytes[dataUpperLimit];
1920
void setup() {
2021
//Serial.begin(9600);//Enable/disable console serial
2122
btSerial.begin(9600);
22-
pinMode(LED_BUILTIN, OUTPUT);
23+
//WARNING: USE THE CORRECT GPIO PIN. HERE 3 IS USED!
24+
IrSender.begin(3, true); // Specify send pin and enable feedback LED at default feedback LED pin
2325
}
2426
//-------------------------------------------------------------------
2527
void loop() {
2628
if (btSerial.available() > 0) {
27-
dataBytes[dataPosition] = btSerial.read();
28-
//stop reading at this point
29-
if(dataPosition > 0 && (dataPosition % 2) != 0 && dataBytes[dataPosition-1] == 255 && dataBytes[dataPosition] == 255){
30-
//create array
31-
unsigned int carrierFrequency = 0;
32-
unsigned int dataBuffer[(dataPosition/2)-1];
33-
int byteCounter = 0;
34-
for (int i = 0; i < dataPosition/2; i++) {
35-
int currentInt = word(dataBytes[byteCounter+1],dataBytes[byteCounter]);
36-
if(i == 0){
37-
carrierFrequency = currentInt;
38-
} else {
39-
dataBuffer[i-1] = currentInt;
40-
}
41-
byteCounter = byteCounter + 2;
42-
}
29+
dataBytes[dataPosition] = btSerial.read();
30+
//stop reading at this point
31+
if (dataPosition > 0 && (dataPosition % 2) != 0 && dataBytes[dataPosition - 1] == 255 && dataBytes[dataPosition] == 255) {
32+
//create array
33+
unsigned int carrierFrequency = 0;
34+
unsigned int dataBuffer[(dataPosition / 2) - 1];
35+
int byteCounter = 0;
36+
for (int i = 0; i < dataPosition / 2; i++) {
37+
int currentInt = word(dataBytes[byteCounter + 1], dataBytes[byteCounter]);
38+
if (i == 0) {
39+
carrierFrequency = currentInt;
40+
} else {
41+
dataBuffer[i - 1] = currentInt;
42+
}
43+
byteCounter = byteCounter + 2;
44+
}
4345
//send IR
44-
digitalWrite(LED_BUILTIN, HIGH);
45-
int carrierKhz = carrierFrequency/1000;
46-
irsend.sendRaw(dataBuffer, dataPosition/2, carrierKhz);
47-
digitalWrite(LED_BUILTIN, LOW);
46+
47+
int carrierKhz = carrierFrequency / 1000;
48+
49+
IrSender.sendRaw(dataBuffer, sizeof(dataBuffer) / sizeof(dataBuffer[0]), carrierKhz); // Note the approach used to automatically calculate the size of the array.
50+
4851
//reset reading data
4952
dataPosition = 0;
5053
memset(dataBytes, 0, dataUpperLimit);
5154
btSerial.write(1);
52-
53-
} else {
54-
dataPosition++;
55-
}
56-
}
55+
56+
} else {
57+
dataPosition++;
58+
}
59+
}
5760
}

0 commit comments

Comments
 (0)